diff --git a/docs/hugo/content/reference/_index.md b/docs/hugo/content/reference/_index.md index 164b62373a3..8ff9174282c 100644 --- a/docs/hugo/content/reference/_index.md +++ b/docs/hugo/content/reference/_index.md @@ -691,18 +691,37 @@ 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 `servicebus.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 | 2022-10-01-preview | v1api20221001preview | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespace.yaml) | +| Namespace | 2021-11-01 | v1api20211101 | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20211101/v1api20211101_namespace.yaml) | +| NamespacesAuthorizationRule | 2022-10-01-preview | v1api20221001preview | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacesauthorizationrule.yaml) | +| NamespacesAuthorizationRule | 2021-11-01 | v1api20211101 | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20211101/v1api20211101_namespacesauthorizationrule.yaml) | +| NamespacesQueue | 2022-10-01-preview | v1api20221001preview | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacesqueue.yaml) | +| NamespacesQueue | 2021-11-01 | v1api20211101 | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20211101/v1api20211101_namespacesqueue.yaml) | +| NamespacesTopic | 2022-10-01-preview | v1api20221001preview | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopic.yaml) | +| NamespacesTopic | 2021-11-01 | v1api20211101 | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopic.yaml) | +| NamespacesTopicsSubscription | 2022-10-01-preview | v1api20221001preview | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopicssubscription.yaml) | +| NamespacesTopicsSubscription | 2021-11-01 | v1api20211101 | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopicssubscription.yaml) | +| NamespacesTopicsSubscriptionsRule | 2022-10-01-preview | v1api20221001preview | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopicssubscriptionsrule.yaml) | +| NamespacesTopicsSubscriptionsRule | 2021-11-01 | v1api20211101 | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopicssubscriptionsrule.yaml) | + ### Released These resource(s) are available for use in the current release of ASO. Different versions of a given resource reflect different versions of the Azure ARM API. -| Resource | ARM Version | CRD Version | Supported From | Sample | -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|----------------------|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------| -| [Namespace](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.Namespace) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api/v1api20210101preview_namespace.yaml) | -| [NamespacesAuthorizationRule](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesAuthorizationRule) | 2021-01-01-preview | v1api20210101preview | v2.1.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api/v1api20210101preview_namespacesauthorizationrule.yaml) | -| [NamespacesQueue](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesQueue) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api/v1api20210101preview_namespacesqueue.yaml) | -| [NamespacesTopic](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesTopic) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api/v1api20210101preview_namespacestopic.yaml) | -| [NamespacesTopicsSubscription](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesTopicsSubscription) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api/v1api20210101preview_namespacestopicssubscription.yaml) | -| [NamespacesTopicsSubscriptionsRule](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesTopicsSubscriptionsRule) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api/v1api20210101preview_namespacestopicssubscriptionsrule.yaml) | +| Resource | ARM Version | CRD Version | Supported From | Sample | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|----------------------|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [Namespace](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.Namespace) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespace.yaml) | +| [NamespacesAuthorizationRule](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesAuthorizationRule) | 2021-01-01-preview | v1api20210101preview | v2.1.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacesauthorizationrule.yaml) | +| [NamespacesQueue](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesQueue) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacesqueue.yaml) | +| [NamespacesTopic](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesTopic) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacestopic.yaml) | +| [NamespacesTopicsSubscription](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesTopicsSubscription) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacestopicssubscription.yaml) | +| [NamespacesTopicsSubscriptionsRule](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesTopicsSubscriptionsRule) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacestopicssubscriptionsrule.yaml) | ### Deprecated diff --git a/docs/hugo/content/reference/servicebus/_index.md b/docs/hugo/content/reference/servicebus/_index.md index 297f1f54399..f42f43a2b45 100644 --- a/docs/hugo/content/reference/servicebus/_index.md +++ b/docs/hugo/content/reference/servicebus/_index.md @@ -5,18 +5,37 @@ no_list: true --- To install the CRDs for these resources, your ASO configuration must include `servicebus.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 | 2022-10-01-preview | v1api20221001preview | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespace.yaml) | +| Namespace | 2021-11-01 | v1api20211101 | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20211101/v1api20211101_namespace.yaml) | +| NamespacesAuthorizationRule | 2022-10-01-preview | v1api20221001preview | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacesauthorizationrule.yaml) | +| NamespacesAuthorizationRule | 2021-11-01 | v1api20211101 | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20211101/v1api20211101_namespacesauthorizationrule.yaml) | +| NamespacesQueue | 2022-10-01-preview | v1api20221001preview | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacesqueue.yaml) | +| NamespacesQueue | 2021-11-01 | v1api20211101 | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20211101/v1api20211101_namespacesqueue.yaml) | +| NamespacesTopic | 2022-10-01-preview | v1api20221001preview | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopic.yaml) | +| NamespacesTopic | 2021-11-01 | v1api20211101 | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopic.yaml) | +| NamespacesTopicsSubscription | 2022-10-01-preview | v1api20221001preview | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopicssubscription.yaml) | +| NamespacesTopicsSubscription | 2021-11-01 | v1api20211101 | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopicssubscription.yaml) | +| NamespacesTopicsSubscriptionsRule | 2022-10-01-preview | v1api20221001preview | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopicssubscriptionsrule.yaml) | +| NamespacesTopicsSubscriptionsRule | 2021-11-01 | v1api20211101 | v2.3.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopicssubscriptionsrule.yaml) | + ### Released These resource(s) are available for use in the current release of ASO. Different versions of a given resource reflect different versions of the Azure ARM API. -| Resource | ARM Version | CRD Version | Supported From | Sample | -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|----------------------|----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------| -| [Namespace](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.Namespace) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api/v1api20210101preview_namespace.yaml) | -| [NamespacesAuthorizationRule](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesAuthorizationRule) | 2021-01-01-preview | v1api20210101preview | v2.1.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api/v1api20210101preview_namespacesauthorizationrule.yaml) | -| [NamespacesQueue](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesQueue) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api/v1api20210101preview_namespacesqueue.yaml) | -| [NamespacesTopic](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesTopic) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api/v1api20210101preview_namespacestopic.yaml) | -| [NamespacesTopicsSubscription](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesTopicsSubscription) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api/v1api20210101preview_namespacestopicssubscription.yaml) | -| [NamespacesTopicsSubscriptionsRule](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesTopicsSubscriptionsRule) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api/v1api20210101preview_namespacestopicssubscriptionsrule.yaml) | +| Resource | ARM Version | CRD Version | Supported From | Sample | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|----------------------|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [Namespace](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.Namespace) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespace.yaml) | +| [NamespacesAuthorizationRule](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesAuthorizationRule) | 2021-01-01-preview | v1api20210101preview | v2.1.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacesauthorizationrule.yaml) | +| [NamespacesQueue](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesQueue) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacesqueue.yaml) | +| [NamespacesTopic](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesTopic) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacestopic.yaml) | +| [NamespacesTopicsSubscription](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesTopicsSubscription) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacestopicssubscription.yaml) | +| [NamespacesTopicsSubscriptionsRule](https://azure.github.io/azure-service-operator/reference/servicebus/v1api20210101preview/#servicebus.azure.com/v1api20210101preview.NamespacesTopicsSubscriptionsRule) | 2021-01-01-preview | v1api20210101preview | v2.0.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacestopicssubscriptionsrule.yaml) | ### Deprecated diff --git a/v2/api/servicebus/customizations/namespace_extension_types_gen.go b/v2/api/servicebus/customizations/namespace_extension_types_gen.go index 1ada221e062..d9fef33807d 100644 --- a/v2/api/servicebus/customizations/namespace_extension_types_gen.go +++ b/v2/api/servicebus/customizations/namespace_extension_types_gen.go @@ -6,6 +6,10 @@ package customizations import ( v20210101p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" v1beta20210101p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101preview" v1beta20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101previewstorage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" @@ -19,6 +23,10 @@ func (extension *NamespaceExtension) GetExtendedResources() []genruntime.Kuberne return []genruntime.KubernetesResource{ &v20210101p.Namespace{}, &v20210101ps.Namespace{}, + &v20211101.Namespace{}, + &v20211101s.Namespace{}, + &v20221001p.Namespace{}, + &v20221001ps.Namespace{}, &v1beta20210101p.Namespace{}, &v1beta20210101ps.Namespace{}} } diff --git a/v2/api/servicebus/customizations/namespace_extensions.go b/v2/api/servicebus/customizations/namespace_extensions.go index 490d41920a2..7d58901cdd9 100644 --- a/v2/api/servicebus/customizations/namespace_extensions.go +++ b/v2/api/servicebus/customizations/namespace_extensions.go @@ -10,9 +10,9 @@ import ( "github.com/go-logr/logr" "github.com/pkg/errors" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" - servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" . "github.com/Azure/azure-service-operator/v2/internal/logging" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/v2/api/servicebus/customizations/namespaces_authorization_rule_extension_types_gen.go b/v2/api/servicebus/customizations/namespaces_authorization_rule_extension_types_gen.go index d9c9a3db928..f11cf34aca8 100644 --- a/v2/api/servicebus/customizations/namespaces_authorization_rule_extension_types_gen.go +++ b/v2/api/servicebus/customizations/namespaces_authorization_rule_extension_types_gen.go @@ -6,6 +6,10 @@ package customizations import ( v20210101p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -16,5 +20,9 @@ type NamespacesAuthorizationRuleExtension struct { func (extension *NamespacesAuthorizationRuleExtension) GetExtendedResources() []genruntime.KubernetesResource { return []genruntime.KubernetesResource{ &v20210101p.NamespacesAuthorizationRule{}, - &v20210101ps.NamespacesAuthorizationRule{}} + &v20210101ps.NamespacesAuthorizationRule{}, + &v20211101.NamespacesAuthorizationRule{}, + &v20211101s.NamespacesAuthorizationRule{}, + &v20221001p.NamespacesAuthorizationRule{}, + &v20221001ps.NamespacesAuthorizationRule{}} } diff --git a/v2/api/servicebus/customizations/namespaces_authorization_rule_extensions.go b/v2/api/servicebus/customizations/namespaces_authorization_rule_extensions.go index 11206f954c5..da80fef14d7 100644 --- a/v2/api/servicebus/customizations/namespaces_authorization_rule_extensions.go +++ b/v2/api/servicebus/customizations/namespaces_authorization_rule_extensions.go @@ -9,14 +9,14 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "github.com/go-logr/logr" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/conversion" - servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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/servicebus/customizations/namespaces_queue_extension_types_gen.go b/v2/api/servicebus/customizations/namespaces_queue_extension_types_gen.go index be607ce0d1c..3fe114dda00 100644 --- a/v2/api/servicebus/customizations/namespaces_queue_extension_types_gen.go +++ b/v2/api/servicebus/customizations/namespaces_queue_extension_types_gen.go @@ -6,6 +6,10 @@ package customizations import ( v20210101p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" v1beta20210101p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101preview" v1beta20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101previewstorage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" @@ -19,6 +23,10 @@ func (extension *NamespacesQueueExtension) GetExtendedResources() []genruntime.K return []genruntime.KubernetesResource{ &v20210101p.NamespacesQueue{}, &v20210101ps.NamespacesQueue{}, + &v20211101.NamespacesQueue{}, + &v20211101s.NamespacesQueue{}, + &v20221001p.NamespacesQueue{}, + &v20221001ps.NamespacesQueue{}, &v1beta20210101p.NamespacesQueue{}, &v1beta20210101ps.NamespacesQueue{}} } diff --git a/v2/api/servicebus/customizations/namespaces_topic_extension_types_gen.go b/v2/api/servicebus/customizations/namespaces_topic_extension_types_gen.go index 0f4d0192515..e98a7c2f123 100644 --- a/v2/api/servicebus/customizations/namespaces_topic_extension_types_gen.go +++ b/v2/api/servicebus/customizations/namespaces_topic_extension_types_gen.go @@ -6,6 +6,10 @@ package customizations import ( v20210101p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" v1beta20210101p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101preview" v1beta20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101previewstorage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" @@ -19,6 +23,10 @@ func (extension *NamespacesTopicExtension) GetExtendedResources() []genruntime.K return []genruntime.KubernetesResource{ &v20210101p.NamespacesTopic{}, &v20210101ps.NamespacesTopic{}, + &v20211101.NamespacesTopic{}, + &v20211101s.NamespacesTopic{}, + &v20221001p.NamespacesTopic{}, + &v20221001ps.NamespacesTopic{}, &v1beta20210101p.NamespacesTopic{}, &v1beta20210101ps.NamespacesTopic{}} } diff --git a/v2/api/servicebus/customizations/namespaces_topics_subscription_extension_types_gen.go b/v2/api/servicebus/customizations/namespaces_topics_subscription_extension_types_gen.go index 9755f9bb35d..99f73438223 100644 --- a/v2/api/servicebus/customizations/namespaces_topics_subscription_extension_types_gen.go +++ b/v2/api/servicebus/customizations/namespaces_topics_subscription_extension_types_gen.go @@ -6,6 +6,10 @@ package customizations import ( v20210101p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" v1beta20210101p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101preview" v1beta20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101previewstorage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" @@ -19,6 +23,10 @@ func (extension *NamespacesTopicsSubscriptionExtension) GetExtendedResources() [ return []genruntime.KubernetesResource{ &v20210101p.NamespacesTopicsSubscription{}, &v20210101ps.NamespacesTopicsSubscription{}, + &v20211101.NamespacesTopicsSubscription{}, + &v20211101s.NamespacesTopicsSubscription{}, + &v20221001p.NamespacesTopicsSubscription{}, + &v20221001ps.NamespacesTopicsSubscription{}, &v1beta20210101p.NamespacesTopicsSubscription{}, &v1beta20210101ps.NamespacesTopicsSubscription{}} } diff --git a/v2/api/servicebus/customizations/namespaces_topics_subscriptions_rule_extension_types_gen.go b/v2/api/servicebus/customizations/namespaces_topics_subscriptions_rule_extension_types_gen.go index a0973b57a42..1e6a9502da4 100644 --- a/v2/api/servicebus/customizations/namespaces_topics_subscriptions_rule_extension_types_gen.go +++ b/v2/api/servicebus/customizations/namespaces_topics_subscriptions_rule_extension_types_gen.go @@ -6,6 +6,10 @@ package customizations import ( v20210101p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" v1beta20210101p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101preview" v1beta20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101previewstorage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" @@ -19,6 +23,10 @@ func (extension *NamespacesTopicsSubscriptionsRuleExtension) GetExtendedResource return []genruntime.KubernetesResource{ &v20210101p.NamespacesTopicsSubscriptionsRule{}, &v20210101ps.NamespacesTopicsSubscriptionsRule{}, + &v20211101.NamespacesTopicsSubscriptionsRule{}, + &v20211101s.NamespacesTopicsSubscriptionsRule{}, + &v20221001p.NamespacesTopicsSubscriptionsRule{}, + &v20221001ps.NamespacesTopicsSubscriptionsRule{}, &v1beta20210101p.NamespacesTopicsSubscriptionsRule{}, &v1beta20210101ps.NamespacesTopicsSubscriptionsRule{}} } diff --git a/v2/api/servicebus/v1api20210101preview/namespace_types_gen.go b/v2/api/servicebus/v1api20210101preview/namespace_types_gen.go index 9cf9ab713da..8d203262122 100644 --- a/v2/api/servicebus/v1api20210101preview/namespace_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/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.(*v20210101ps.Namespace) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/Namespace but received %T instead", hub) + // intermediate variable for conversion + var source v20210101ps.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.(*v20210101ps.Namespace) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/Namespace but received %T instead", hub) + // intermediate variable for conversion + var destination v20210101ps.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-servicebus-azure-com-v1api20210101preview-namespace,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespaces,verbs=create;update,versions=v1api20210101preview,name=default.v1api20210101preview.namespaces.servicebus.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 @@ -742,63 +745,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 { - - // 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 - } - - // Location - namespace.Location = genruntime.ClonePointerToString(source.Location) - - // Sku - if source.Sku != nil { - var sku SBSku - err := sku.Initialize_From_SBSku_STATUS(source.Sku) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_SBSku_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 @@ -1504,47 +1450,6 @@ func (encryption *Encryption) AssignProperties_To_Encryption(destination *v20210 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 @@ -1824,33 +1729,6 @@ func (identity *Identity) AssignProperties_To_Identity(destination *v20210101ps. 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 User Assigned Identities for Bring your Own Keys type Identity_STATUS struct { // PrincipalId: ObjectId from the KeyVault @@ -2251,32 +2129,6 @@ func (sbSku *SBSku) AssignProperties_To_SBSku(destination *v20210101ps.SBSku) er return nil } -// Initialize_From_SBSku_STATUS populates our SBSku from the provided source SBSku_STATUS -func (sbSku *SBSku) Initialize_From_SBSku_STATUS(source *SBSku_STATUS) error { - - // Capacity - sbSku.Capacity = genruntime.ClonePointerToInt(source.Capacity) - - // Name - if source.Name != nil { - name := SBSku_Name(*source.Name) - sbSku.Name = &name - } else { - sbSku.Name = nil - } - - // Tier - if source.Tier != nil { - tier := SBSku_Tier(*source.Tier) - sbSku.Tier = &tier - } else { - sbSku.Tier = nil - } - - // No error - return nil -} - // SKU of the namespace. type SBSku_STATUS struct { // Capacity: The specified messaging units for the tier. For Premium tier, capacity are 1,2 and 4. @@ -2786,34 +2638,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"` @@ -3181,13 +3005,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/servicebus/v1api20210101preview/namespace_types_gen_test.go b/v2/api/servicebus/v1api20210101preview/namespace_types_gen_test.go index a3c6093fa98..55fcc89fe68 100644 --- a/v2/api/servicebus/v1api20210101preview/namespace_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/namespace_types_gen_test.go @@ -6,6 +6,7 @@ package v1api20210101preview import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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 v20210101ps.Namespace + var hub v20211101s.Namespace err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20210101preview/namespaces_authorization_rule_types_gen.go index 63d5c23e448..d5b5e79a3c2 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_authorization_rule_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/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.(*v20210101ps.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesAuthorizationRule but received %T instead", hub) + // intermediate variable for conversion + var source v20210101ps.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.(*v20210101ps.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesAuthorizationRule but received %T instead", hub) + // intermediate variable for conversion + var destination v20210101ps.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-servicebus-azure-com-v1api20210101preview-namespacesauthorizationrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesauthorizationrules,verbs=create;update,versions=v1api20210101preview,name=default.v1api20210101preview.namespacesauthorizationrules.servicebus.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 @@ -555,27 +558,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 diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_authorization_rule_types_gen_test.go b/v2/api/servicebus/v1api20210101preview/namespaces_authorization_rule_types_gen_test.go index a40edd07164..d2f8b39e855 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_authorization_rule_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_authorization_rule_types_gen_test.go @@ -6,6 +6,7 @@ package v1api20210101preview import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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 v20210101ps.NamespacesAuthorizationRule + var hub v20211101s.NamespacesAuthorizationRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen.go index 920ebd69662..d270c3809c9 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen.go @@ -49,22 +49,36 @@ var _ conversion.Convertible = &NamespacesQueue{} // ConvertFrom populates our NamespacesQueue from the provided hub NamespacesQueue func (queue *NamespacesQueue) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20210101ps.NamespacesQueue) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesQueue but received %T instead", hub) + // intermediate variable for conversion + var source v20210101ps.NamespacesQueue + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") + } + + err = queue.AssignProperties_From_NamespacesQueue(&source) + if err != nil { + return errors.Wrap(err, "converting from source to queue") } - return queue.AssignProperties_From_NamespacesQueue(source) + return nil } // ConvertTo populates the provided hub NamespacesQueue from our NamespacesQueue func (queue *NamespacesQueue) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20210101ps.NamespacesQueue) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesQueue but received %T instead", hub) + // intermediate variable for conversion + var destination v20210101ps.NamespacesQueue + err := queue.AssignProperties_To_NamespacesQueue(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from queue") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") } - return queue.AssignProperties_To_NamespacesQueue(destination) + return nil } // +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20210101preview-namespacesqueue,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesqueues,verbs=create;update,versions=v1api20210101preview,name=default.v1api20210101preview.namespacesqueues.servicebus.azure.com,admissionReviewVersions=v1 @@ -90,17 +104,6 @@ func (queue *NamespacesQueue) defaultAzureName() { // defaultImpl applies the code generated defaults to the NamespacesQueue resource func (queue *NamespacesQueue) defaultImpl() { queue.defaultAzureName() } -var _ genruntime.ImportableResource = &NamespacesQueue{} - -// InitializeSpec initializes the spec for this resource from the given status -func (queue *NamespacesQueue) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespaces_Queue_STATUS); ok { - return queue.Spec.Initialize_From_Namespaces_Queue_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespaces_Queue_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &NamespacesQueue{} // AzureName returns the Azure name of the resource @@ -852,85 +855,6 @@ func (queue *Namespaces_Queue_Spec) AssignProperties_To_Namespaces_Queue_Spec(de return nil } -// Initialize_From_Namespaces_Queue_STATUS populates our Namespaces_Queue_Spec from the provided source Namespaces_Queue_STATUS -func (queue *Namespaces_Queue_Spec) Initialize_From_Namespaces_Queue_STATUS(source *Namespaces_Queue_STATUS) error { - - // AutoDeleteOnIdle - queue.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) - - // DeadLetteringOnMessageExpiration - if source.DeadLetteringOnMessageExpiration != nil { - deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration - queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration - } else { - queue.DeadLetteringOnMessageExpiration = nil - } - - // DefaultMessageTimeToLive - queue.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) - - // DuplicateDetectionHistoryTimeWindow - queue.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) - - // EnableBatchedOperations - if source.EnableBatchedOperations != nil { - enableBatchedOperation := *source.EnableBatchedOperations - queue.EnableBatchedOperations = &enableBatchedOperation - } else { - queue.EnableBatchedOperations = nil - } - - // EnableExpress - if source.EnableExpress != nil { - enableExpress := *source.EnableExpress - queue.EnableExpress = &enableExpress - } else { - queue.EnableExpress = nil - } - - // EnablePartitioning - if source.EnablePartitioning != nil { - enablePartitioning := *source.EnablePartitioning - queue.EnablePartitioning = &enablePartitioning - } else { - queue.EnablePartitioning = nil - } - - // ForwardDeadLetteredMessagesTo - queue.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) - - // ForwardTo - queue.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) - - // LockDuration - queue.LockDuration = genruntime.ClonePointerToString(source.LockDuration) - - // MaxDeliveryCount - queue.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) - - // MaxSizeInMegabytes - queue.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) - - // RequiresDuplicateDetection - if source.RequiresDuplicateDetection != nil { - requiresDuplicateDetection := *source.RequiresDuplicateDetection - queue.RequiresDuplicateDetection = &requiresDuplicateDetection - } else { - queue.RequiresDuplicateDetection = nil - } - - // RequiresSession - if source.RequiresSession != nil { - requiresSession := *source.RequiresSession - queue.RequiresSession = &requiresSession - } else { - queue.RequiresSession = nil - } - - // No error - return nil -} - // OriginalVersion returns the original API version used to create the resource. func (queue *Namespaces_Queue_Spec) OriginalVersion() string { return GroupVersion.Version diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen_test.go index b5c24ef5c2d..bb61059b99b 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen_test.go @@ -6,6 +6,7 @@ package v1api20210101preview import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesQueue(subject NamespacesQueue) string copied := subject.DeepCopy() // Convert to our hub version - var hub v20210101ps.NamespacesQueue + var hub v20211101s.NamespacesQueue err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen.go index f3600b477f8..b21050ff747 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen.go @@ -49,22 +49,36 @@ var _ conversion.Convertible = &NamespacesTopic{} // ConvertFrom populates our NamespacesTopic from the provided hub NamespacesTopic func (topic *NamespacesTopic) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20210101ps.NamespacesTopic) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesTopic but received %T instead", hub) + // intermediate variable for conversion + var source v20210101ps.NamespacesTopic + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") + } + + err = topic.AssignProperties_From_NamespacesTopic(&source) + if err != nil { + return errors.Wrap(err, "converting from source to topic") } - return topic.AssignProperties_From_NamespacesTopic(source) + return nil } // ConvertTo populates the provided hub NamespacesTopic from our NamespacesTopic func (topic *NamespacesTopic) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20210101ps.NamespacesTopic) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesTopic but received %T instead", hub) + // intermediate variable for conversion + var destination v20210101ps.NamespacesTopic + err := topic.AssignProperties_To_NamespacesTopic(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from topic") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") } - return topic.AssignProperties_To_NamespacesTopic(destination) + return nil } // +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20210101preview-namespacestopic,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopics,verbs=create;update,versions=v1api20210101preview,name=default.v1api20210101preview.namespacestopics.servicebus.azure.com,admissionReviewVersions=v1 @@ -90,17 +104,6 @@ func (topic *NamespacesTopic) defaultAzureName() { // defaultImpl applies the code generated defaults to the NamespacesTopic resource func (topic *NamespacesTopic) defaultImpl() { topic.defaultAzureName() } -var _ genruntime.ImportableResource = &NamespacesTopic{} - -// InitializeSpec initializes the spec for this resource from the given status -func (topic *NamespacesTopic) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespaces_Topic_STATUS); ok { - return topic.Spec.Initialize_From_Namespaces_Topic_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespaces_Topic_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &NamespacesTopic{} // AzureName returns the Azure name of the resource @@ -724,65 +727,6 @@ func (topic *Namespaces_Topic_Spec) AssignProperties_To_Namespaces_Topic_Spec(de return nil } -// Initialize_From_Namespaces_Topic_STATUS populates our Namespaces_Topic_Spec from the provided source Namespaces_Topic_STATUS -func (topic *Namespaces_Topic_Spec) Initialize_From_Namespaces_Topic_STATUS(source *Namespaces_Topic_STATUS) error { - - // AutoDeleteOnIdle - topic.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) - - // DefaultMessageTimeToLive - topic.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) - - // DuplicateDetectionHistoryTimeWindow - topic.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) - - // EnableBatchedOperations - if source.EnableBatchedOperations != nil { - enableBatchedOperation := *source.EnableBatchedOperations - topic.EnableBatchedOperations = &enableBatchedOperation - } else { - topic.EnableBatchedOperations = nil - } - - // EnableExpress - if source.EnableExpress != nil { - enableExpress := *source.EnableExpress - topic.EnableExpress = &enableExpress - } else { - topic.EnableExpress = nil - } - - // EnablePartitioning - if source.EnablePartitioning != nil { - enablePartitioning := *source.EnablePartitioning - topic.EnablePartitioning = &enablePartitioning - } else { - topic.EnablePartitioning = nil - } - - // MaxSizeInMegabytes - topic.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) - - // RequiresDuplicateDetection - if source.RequiresDuplicateDetection != nil { - requiresDuplicateDetection := *source.RequiresDuplicateDetection - topic.RequiresDuplicateDetection = &requiresDuplicateDetection - } else { - topic.RequiresDuplicateDetection = nil - } - - // SupportOrdering - if source.SupportOrdering != nil { - supportOrdering := *source.SupportOrdering - topic.SupportOrdering = &supportOrdering - } else { - topic.SupportOrdering = nil - } - - // No error - return nil -} - // OriginalVersion returns the original API version used to create the resource. func (topic *Namespaces_Topic_Spec) OriginalVersion() string { return GroupVersion.Version diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen_test.go index dc7eeee8f3c..ba67ae75283 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen_test.go @@ -6,6 +6,7 @@ package v1api20210101preview import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesTopic(subject NamespacesTopic) string copied := subject.DeepCopy() // Convert to our hub version - var hub v20210101ps.NamespacesTopic + var hub v20211101s.NamespacesTopic err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscription_types_gen.go index 69dd9b9b6b6..7218f5e0482 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscription_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscription_types_gen.go @@ -49,22 +49,36 @@ var _ conversion.Convertible = &NamespacesTopicsSubscription{} // ConvertFrom populates our NamespacesTopicsSubscription from the provided hub NamespacesTopicsSubscription func (subscription *NamespacesTopicsSubscription) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20210101ps.NamespacesTopicsSubscription) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesTopicsSubscription but received %T instead", hub) + // intermediate variable for conversion + var source v20210101ps.NamespacesTopicsSubscription + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") + } + + err = subscription.AssignProperties_From_NamespacesTopicsSubscription(&source) + if err != nil { + return errors.Wrap(err, "converting from source to subscription") } - return subscription.AssignProperties_From_NamespacesTopicsSubscription(source) + return nil } // ConvertTo populates the provided hub NamespacesTopicsSubscription from our NamespacesTopicsSubscription func (subscription *NamespacesTopicsSubscription) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20210101ps.NamespacesTopicsSubscription) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesTopicsSubscription but received %T instead", hub) + // intermediate variable for conversion + var destination v20210101ps.NamespacesTopicsSubscription + err := subscription.AssignProperties_To_NamespacesTopicsSubscription(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from subscription") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") } - return subscription.AssignProperties_To_NamespacesTopicsSubscription(destination) + return nil } // +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20210101preview-namespacestopicssubscription,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptions,verbs=create;update,versions=v1api20210101preview,name=default.v1api20210101preview.namespacestopicssubscriptions.servicebus.azure.com,admissionReviewVersions=v1 @@ -90,17 +104,6 @@ func (subscription *NamespacesTopicsSubscription) defaultAzureName() { // defaultImpl applies the code generated defaults to the NamespacesTopicsSubscription resource func (subscription *NamespacesTopicsSubscription) defaultImpl() { subscription.defaultAzureName() } -var _ genruntime.ImportableResource = &NamespacesTopicsSubscription{} - -// InitializeSpec initializes the spec for this resource from the given status -func (subscription *NamespacesTopicsSubscription) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespaces_Topics_Subscription_STATUS); ok { - return subscription.Spec.Initialize_From_Namespaces_Topics_Subscription_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespaces_Topics_Subscription_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &NamespacesTopicsSubscription{} // AzureName returns the Azure name of the resource @@ -761,66 +764,6 @@ func (subscription *Namespaces_Topics_Subscription_Spec) AssignProperties_To_Nam return nil } -// Initialize_From_Namespaces_Topics_Subscription_STATUS populates our Namespaces_Topics_Subscription_Spec from the provided source Namespaces_Topics_Subscription_STATUS -func (subscription *Namespaces_Topics_Subscription_Spec) Initialize_From_Namespaces_Topics_Subscription_STATUS(source *Namespaces_Topics_Subscription_STATUS) error { - - // AutoDeleteOnIdle - subscription.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) - - // DeadLetteringOnFilterEvaluationExceptions - if source.DeadLetteringOnFilterEvaluationExceptions != nil { - deadLetteringOnFilterEvaluationException := *source.DeadLetteringOnFilterEvaluationExceptions - subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException - } else { - subscription.DeadLetteringOnFilterEvaluationExceptions = nil - } - - // DeadLetteringOnMessageExpiration - if source.DeadLetteringOnMessageExpiration != nil { - deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration - subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration - } else { - subscription.DeadLetteringOnMessageExpiration = nil - } - - // DefaultMessageTimeToLive - subscription.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) - - // DuplicateDetectionHistoryTimeWindow - subscription.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) - - // EnableBatchedOperations - if source.EnableBatchedOperations != nil { - enableBatchedOperation := *source.EnableBatchedOperations - subscription.EnableBatchedOperations = &enableBatchedOperation - } else { - subscription.EnableBatchedOperations = nil - } - - // ForwardDeadLetteredMessagesTo - subscription.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) - - // ForwardTo - subscription.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) - - // LockDuration - subscription.LockDuration = genruntime.ClonePointerToString(source.LockDuration) - - // MaxDeliveryCount - subscription.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) - - // RequiresSession - if source.RequiresSession != nil { - requiresSession := *source.RequiresSession - subscription.RequiresSession = &requiresSession - } else { - subscription.RequiresSession = nil - } - - // No error - return nil -} - // OriginalVersion returns the original API version used to create the resource. func (subscription *Namespaces_Topics_Subscription_Spec) OriginalVersion() string { return GroupVersion.Version diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscription_types_gen_test.go b/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscription_types_gen_test.go index 698ea0c1a0e..7b44f54f987 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscription_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscription_types_gen_test.go @@ -6,6 +6,7 @@ package v1api20210101preview import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesTopicsSubscription(subject Namespaces copied := subject.DeepCopy() // Convert to our hub version - var hub v20210101ps.NamespacesTopicsSubscription + var hub v20211101s.NamespacesTopicsSubscription err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscriptions_rule_types_gen.go index 6c34935b0d5..63114231692 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscriptions_rule_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscriptions_rule_types_gen.go @@ -49,22 +49,36 @@ var _ conversion.Convertible = &NamespacesTopicsSubscriptionsRule{} // ConvertFrom populates our NamespacesTopicsSubscriptionsRule from the provided hub NamespacesTopicsSubscriptionsRule func (rule *NamespacesTopicsSubscriptionsRule) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20210101ps.NamespacesTopicsSubscriptionsRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + // intermediate variable for conversion + var source v20210101ps.NamespacesTopicsSubscriptionsRule + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") } - return rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule(source) + err = rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule(&source) + if err != nil { + return errors.Wrap(err, "converting from source to rule") + } + + return nil } // ConvertTo populates the provided hub NamespacesTopicsSubscriptionsRule from our NamespacesTopicsSubscriptionsRule func (rule *NamespacesTopicsSubscriptionsRule) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20210101ps.NamespacesTopicsSubscriptionsRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + // intermediate variable for conversion + var destination v20210101ps.NamespacesTopicsSubscriptionsRule + err := rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(&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_NamespacesTopicsSubscriptionsRule(destination) + return nil } // +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20210101preview-namespacestopicssubscriptionsrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptionsrules,verbs=create;update,versions=v1api20210101preview,name=default.v1api20210101preview.namespacestopicssubscriptionsrules.servicebus.azure.com,admissionReviewVersions=v1 @@ -90,17 +104,6 @@ func (rule *NamespacesTopicsSubscriptionsRule) defaultAzureName() { // defaultImpl applies the code generated defaults to the NamespacesTopicsSubscriptionsRule resource func (rule *NamespacesTopicsSubscriptionsRule) defaultImpl() { rule.defaultAzureName() } -var _ genruntime.ImportableResource = &NamespacesTopicsSubscriptionsRule{} - -// InitializeSpec initializes the spec for this resource from the given status -func (rule *NamespacesTopicsSubscriptionsRule) InitializeSpec(status genruntime.ConvertibleStatus) error { - if s, ok := status.(*Namespaces_Topics_Subscriptions_Rule_STATUS); ok { - return rule.Spec.Initialize_From_Namespaces_Topics_Subscriptions_Rule_STATUS(s) - } - - return fmt.Errorf("expected Status of type Namespaces_Topics_Subscriptions_Rule_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &NamespacesTopicsSubscriptionsRule{} // AzureName returns the Azure name of the resource @@ -646,57 +649,6 @@ func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) AssignProperties_To_Names return nil } -// Initialize_From_Namespaces_Topics_Subscriptions_Rule_STATUS populates our Namespaces_Topics_Subscriptions_Rule_Spec from the provided source Namespaces_Topics_Subscriptions_Rule_STATUS -func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) Initialize_From_Namespaces_Topics_Subscriptions_Rule_STATUS(source *Namespaces_Topics_Subscriptions_Rule_STATUS) error { - - // Action - if source.Action != nil { - var action Action - err := action.Initialize_From_Action_STATUS(source.Action) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_Action_STATUS() to populate field Action") - } - rule.Action = &action - } else { - rule.Action = nil - } - - // CorrelationFilter - if source.CorrelationFilter != nil { - var correlationFilter CorrelationFilter - err := correlationFilter.Initialize_From_CorrelationFilter_STATUS(source.CorrelationFilter) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_CorrelationFilter_STATUS() to populate field CorrelationFilter") - } - rule.CorrelationFilter = &correlationFilter - } else { - rule.CorrelationFilter = nil - } - - // FilterType - if source.FilterType != nil { - filterType := FilterType(*source.FilterType) - rule.FilterType = &filterType - } else { - rule.FilterType = nil - } - - // SqlFilter - if source.SqlFilter != nil { - var sqlFilter SqlFilter - err := sqlFilter.Initialize_From_SqlFilter_STATUS(source.SqlFilter) - if err != nil { - return errors.Wrap(err, "calling Initialize_From_SqlFilter_STATUS() to populate field SqlFilter") - } - rule.SqlFilter = &sqlFilter - } else { - rule.SqlFilter = nil - } - - // No error - return nil -} - // OriginalVersion returns the original API version used to create the resource. func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) OriginalVersion() string { return GroupVersion.Version @@ -1174,27 +1126,6 @@ func (action *Action) AssignProperties_To_Action(destination *v20210101ps.Action return nil } -// Initialize_From_Action_STATUS populates our Action from the provided source Action_STATUS -func (action *Action) Initialize_From_Action_STATUS(source *Action_STATUS) error { - - // CompatibilityLevel - action.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) - - // RequiresPreprocessing - if source.RequiresPreprocessing != nil { - requiresPreprocessing := *source.RequiresPreprocessing - action.RequiresPreprocessing = &requiresPreprocessing - } else { - action.RequiresPreprocessing = nil - } - - // SqlExpression - action.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) - - // No error - return nil -} - // Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter // expression. type Action_STATUS struct { @@ -1573,48 +1504,6 @@ func (filter *CorrelationFilter) AssignProperties_To_CorrelationFilter(destinati return nil } -// Initialize_From_CorrelationFilter_STATUS populates our CorrelationFilter from the provided source CorrelationFilter_STATUS -func (filter *CorrelationFilter) Initialize_From_CorrelationFilter_STATUS(source *CorrelationFilter_STATUS) error { - - // ContentType - filter.ContentType = genruntime.ClonePointerToString(source.ContentType) - - // CorrelationId - filter.CorrelationId = genruntime.ClonePointerToString(source.CorrelationId) - - // Label - filter.Label = genruntime.ClonePointerToString(source.Label) - - // MessageId - filter.MessageId = genruntime.ClonePointerToString(source.MessageId) - - // Properties - filter.Properties = genruntime.CloneMapOfStringToString(source.Properties) - - // ReplyTo - filter.ReplyTo = genruntime.ClonePointerToString(source.ReplyTo) - - // ReplyToSessionId - filter.ReplyToSessionId = genruntime.ClonePointerToString(source.ReplyToSessionId) - - // RequiresPreprocessing - if source.RequiresPreprocessing != nil { - requiresPreprocessing := *source.RequiresPreprocessing - filter.RequiresPreprocessing = &requiresPreprocessing - } else { - filter.RequiresPreprocessing = nil - } - - // SessionId - filter.SessionId = genruntime.ClonePointerToString(source.SessionId) - - // To - filter.To = genruntime.ClonePointerToString(source.To) - - // No error - return nil -} - // Represents the correlation filter expression. type CorrelationFilter_STATUS struct { // ContentType: Content type of the message. @@ -1977,32 +1866,6 @@ func (filter *SqlFilter) AssignProperties_To_SqlFilter(destination *v20210101ps. return nil } -// Initialize_From_SqlFilter_STATUS populates our SqlFilter from the provided source SqlFilter_STATUS -func (filter *SqlFilter) Initialize_From_SqlFilter_STATUS(source *SqlFilter_STATUS) error { - - // CompatibilityLevel - if source.CompatibilityLevel != nil { - compatibilityLevel := *source.CompatibilityLevel - filter.CompatibilityLevel = &compatibilityLevel - } else { - filter.CompatibilityLevel = nil - } - - // RequiresPreprocessing - if source.RequiresPreprocessing != nil { - requiresPreprocessing := *source.RequiresPreprocessing - filter.RequiresPreprocessing = &requiresPreprocessing - } else { - filter.RequiresPreprocessing = nil - } - - // SqlExpression - filter.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) - - // No error - return nil -} - // Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. type SqlFilter_STATUS struct { // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, diff --git a/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscriptions_rule_types_gen_test.go b/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscriptions_rule_types_gen_test.go index 4042e2ada04..b2350eccbb8 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscriptions_rule_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_topics_subscriptions_rule_types_gen_test.go @@ -6,6 +6,7 @@ package v1api20210101preview import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesTopicsSubscriptionsRule(subject Names copied := subject.DeepCopy() // Convert to our hub version - var hub v20210101ps.NamespacesTopicsSubscriptionsRule + var hub v20211101s.NamespacesTopicsSubscriptionsRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20210101previewstorage/namespace_types_gen.go b/v2/api/servicebus/v1api20210101previewstorage/namespace_types_gen.go index 6c333a8ae9b..53bcf8a2a73 100644 --- a/v2/api/servicebus/v1api20210101previewstorage/namespace_types_gen.go +++ b/v2/api/servicebus/v1api20210101previewstorage/namespace_types_gen.go @@ -4,19 +4,18 @@ package v1api20210101previewstorage import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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=servicebus.azure.com,resources=namespaces,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=servicebus.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.(*v20211101s.Namespace) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/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.(*v20211101s.Namespace) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/Namespace but received %T instead", hub) + } + + return namespace.AssignProperties_To_Namespace(destination) +} + var _ genruntime.KubernetesResource = &Namespace{} // AzureName returns the Azure name of the resource @@ -110,8 +131,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 *v20211101s.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 *v20211101s.Namespace) error { + + // ObjectMeta + destination.ObjectMeta = *namespace.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.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 v20211101s.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 { @@ -139,6 +227,11 @@ type APIVersion string const APIVersion_Value = APIVersion("2021-01-01-preview") +type augmentConversionForNamespace interface { + AssignPropertiesFrom(src *v20211101s.Namespace) error + AssignPropertiesTo(dst *v20211101s.Namespace) error +} + // Storage version of v1api20210101preview.Namespace_Spec type Namespace_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 @@ -165,20 +258,292 @@ 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.(*v20211101s.Namespace_Spec) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.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.(*v20211101s.Namespace_Spec) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.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 *v20211101s.Namespace_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AlternateName + if source.AlternateName != nil { + propertyBag.Add("AlternateName", *source.AlternateName) + } else { + propertyBag.Remove("AlternateName") + } + + // AzureName + namespace.AzureName = source.AzureName + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + propertyBag.Add("DisableLocalAuth", *source.DisableLocalAuth) + } else { + propertyBag.Remove("DisableLocalAuth") + } + + // 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 + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // 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 + } + + // Sku + if source.Sku != nil { + var sku SBSku + err := sku.AssignProperties_From_SBSku(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBSku() 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 *v20211101s.Namespace_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(namespace.PropertyBag) + + // AlternateName + if propertyBag.Contains("AlternateName") { + var alternateName string + err := propertyBag.Pull("AlternateName", &alternateName) + if err != nil { + return errors.Wrap(err, "pulling 'AlternateName' from propertyBag") + } + + destination.AlternateName = &alternateName + } else { + destination.AlternateName = nil + } + + // AzureName + destination.AzureName = namespace.AzureName + + // DisableLocalAuth + if propertyBag.Contains("DisableLocalAuth") { + var disableLocalAuth bool + err := propertyBag.Pull("DisableLocalAuth", &disableLocalAuth) + if err != nil { + return errors.Wrap(err, "pulling 'DisableLocalAuth' from propertyBag") + } + + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Encryption + if namespace.Encryption != nil { + var encryption v20211101s.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 v20211101s.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 + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // 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 } - return destination.ConvertSpecFrom(namespace) + // OriginalVersion + destination.OriginalVersion = namespace.OriginalVersion + + // Owner + if namespace.Owner != nil { + owner := namespace.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // Sku + if namespace.Sku != nil { + var sku v20211101s.SBSku + err := namespace.Sku.AssignProperties_To_SBSku(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBSku() 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") + } + } + + // No error + return nil } // Storage version of v1api20210101preview.Namespace_STATUS @@ -208,20 +573,370 @@ 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.(*v20211101s.Namespace_STATUS) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.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.(*v20211101s.Namespace_STATUS) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.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 +} + +// AssignProperties_From_Namespace_STATUS populates our Namespace_STATUS from the provided source Namespace_STATUS +func (namespace *Namespace_STATUS) AssignProperties_From_Namespace_STATUS(source *v20211101s.Namespace_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AlternateName + if source.AlternateName != nil { + propertyBag.Add("AlternateName", *source.AlternateName) + } else { + propertyBag.Remove("AlternateName") } - return destination.ConvertStatusFrom(namespace) + // Conditions + namespace.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CreatedAt + namespace.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DisableLocalAuth + if source.DisableLocalAuth != nil { + propertyBag.Add("DisableLocalAuth", *source.DisableLocalAuth) + } else { + propertyBag.Remove("DisableLocalAuth") + } + + // 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 + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // MetricId + namespace.MetricId = genruntime.ClonePointerToString(source.MetricId) + + // 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) + + // ServiceBusEndpoint + namespace.ServiceBusEndpoint = genruntime.ClonePointerToString(source.ServiceBusEndpoint) + + // Sku + if source.Sku != nil { + var sku SBSku_STATUS + err := sku.AssignProperties_From_SBSku_STATUS(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBSku_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 *v20211101s.Namespace_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(namespace.PropertyBag) + + // AlternateName + if propertyBag.Contains("AlternateName") { + var alternateName string + err := propertyBag.Pull("AlternateName", &alternateName) + if err != nil { + return errors.Wrap(err, "pulling 'AlternateName' from propertyBag") + } + + destination.AlternateName = &alternateName + } else { + destination.AlternateName = nil + } + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(namespace.Conditions) + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(namespace.CreatedAt) + + // DisableLocalAuth + if propertyBag.Contains("DisableLocalAuth") { + var disableLocalAuth bool + err := propertyBag.Pull("DisableLocalAuth", &disableLocalAuth) + if err != nil { + return errors.Wrap(err, "pulling 'DisableLocalAuth' from propertyBag") + } + + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Encryption + if namespace.Encryption != nil { + var encryption v20211101s.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 v20211101s.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 + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // MetricId + destination.MetricId = genruntime.ClonePointerToString(namespace.MetricId) + + // Name + destination.Name = genruntime.ClonePointerToString(namespace.Name) + + // PrivateEndpointConnections + if namespace.PrivateEndpointConnections != nil { + privateEndpointConnectionList := make([]v20211101s.PrivateEndpointConnection_STATUS, len(namespace.PrivateEndpointConnections)) + for privateEndpointConnectionIndex, privateEndpointConnectionItem := range namespace.PrivateEndpointConnections { + // Shadow the loop variable to avoid aliasing + privateEndpointConnectionItem := privateEndpointConnectionItem + var privateEndpointConnection v20211101s.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) + + // ServiceBusEndpoint + destination.ServiceBusEndpoint = genruntime.ClonePointerToString(namespace.ServiceBusEndpoint) + + // Sku + if namespace.Sku != nil { + var sku v20211101s.SBSku_STATUS + err := namespace.Sku.AssignProperties_To_SBSku_STATUS(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBSku_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 v20211101s.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 *v20211101s.Namespace_Spec) error + AssignPropertiesTo(dst *v20211101s.Namespace_Spec) error +} + +type augmentConversionForNamespace_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Namespace_STATUS) error + AssignPropertiesTo(dst *v20211101s.Namespace_STATUS) error } // Storage version of v1api20210101preview.Encryption @@ -233,6 +948,114 @@ type Encryption struct { RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` } +// AssignProperties_From_Encryption populates our Encryption from the provided source Encryption +func (encryption *Encryption) AssignProperties_From_Encryption(source *v20211101s.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 *v20211101s.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([]v20211101s.KeyVaultProperties, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty v20211101s.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 v1api20210101preview.Encryption_STATUS // Properties to configure Encryption type Encryption_STATUS struct { @@ -242,6 +1065,114 @@ type Encryption_STATUS struct { 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 *v20211101s.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 *v20211101s.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([]v20211101s.KeyVaultProperties_STATUS, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty v20211101s.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 v1api20210101preview.Identity // Properties to configure User Assigned Identities for Bring your Own Keys type Identity struct { @@ -250,9 +1181,101 @@ type Identity struct { UserAssignedIdentities []UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"` } -// Storage version of v1api20210101preview.Identity_STATUS -// Properties to configure User Assigned Identities for Bring your Own Keys -type Identity_STATUS struct { +// AssignProperties_From_Identity populates our Identity from the provided source Identity +func (identity *Identity) AssignProperties_From_Identity(source *v20211101s.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 *v20211101s.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([]v20211101s.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities)) + for userAssignedIdentityIndex, userAssignedIdentityItem := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityItem := userAssignedIdentityItem + var userAssignedIdentity v20211101s.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 v1api20210101preview.Identity_STATUS +// Properties to configure User Assigned Identities 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"` @@ -260,6 +1283,110 @@ type Identity_STATUS struct { UserAssignedIdentities map[string]DictionaryValue_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 *v20211101s.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]DictionaryValue_STATUS, len(source.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range source.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + var userAssignedIdentity DictionaryValue_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 *v20211101s.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]v20211101s.UserAssignedIdentity_STATUS, len(identity.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + var userAssignedIdentity v20211101s.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 v1api20210101preview.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 { @@ -267,6 +1394,80 @@ type NamespaceOperatorSpec struct { 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 { + // 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 *v20211101s.NamespaceOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // 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 + } + + // 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 v1api20210101preview.PrivateEndpointConnection_STATUS // Properties of the PrivateEndpointConnection. type PrivateEndpointConnection_STATUS struct { @@ -274,6 +1475,62 @@ type PrivateEndpointConnection_STATUS struct { 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 *v20211101s.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 *v20211101s.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 v1api20210101preview.SBSku // SKU of the namespace. type SBSku struct { @@ -283,6 +1540,74 @@ type SBSku struct { Tier *string `json:"tier,omitempty"` } +// AssignProperties_From_SBSku populates our SBSku from the provided source SBSku +func (sbSku *SBSku) AssignProperties_From_SBSku(source *v20211101s.SBSku) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Capacity + sbSku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + sbSku.Name = genruntime.ClonePointerToString(source.Name) + + // Tier + sbSku.Tier = genruntime.ClonePointerToString(source.Tier) + + // Update the property bag + if len(propertyBag) > 0 { + sbSku.PropertyBag = propertyBag + } else { + sbSku.PropertyBag = nil + } + + // Invoke the augmentConversionForSBSku interface (if implemented) to customize the conversion + var sbSkuAsAny any = sbSku + if augmentedSbSku, ok := sbSkuAsAny.(augmentConversionForSBSku); ok { + err := augmentedSbSku.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_SBSku populates the provided destination SBSku from our SBSku +func (sbSku *SBSku) AssignProperties_To_SBSku(destination *v20211101s.SBSku) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(sbSku.PropertyBag) + + // Capacity + destination.Capacity = genruntime.ClonePointerToInt(sbSku.Capacity) + + // Name + destination.Name = genruntime.ClonePointerToString(sbSku.Name) + + // Tier + destination.Tier = genruntime.ClonePointerToString(sbSku.Tier) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForSBSku interface (if implemented) to customize the conversion + var sbSkuAsAny any = sbSku + if augmentedSbSku, ok := sbSkuAsAny.(augmentConversionForSBSku); ok { + err := augmentedSbSku.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210101preview.SBSku_STATUS // SKU of the namespace. type SBSku_STATUS struct { @@ -292,6 +1617,74 @@ type SBSku_STATUS struct { Tier *string `json:"tier,omitempty"` } +// AssignProperties_From_SBSku_STATUS populates our SBSku_STATUS from the provided source SBSku_STATUS +func (sbSku *SBSku_STATUS) AssignProperties_From_SBSku_STATUS(source *v20211101s.SBSku_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Capacity + sbSku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + sbSku.Name = genruntime.ClonePointerToString(source.Name) + + // Tier + sbSku.Tier = genruntime.ClonePointerToString(source.Tier) + + // Update the property bag + if len(propertyBag) > 0 { + sbSku.PropertyBag = propertyBag + } else { + sbSku.PropertyBag = nil + } + + // Invoke the augmentConversionForSBSku_STATUS interface (if implemented) to customize the conversion + var sbSkuAsAny any = sbSku + if augmentedSbSku, ok := sbSkuAsAny.(augmentConversionForSBSku_STATUS); ok { + err := augmentedSbSku.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_SBSku_STATUS populates the provided destination SBSku_STATUS from our SBSku_STATUS +func (sbSku *SBSku_STATUS) AssignProperties_To_SBSku_STATUS(destination *v20211101s.SBSku_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(sbSku.PropertyBag) + + // Capacity + destination.Capacity = genruntime.ClonePointerToInt(sbSku.Capacity) + + // Name + destination.Name = genruntime.ClonePointerToString(sbSku.Name) + + // Tier + destination.Tier = genruntime.ClonePointerToString(sbSku.Tier) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForSBSku_STATUS interface (if implemented) to customize the conversion + var sbSkuAsAny any = sbSku + if augmentedSbSku, ok := sbSkuAsAny.(augmentConversionForSBSku_STATUS); ok { + err := augmentedSbSku.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210101preview.SystemData_STATUS // Metadata pertaining to creation and last modification of the resource. type SystemData_STATUS struct { @@ -304,6 +1697,137 @@ type SystemData_STATUS struct { 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 *v20211101s.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 *v20211101s.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 *v20211101s.Encryption) error + AssignPropertiesTo(dst *v20211101s.Encryption) error +} + +type augmentConversionForEncryption_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Encryption_STATUS) error + AssignPropertiesTo(dst *v20211101s.Encryption_STATUS) error +} + +type augmentConversionForIdentity interface { + AssignPropertiesFrom(src *v20211101s.Identity) error + AssignPropertiesTo(dst *v20211101s.Identity) error +} + +type augmentConversionForIdentity_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Identity_STATUS) error + AssignPropertiesTo(dst *v20211101s.Identity_STATUS) error +} + +type augmentConversionForNamespaceOperatorSpec interface { + AssignPropertiesFrom(src *v20211101s.NamespaceOperatorSpec) error + AssignPropertiesTo(dst *v20211101s.NamespaceOperatorSpec) error +} + +type augmentConversionForPrivateEndpointConnection_STATUS interface { + AssignPropertiesFrom(src *v20211101s.PrivateEndpointConnection_STATUS) error + AssignPropertiesTo(dst *v20211101s.PrivateEndpointConnection_STATUS) error +} + +type augmentConversionForSBSku interface { + AssignPropertiesFrom(src *v20211101s.SBSku) error + AssignPropertiesTo(dst *v20211101s.SBSku) error +} + +type augmentConversionForSBSku_STATUS interface { + AssignPropertiesFrom(src *v20211101s.SBSku_STATUS) error + AssignPropertiesTo(dst *v20211101s.SBSku_STATUS) error +} + +type augmentConversionForSystemData_STATUS interface { + AssignPropertiesFrom(src *v20211101s.SystemData_STATUS) error + AssignPropertiesTo(dst *v20211101s.SystemData_STATUS) error +} + // Storage version of v1api20210101preview.DictionaryValue_STATUS // Recognized Dictionary value. type DictionaryValue_STATUS struct { @@ -312,6 +1836,68 @@ type DictionaryValue_STATUS struct { PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } +// AssignProperties_From_UserAssignedIdentity_STATUS populates our DictionaryValue_STATUS from the provided source UserAssignedIdentity_STATUS +func (value *DictionaryValue_STATUS) AssignProperties_From_UserAssignedIdentity_STATUS(source *v20211101s.UserAssignedIdentity_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ClientId + value.ClientId = genruntime.ClonePointerToString(source.ClientId) + + // PrincipalId + value.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) + + // Update the property bag + if len(propertyBag) > 0 { + value.PropertyBag = propertyBag + } else { + value.PropertyBag = nil + } + + // Invoke the augmentConversionForDictionaryValue_STATUS interface (if implemented) to customize the conversion + var valueAsAny any = value + if augmentedValue, ok := valueAsAny.(augmentConversionForDictionaryValue_STATUS); ok { + err := augmentedValue.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 DictionaryValue_STATUS +func (value *DictionaryValue_STATUS) AssignProperties_To_UserAssignedIdentity_STATUS(destination *v20211101s.UserAssignedIdentity_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(value.PropertyBag) + + // ClientId + destination.ClientId = genruntime.ClonePointerToString(value.ClientId) + + // PrincipalId + destination.PrincipalId = genruntime.ClonePointerToString(value.PrincipalId) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForDictionaryValue_STATUS interface (if implemented) to customize the conversion + var valueAsAny any = value + if augmentedValue, ok := valueAsAny.(augmentConversionForDictionaryValue_STATUS); ok { + err := augmentedValue.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210101preview.KeyVaultProperties // Properties to configure keyVault Properties type KeyVaultProperties struct { @@ -322,6 +1908,98 @@ type KeyVaultProperties struct { PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } +// AssignProperties_From_KeyVaultProperties populates our KeyVaultProperties from the provided source KeyVaultProperties +func (properties *KeyVaultProperties) AssignProperties_From_KeyVaultProperties(source *v20211101s.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 *v20211101s.KeyVaultProperties) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) + + // Identity + if properties.Identity != nil { + var identity v20211101s.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 v1api20210101preview.KeyVaultProperties_STATUS // Properties to configure keyVault Properties type KeyVaultProperties_STATUS struct { @@ -332,6 +2010,98 @@ type KeyVaultProperties_STATUS struct { 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 *v20211101s.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 *v20211101s.KeyVaultProperties_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) + + // Identity + if properties.Identity != nil { + var identity v20211101s.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 v1api20210101preview.NamespaceOperatorSecrets type NamespaceOperatorSecrets struct { Endpoint *genruntime.SecretDestination `json:"endpoint,omitempty"` @@ -342,6 +2112,136 @@ type NamespaceOperatorSecrets struct { 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 { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Endpoint + if source.Endpoint != nil { + endpoint := source.Endpoint.Copy() + secrets.Endpoint = &endpoint + } else { + secrets.Endpoint = nil + } + + // 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 *v20211101s.NamespaceOperatorSecrets) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(secrets.PropertyBag) + + // Endpoint + if secrets.Endpoint != nil { + endpoint := secrets.Endpoint.Copy() + destination.Endpoint = &endpoint + } else { + destination.Endpoint = nil + } + + // 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 v1api20210101preview.UserAssignedIdentityDetails // Information about the user assigned identity for the resource type UserAssignedIdentityDetails struct { @@ -349,6 +2249,87 @@ 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 *v20211101s.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 *v20211101s.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 augmentConversionForDictionaryValue_STATUS interface { + AssignPropertiesFrom(src *v20211101s.UserAssignedIdentity_STATUS) error + AssignPropertiesTo(dst *v20211101s.UserAssignedIdentity_STATUS) error +} + +type augmentConversionForKeyVaultProperties interface { + AssignPropertiesFrom(src *v20211101s.KeyVaultProperties) error + AssignPropertiesTo(dst *v20211101s.KeyVaultProperties) error +} + +type augmentConversionForKeyVaultProperties_STATUS interface { + AssignPropertiesFrom(src *v20211101s.KeyVaultProperties_STATUS) error + AssignPropertiesTo(dst *v20211101s.KeyVaultProperties_STATUS) error +} + +type augmentConversionForNamespaceOperatorSecrets interface { + AssignPropertiesFrom(src *v20211101s.NamespaceOperatorSecrets) error + AssignPropertiesTo(dst *v20211101s.NamespaceOperatorSecrets) error +} + +type augmentConversionForUserAssignedIdentityDetails interface { + AssignPropertiesFrom(src *v20211101s.UserAssignedIdentityDetails) error + AssignPropertiesTo(dst *v20211101s.UserAssignedIdentityDetails) error +} + // Storage version of v1api20210101preview.UserAssignedIdentityProperties type UserAssignedIdentityProperties struct { PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` @@ -357,12 +2338,144 @@ 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 *v20211101s.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 *v20211101s.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 v1api20210101preview.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 *v20211101s.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 *v20211101s.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 *v20211101s.UserAssignedIdentityProperties) error + AssignPropertiesTo(dst *v20211101s.UserAssignedIdentityProperties) error +} + +type augmentConversionForUserAssignedIdentityProperties_STATUS interface { + AssignPropertiesFrom(src *v20211101s.UserAssignedIdentityProperties_STATUS) error + AssignPropertiesTo(dst *v20211101s.UserAssignedIdentityProperties_STATUS) error +} + func init() { SchemeBuilder.Register(&Namespace{}, &NamespaceList{}) } diff --git a/v2/api/servicebus/v1api20210101previewstorage/namespace_types_gen_test.go b/v2/api/servicebus/v1api20210101previewstorage/namespace_types_gen_test.go index b31f06595c1..42640b3a222 100644 --- a/v2/api/servicebus/v1api20210101previewstorage/namespace_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101previewstorage/namespace_types_gen_test.go @@ -5,6 +5,7 @@ package v1api20210101previewstorage import ( "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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() @@ -159,6 +287,48 @@ func AddRelatedPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { gens["Sku"] = gen.PtrOf(SBSkuGenerator()) } +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 v1api20211101storage 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 v20211101s.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() @@ -248,6 +418,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 v1api20211101storage 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 v20211101s.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() @@ -323,6 +535,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 v1api20211101storage 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 v20211101s.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() @@ -398,6 +652,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 v1api20211101storage 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 v20211101s.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() @@ -472,6 +768,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 v1api20211101storage 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 v20211101s.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() @@ -548,6 +886,48 @@ func AddRelatedPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) gens["UserAssignedIdentities"] = gen.MapOf(gen.AlphaString(), DictionaryValue_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 v1api20211101storage 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() @@ -609,29 +989,71 @@ func AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(gens map[string]gopter gens["Secrets"] = gen.PtrOf(NamespaceOperatorSecretsGenerator()) } -func Test_PrivateEndpointConnection_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { +func Test_PrivateEndpointConnection_STATUS_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 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)) } -// 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) +// RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS tests if a specific instance of PrivateEndpointConnection_STATUS can be assigned to v1api20211101storage 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 v20211101s.PrivateEndpointConnection_STATUS + err := copied.AssignProperties_To_PrivateEndpointConnection_STATUS(&other) if err != nil { return err.Error() } - // Deserialize back into memory + // Use AssignPropertiesFrom() to convert back to our original type var actual PrivateEndpointConnection_STATUS - err = json.Unmarshal(bin, &actual) + 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() } @@ -670,6 +1092,48 @@ func AddIndependentPropertyGeneratorsForPrivateEndpointConnection_STATUS(gens ma gens["Id"] = gen.PtrOf(gen.AlphaString()) } +func Test_SBSku_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBSku to SBSku via AssignProperties_To_SBSku & AssignProperties_From_SBSku returns original", + prop.ForAll(RunPropertyAssignmentTestForSBSku, SBSkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBSku tests if a specific instance of SBSku can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSBSku(subject SBSku) 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.SBSku + err := copied.AssignProperties_To_SBSku(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBSku + err = actual.AssignProperties_From_SBSku(&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_SBSku_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -732,6 +1196,48 @@ func AddIndependentPropertyGeneratorsForSBSku(gens map[string]gopter.Gen) { gens["Tier"] = gen.PtrOf(gen.AlphaString()) } +func Test_SBSku_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBSku_STATUS to SBSku_STATUS via AssignProperties_To_SBSku_STATUS & AssignProperties_From_SBSku_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSBSku_STATUS, SBSku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBSku_STATUS tests if a specific instance of SBSku_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSBSku_STATUS(subject SBSku_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 v20211101s.SBSku_STATUS + err := copied.AssignProperties_To_SBSku_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBSku_STATUS + err = actual.AssignProperties_From_SBSku_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_SBSku_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -794,6 +1300,48 @@ func AddIndependentPropertyGeneratorsForSBSku_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 v1api20211101storage 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 v20211101s.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() @@ -859,6 +1407,48 @@ func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter gens["LastModifiedByType"] = gen.PtrOf(gen.AlphaString()) } +func Test_DictionaryValue_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from DictionaryValue_STATUS to UserAssignedIdentity_STATUS via AssignProperties_To_UserAssignedIdentity_STATUS & AssignProperties_From_UserAssignedIdentity_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForDictionaryValue_STATUS, DictionaryValue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForDictionaryValue_STATUS tests if a specific instance of DictionaryValue_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForDictionaryValue_STATUS(subject DictionaryValue_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 v20211101s.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 DictionaryValue_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_DictionaryValue_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -921,6 +1511,48 @@ func AddIndependentPropertyGeneratorsForDictionaryValue_STATUS(gens map[string]g gens["PrincipalId"] = 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 v1api20211101storage 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 v20211101s.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() @@ -997,6 +1629,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 v1api20211101storage 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 v20211101s.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() @@ -1074,6 +1748,48 @@ 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 v1api20211101storage 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() @@ -1129,6 +1845,48 @@ func NamespaceOperatorSecretsGenerator() gopter.Gen { return namespaceOperatorSecretsGenerator } +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 v1api20211101storage 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 v20211101s.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() @@ -1184,6 +1942,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 v1api20211101storage 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 v20211101s.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() @@ -1239,6 +2039,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 v1api20211101storage 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 v20211101s.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/servicebus/v1api20210101previewstorage/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20210101previewstorage/namespaces_authorization_rule_types_gen.go index 37c184e5ae1..4a6c1d70c82 100644 --- a/v2/api/servicebus/v1api20210101previewstorage/namespaces_authorization_rule_types_gen.go +++ b/v2/api/servicebus/v1api20210101previewstorage/namespaces_authorization_rule_types_gen.go @@ -4,19 +4,18 @@ package v1api20210101previewstorage import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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=servicebus.azure.com,resources=namespacesauthorizationrules,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=servicebus.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.(*v20211101s.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/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.(*v20211101s.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) +} + var _ genruntime.KubernetesResource = &NamespacesAuthorizationRule{} // AzureName returns the Azure name of the resource @@ -110,8 +131,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 *v20211101s.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 *v20211101s.NamespacesAuthorizationRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.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 v20211101s.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 { @@ -133,6 +221,11 @@ type NamespacesAuthorizationRuleList struct { Items []NamespacesAuthorizationRule `json:"items"` } +type augmentConversionForNamespacesAuthorizationRule interface { + AssignPropertiesFrom(src *v20211101s.NamespacesAuthorizationRule) error + AssignPropertiesTo(dst *v20211101s.NamespacesAuthorizationRule) error +} + // Storage version of v1api20210101preview.Namespaces_AuthorizationRule_Spec type Namespaces_AuthorizationRule_Spec struct { // +kubebuilder:validation:MaxLength=50 @@ -156,20 +249,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.(*v20211101s.Namespaces_AuthorizationRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_AuthorizationRule_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") } - return source.ConvertSpecTo(rule) + // 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.(*v20211101s.Namespaces_AuthorizationRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_AuthorizationRule_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.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 *v20211101s.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 *v20211101s.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 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 } - return destination.ConvertSpecFrom(rule) + // 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 v1api20210101preview.Namespaces_AuthorizationRule_STATUS @@ -187,20 +418,184 @@ 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.(*v20211101s.Namespaces_AuthorizationRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.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.(*v20211101s.Namespaces_AuthorizationRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.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 destination.ConvertStatusFrom(rule) + 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 *v20211101s.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 + if source.Location != nil { + propertyBag.Add("Location", *source.Location) + } else { + propertyBag.Remove("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 *v20211101s.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 + if propertyBag.Contains("Location") { + var location string + err := propertyBag.Pull("Location", &location) + if err != nil { + return errors.Wrap(err, "pulling 'Location' from propertyBag") + } + + destination.Location = &location + } else { + destination.Location = nil + } + + // Name + destination.Name = genruntime.ClonePointerToString(rule.Name) + + // Rights + destination.Rights = genruntime.CloneSliceOfString(rule.Rights) + + // SystemData + if rule.SystemData != nil { + var systemDatum v20211101s.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 *v20211101s.Namespaces_AuthorizationRule_Spec) error + AssignPropertiesTo(dst *v20211101s.Namespaces_AuthorizationRule_Spec) error +} + +type augmentConversionForNamespaces_AuthorizationRule_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_AuthorizationRule_STATUS) error + AssignPropertiesTo(dst *v20211101s.Namespaces_AuthorizationRule_STATUS) error } // Storage version of v1api20210101preview.NamespacesAuthorizationRuleOperatorSpec @@ -210,6 +605,85 @@ 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 *v20211101s.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 *v20211101s.NamespacesAuthorizationRuleOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // 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 + } + + // 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 *v20211101s.NamespacesAuthorizationRuleOperatorSpec) error + AssignPropertiesTo(dst *v20211101s.NamespacesAuthorizationRuleOperatorSpec) error +} + // Storage version of v1api20210101preview.NamespacesAuthorizationRuleOperatorSecrets type NamespacesAuthorizationRuleOperatorSecrets struct { PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` @@ -219,6 +693,125 @@ 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 *v20211101s.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 *v20211101s.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 *v20211101s.NamespacesAuthorizationRuleOperatorSecrets) error + AssignPropertiesTo(dst *v20211101s.NamespacesAuthorizationRuleOperatorSecrets) error +} + func init() { SchemeBuilder.Register(&NamespacesAuthorizationRule{}, &NamespacesAuthorizationRuleList{}) } diff --git a/v2/api/servicebus/v1api20210101previewstorage/namespaces_authorization_rule_types_gen_test.go b/v2/api/servicebus/v1api20210101previewstorage/namespaces_authorization_rule_types_gen_test.go index 1bddb7936c5..2a639f6917f 100644 --- a/v2/api/servicebus/v1api20210101previewstorage/namespaces_authorization_rule_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101previewstorage/namespaces_authorization_rule_types_gen_test.go @@ -5,6 +5,7 @@ package v1api20210101previewstorage import ( "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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() @@ -156,6 +284,48 @@ 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 v1api20211101storage 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 v20211101s.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() @@ -234,6 +404,48 @@ 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 v1api20211101storage 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() @@ -295,6 +507,48 @@ 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 v1api20211101storage 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() diff --git a/v2/api/servicebus/v1api20210101previewstorage/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20210101previewstorage/namespaces_queue_types_gen.go index 06d40a27be4..2899765ab3e 100644 --- a/v2/api/servicebus/v1api20210101previewstorage/namespaces_queue_types_gen.go +++ b/v2/api/servicebus/v1api20210101previewstorage/namespaces_queue_types_gen.go @@ -4,19 +4,18 @@ package v1api20210101previewstorage import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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=servicebus.azure.com,resources=namespacesqueues,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=servicebus.azure.com,resources={namespacesqueues/status,namespacesqueues/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 (queue *NamespacesQueue) SetConditions(conditions conditions.Conditions) { queue.Status.Conditions = conditions } +var _ conversion.Convertible = &NamespacesQueue{} + +// ConvertFrom populates our NamespacesQueue from the provided hub NamespacesQueue +func (queue *NamespacesQueue) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20211101s.NamespacesQueue) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesQueue but received %T instead", hub) + } + + return queue.AssignProperties_From_NamespacesQueue(source) +} + +// ConvertTo populates the provided hub NamespacesQueue from our NamespacesQueue +func (queue *NamespacesQueue) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20211101s.NamespacesQueue) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesQueue but received %T instead", hub) + } + + return queue.AssignProperties_To_NamespacesQueue(destination) +} + var _ genruntime.KubernetesResource = &NamespacesQueue{} // AzureName returns the Azure name of the resource @@ -110,8 +131,75 @@ func (queue *NamespacesQueue) SetStatus(status genruntime.ConvertibleStatus) err return nil } -// Hub marks that this NamespacesQueue is the hub type for conversion -func (queue *NamespacesQueue) Hub() {} +// AssignProperties_From_NamespacesQueue populates our NamespacesQueue from the provided source NamespacesQueue +func (queue *NamespacesQueue) AssignProperties_From_NamespacesQueue(source *v20211101s.NamespacesQueue) error { + + // ObjectMeta + queue.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Queue_Spec + err := spec.AssignProperties_From_Namespaces_Queue_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Queue_Spec() to populate field Spec") + } + queue.Spec = spec + + // Status + var status Namespaces_Queue_STATUS + err = status.AssignProperties_From_Namespaces_Queue_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Queue_STATUS() to populate field Status") + } + queue.Status = status + + // Invoke the augmentConversionForNamespacesQueue interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespacesQueue); ok { + err := augmentedQueue.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesQueue populates the provided destination NamespacesQueue from our NamespacesQueue +func (queue *NamespacesQueue) AssignProperties_To_NamespacesQueue(destination *v20211101s.NamespacesQueue) error { + + // ObjectMeta + destination.ObjectMeta = *queue.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.Namespaces_Queue_Spec + err := queue.Spec.AssignProperties_To_Namespaces_Queue_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Queue_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20211101s.Namespaces_Queue_STATUS + err = queue.Status.AssignProperties_To_Namespaces_Queue_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Queue_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForNamespacesQueue interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespacesQueue); ok { + err := augmentedQueue.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 (queue *NamespacesQueue) OriginalGVK() *schema.GroupVersionKind { @@ -133,6 +221,11 @@ type NamespacesQueueList struct { Items []NamespacesQueue `json:"items"` } +type augmentConversionForNamespacesQueue interface { + AssignPropertiesFrom(src *v20211101s.NamespacesQueue) error + AssignPropertiesTo(dst *v20211101s.NamespacesQueue) error +} + // Storage version of v1api20210101preview.Namespaces_Queue_Spec type Namespaces_Queue_Spec struct { AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` @@ -168,20 +261,292 @@ var _ genruntime.ConvertibleSpec = &Namespaces_Queue_Spec{} // ConvertSpecFrom populates our Namespaces_Queue_Spec from the provided source func (queue *Namespaces_Queue_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == queue { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*v20211101s.Namespaces_Queue_Spec) + if ok { + // Populate our instance from source + return queue.AssignProperties_From_Namespaces_Queue_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Queue_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = queue.AssignProperties_From_Namespaces_Queue_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") } - return source.ConvertSpecTo(queue) + return nil } // ConvertSpecTo populates the provided destination from our Namespaces_Queue_Spec func (queue *Namespaces_Queue_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == queue { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*v20211101s.Namespaces_Queue_Spec) + if ok { + // Populate destination from our instance + return queue.AssignProperties_To_Namespaces_Queue_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Queue_Spec{} + err := queue.AssignProperties_To_Namespaces_Queue_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_Queue_Spec populates our Namespaces_Queue_Spec from the provided source Namespaces_Queue_Spec +func (queue *Namespaces_Queue_Spec) AssignProperties_From_Namespaces_Queue_Spec(source *v20211101s.Namespaces_Queue_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AutoDeleteOnIdle + queue.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // AzureName + queue.AzureName = source.AzureName + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + queue.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + queue.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + queue.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + queue.EnableBatchedOperations = &enableBatchedOperation + } else { + queue.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + queue.EnableExpress = &enableExpress + } else { + queue.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + queue.EnablePartitioning = &enablePartitioning + } else { + queue.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + queue.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + queue.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // LockDuration + queue.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + queue.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + if source.MaxMessageSizeInKilobytes != nil { + propertyBag.Add("MaxMessageSizeInKilobytes", *source.MaxMessageSizeInKilobytes) + } else { + propertyBag.Remove("MaxMessageSizeInKilobytes") + } + + // MaxSizeInMegabytes + queue.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // OriginalVersion + queue.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + queue.Owner = &owner + } else { + queue.Owner = nil + } + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + queue.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + queue.RequiresDuplicateDetection = nil + } + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + queue.RequiresSession = &requiresSession + } else { + queue.RequiresSession = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + queue.PropertyBag = propertyBag + } else { + queue.PropertyBag = nil } - return destination.ConvertSpecFrom(queue) + // Invoke the augmentConversionForNamespaces_Queue_Spec interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespaces_Queue_Spec); ok { + err := augmentedQueue.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Queue_Spec populates the provided destination Namespaces_Queue_Spec from our Namespaces_Queue_Spec +func (queue *Namespaces_Queue_Spec) AssignProperties_To_Namespaces_Queue_Spec(destination *v20211101s.Namespaces_Queue_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(queue.PropertyBag) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(queue.AutoDeleteOnIdle) + + // AzureName + destination.AzureName = queue.AzureName + + // DeadLetteringOnMessageExpiration + if queue.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *queue.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(queue.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(queue.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if queue.EnableBatchedOperations != nil { + enableBatchedOperation := *queue.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if queue.EnableExpress != nil { + enableExpress := *queue.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if queue.EnablePartitioning != nil { + enablePartitioning := *queue.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(queue.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(queue.ForwardTo) + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(queue.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(queue.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + if propertyBag.Contains("MaxMessageSizeInKilobytes") { + var maxMessageSizeInKilobyte int + err := propertyBag.Pull("MaxMessageSizeInKilobytes", &maxMessageSizeInKilobyte) + if err != nil { + return errors.Wrap(err, "pulling 'MaxMessageSizeInKilobytes' from propertyBag") + } + + destination.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobyte + } else { + destination.MaxMessageSizeInKilobytes = nil + } + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(queue.MaxSizeInMegabytes) + + // OriginalVersion + destination.OriginalVersion = queue.OriginalVersion + + // Owner + if queue.Owner != nil { + owner := queue.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // RequiresDuplicateDetection + if queue.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *queue.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // RequiresSession + if queue.RequiresSession != nil { + requiresSession := *queue.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Queue_Spec interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespaces_Queue_Spec); ok { + err := augmentedQueue.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20210101preview.Namespaces_Queue_STATUS @@ -219,20 +584,402 @@ var _ genruntime.ConvertibleStatus = &Namespaces_Queue_STATUS{} // ConvertStatusFrom populates our Namespaces_Queue_STATUS from the provided source func (queue *Namespaces_Queue_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == queue { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*v20211101s.Namespaces_Queue_STATUS) + if ok { + // Populate our instance from source + return queue.AssignProperties_From_Namespaces_Queue_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Queue_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = queue.AssignProperties_From_Namespaces_Queue_STATUS(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") } - return source.ConvertStatusTo(queue) + return nil } // ConvertStatusTo populates the provided destination from our Namespaces_Queue_STATUS func (queue *Namespaces_Queue_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == queue { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*v20211101s.Namespaces_Queue_STATUS) + if ok { + // Populate destination from our instance + return queue.AssignProperties_To_Namespaces_Queue_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Queue_STATUS{} + err := queue.AssignProperties_To_Namespaces_Queue_STATUS(dst) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusTo()") } - return destination.ConvertStatusFrom(queue) + // 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_Queue_STATUS populates our Namespaces_Queue_STATUS from the provided source Namespaces_Queue_STATUS +func (queue *Namespaces_Queue_STATUS) AssignProperties_From_Namespaces_Queue_STATUS(source *v20211101s.Namespaces_Queue_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AccessedAt + queue.AccessedAt = genruntime.ClonePointerToString(source.AccessedAt) + + // AutoDeleteOnIdle + queue.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // Conditions + queue.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CountDetails + if source.CountDetails != nil { + var countDetail MessageCountDetails_STATUS + err := countDetail.AssignProperties_From_MessageCountDetails_STATUS(source.CountDetails) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_MessageCountDetails_STATUS() to populate field CountDetails") + } + queue.CountDetails = &countDetail + } else { + queue.CountDetails = nil + } + + // CreatedAt + queue.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + queue.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + queue.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + queue.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + queue.EnableBatchedOperations = &enableBatchedOperation + } else { + queue.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + queue.EnableExpress = &enableExpress + } else { + queue.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + queue.EnablePartitioning = &enablePartitioning + } else { + queue.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + queue.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + queue.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // Id + queue.Id = genruntime.ClonePointerToString(source.Id) + + // Location + if source.Location != nil { + propertyBag.Add("Location", *source.Location) + } else { + propertyBag.Remove("Location") + } + + // LockDuration + queue.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + queue.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + if source.MaxMessageSizeInKilobytes != nil { + propertyBag.Add("MaxMessageSizeInKilobytes", *source.MaxMessageSizeInKilobytes) + } else { + propertyBag.Remove("MaxMessageSizeInKilobytes") + } + + // MaxSizeInMegabytes + queue.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // MessageCount + queue.MessageCount = genruntime.ClonePointerToInt(source.MessageCount) + + // Name + queue.Name = genruntime.ClonePointerToString(source.Name) + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + queue.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + queue.RequiresDuplicateDetection = nil + } + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + queue.RequiresSession = &requiresSession + } else { + queue.RequiresSession = nil + } + + // SizeInBytes + queue.SizeInBytes = genruntime.ClonePointerToInt(source.SizeInBytes) + + // Status + queue.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") + } + queue.SystemData = &systemDatum + } else { + queue.SystemData = nil + } + + // Type + queue.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + queue.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + queue.PropertyBag = propertyBag + } else { + queue.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Queue_STATUS interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespaces_Queue_STATUS); ok { + err := augmentedQueue.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Queue_STATUS populates the provided destination Namespaces_Queue_STATUS from our Namespaces_Queue_STATUS +func (queue *Namespaces_Queue_STATUS) AssignProperties_To_Namespaces_Queue_STATUS(destination *v20211101s.Namespaces_Queue_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(queue.PropertyBag) + + // AccessedAt + destination.AccessedAt = genruntime.ClonePointerToString(queue.AccessedAt) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(queue.AutoDeleteOnIdle) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(queue.Conditions) + + // CountDetails + if queue.CountDetails != nil { + var countDetail v20211101s.MessageCountDetails_STATUS + err := queue.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_MessageCountDetails_STATUS() to populate field CountDetails") + } + destination.CountDetails = &countDetail + } else { + destination.CountDetails = nil + } + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(queue.CreatedAt) + + // DeadLetteringOnMessageExpiration + if queue.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *queue.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(queue.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(queue.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if queue.EnableBatchedOperations != nil { + enableBatchedOperation := *queue.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if queue.EnableExpress != nil { + enableExpress := *queue.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if queue.EnablePartitioning != nil { + enablePartitioning := *queue.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(queue.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(queue.ForwardTo) + + // Id + destination.Id = genruntime.ClonePointerToString(queue.Id) + + // Location + if propertyBag.Contains("Location") { + var location string + err := propertyBag.Pull("Location", &location) + if err != nil { + return errors.Wrap(err, "pulling 'Location' from propertyBag") + } + + destination.Location = &location + } else { + destination.Location = nil + } + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(queue.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(queue.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + if propertyBag.Contains("MaxMessageSizeInKilobytes") { + var maxMessageSizeInKilobyte int + err := propertyBag.Pull("MaxMessageSizeInKilobytes", &maxMessageSizeInKilobyte) + if err != nil { + return errors.Wrap(err, "pulling 'MaxMessageSizeInKilobytes' from propertyBag") + } + + destination.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobyte + } else { + destination.MaxMessageSizeInKilobytes = nil + } + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(queue.MaxSizeInMegabytes) + + // MessageCount + destination.MessageCount = genruntime.ClonePointerToInt(queue.MessageCount) + + // Name + destination.Name = genruntime.ClonePointerToString(queue.Name) + + // RequiresDuplicateDetection + if queue.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *queue.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // RequiresSession + if queue.RequiresSession != nil { + requiresSession := *queue.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // SizeInBytes + destination.SizeInBytes = genruntime.ClonePointerToInt(queue.SizeInBytes) + + // Status + destination.Status = genruntime.ClonePointerToString(queue.Status) + + // SystemData + if queue.SystemData != nil { + var systemDatum v20211101s.SystemData_STATUS + err := queue.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(queue.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(queue.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Queue_STATUS interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespaces_Queue_STATUS); ok { + err := augmentedQueue.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespaces_Queue_Spec interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Queue_Spec) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Queue_Spec) error +} + +type augmentConversionForNamespaces_Queue_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Queue_STATUS) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Queue_STATUS) error } // Storage version of v1api20210101preview.MessageCountDetails_STATUS @@ -246,6 +993,91 @@ type MessageCountDetails_STATUS struct { TransferMessageCount *int `json:"transferMessageCount,omitempty"` } +// AssignProperties_From_MessageCountDetails_STATUS populates our MessageCountDetails_STATUS from the provided source MessageCountDetails_STATUS +func (details *MessageCountDetails_STATUS) AssignProperties_From_MessageCountDetails_STATUS(source *v20211101s.MessageCountDetails_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ActiveMessageCount + details.ActiveMessageCount = genruntime.ClonePointerToInt(source.ActiveMessageCount) + + // DeadLetterMessageCount + details.DeadLetterMessageCount = genruntime.ClonePointerToInt(source.DeadLetterMessageCount) + + // ScheduledMessageCount + details.ScheduledMessageCount = genruntime.ClonePointerToInt(source.ScheduledMessageCount) + + // TransferDeadLetterMessageCount + details.TransferDeadLetterMessageCount = genruntime.ClonePointerToInt(source.TransferDeadLetterMessageCount) + + // TransferMessageCount + details.TransferMessageCount = genruntime.ClonePointerToInt(source.TransferMessageCount) + + // Update the property bag + if len(propertyBag) > 0 { + details.PropertyBag = propertyBag + } else { + details.PropertyBag = nil + } + + // Invoke the augmentConversionForMessageCountDetails_STATUS interface (if implemented) to customize the conversion + var detailsAsAny any = details + if augmentedDetails, ok := detailsAsAny.(augmentConversionForMessageCountDetails_STATUS); ok { + err := augmentedDetails.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_MessageCountDetails_STATUS populates the provided destination MessageCountDetails_STATUS from our MessageCountDetails_STATUS +func (details *MessageCountDetails_STATUS) AssignProperties_To_MessageCountDetails_STATUS(destination *v20211101s.MessageCountDetails_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(details.PropertyBag) + + // ActiveMessageCount + destination.ActiveMessageCount = genruntime.ClonePointerToInt(details.ActiveMessageCount) + + // DeadLetterMessageCount + destination.DeadLetterMessageCount = genruntime.ClonePointerToInt(details.DeadLetterMessageCount) + + // ScheduledMessageCount + destination.ScheduledMessageCount = genruntime.ClonePointerToInt(details.ScheduledMessageCount) + + // TransferDeadLetterMessageCount + destination.TransferDeadLetterMessageCount = genruntime.ClonePointerToInt(details.TransferDeadLetterMessageCount) + + // TransferMessageCount + destination.TransferMessageCount = genruntime.ClonePointerToInt(details.TransferMessageCount) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForMessageCountDetails_STATUS interface (if implemented) to customize the conversion + var detailsAsAny any = details + if augmentedDetails, ok := detailsAsAny.(augmentConversionForMessageCountDetails_STATUS); ok { + err := augmentedDetails.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForMessageCountDetails_STATUS interface { + AssignPropertiesFrom(src *v20211101s.MessageCountDetails_STATUS) error + AssignPropertiesTo(dst *v20211101s.MessageCountDetails_STATUS) error +} + func init() { SchemeBuilder.Register(&NamespacesQueue{}, &NamespacesQueueList{}) } diff --git a/v2/api/servicebus/v1api20210101previewstorage/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1api20210101previewstorage/namespaces_queue_types_gen_test.go index 92868ab9985..ba04448776b 100644 --- a/v2/api/servicebus/v1api20210101previewstorage/namespaces_queue_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101previewstorage/namespaces_queue_types_gen_test.go @@ -5,6 +5,7 @@ package v1api20210101previewstorage import ( "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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_NamespacesQueue_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 NamespacesQueue to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesQueue, NamespacesQueueGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesQueue tests if a specific instance of NamespacesQueue round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesQueue(subject NamespacesQueue) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesQueue + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesQueue + 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_NamespacesQueue_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesQueue to NamespacesQueue via AssignProperties_To_NamespacesQueue & AssignProperties_From_NamespacesQueue returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesQueue, NamespacesQueueGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesQueue tests if a specific instance of NamespacesQueue can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespacesQueue(subject NamespacesQueue) 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.NamespacesQueue + err := copied.AssignProperties_To_NamespacesQueue(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesQueue + err = actual.AssignProperties_From_NamespacesQueue(&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_NamespacesQueue_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -78,6 +164,48 @@ func AddRelatedPropertyGeneratorsForNamespacesQueue(gens map[string]gopter.Gen) gens["Status"] = Namespaces_Queue_STATUSGenerator() } +func Test_Namespaces_Queue_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Queue_Spec to Namespaces_Queue_Spec via AssignProperties_To_Namespaces_Queue_Spec & AssignProperties_From_Namespaces_Queue_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Queue_Spec, Namespaces_Queue_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Queue_Spec tests if a specific instance of Namespaces_Queue_Spec can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Queue_Spec(subject Namespaces_Queue_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 v20211101s.Namespaces_Queue_Spec + err := copied.AssignProperties_To_Namespaces_Queue_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Queue_Spec + err = actual.AssignProperties_From_Namespaces_Queue_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_Queue_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -154,6 +282,48 @@ func AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec(gens map[string]go gens["RequiresSession"] = gen.PtrOf(gen.Bool()) } +func Test_Namespaces_Queue_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Queue_STATUS to Namespaces_Queue_STATUS via AssignProperties_To_Namespaces_Queue_STATUS & AssignProperties_From_Namespaces_Queue_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Queue_STATUS, Namespaces_Queue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Queue_STATUS tests if a specific instance of Namespaces_Queue_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Queue_STATUS(subject Namespaces_Queue_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 v20211101s.Namespaces_Queue_STATUS + err := copied.AssignProperties_To_Namespaces_Queue_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Queue_STATUS + err = actual.AssignProperties_From_Namespaces_Queue_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_Queue_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -252,6 +422,48 @@ func AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS(gens map[string]gopt gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } +func Test_MessageCountDetails_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from MessageCountDetails_STATUS to MessageCountDetails_STATUS via AssignProperties_To_MessageCountDetails_STATUS & AssignProperties_From_MessageCountDetails_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForMessageCountDetails_STATUS, MessageCountDetails_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForMessageCountDetails_STATUS tests if a specific instance of MessageCountDetails_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForMessageCountDetails_STATUS(subject MessageCountDetails_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 v20211101s.MessageCountDetails_STATUS + err := copied.AssignProperties_To_MessageCountDetails_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual MessageCountDetails_STATUS + err = actual.AssignProperties_From_MessageCountDetails_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_MessageCountDetails_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/servicebus/v1api20210101previewstorage/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20210101previewstorage/namespaces_topic_types_gen.go index a0882808d16..c30864f06bb 100644 --- a/v2/api/servicebus/v1api20210101previewstorage/namespaces_topic_types_gen.go +++ b/v2/api/servicebus/v1api20210101previewstorage/namespaces_topic_types_gen.go @@ -4,19 +4,18 @@ package v1api20210101previewstorage import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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=servicebus.azure.com,resources=namespacestopics,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=servicebus.azure.com,resources={namespacestopics/status,namespacestopics/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 (topic *NamespacesTopic) SetConditions(conditions conditions.Conditions) { topic.Status.Conditions = conditions } +var _ conversion.Convertible = &NamespacesTopic{} + +// ConvertFrom populates our NamespacesTopic from the provided hub NamespacesTopic +func (topic *NamespacesTopic) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20211101s.NamespacesTopic) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopic but received %T instead", hub) + } + + return topic.AssignProperties_From_NamespacesTopic(source) +} + +// ConvertTo populates the provided hub NamespacesTopic from our NamespacesTopic +func (topic *NamespacesTopic) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20211101s.NamespacesTopic) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopic but received %T instead", hub) + } + + return topic.AssignProperties_To_NamespacesTopic(destination) +} + var _ genruntime.KubernetesResource = &NamespacesTopic{} // AzureName returns the Azure name of the resource @@ -110,8 +131,75 @@ func (topic *NamespacesTopic) SetStatus(status genruntime.ConvertibleStatus) err return nil } -// Hub marks that this NamespacesTopic is the hub type for conversion -func (topic *NamespacesTopic) Hub() {} +// AssignProperties_From_NamespacesTopic populates our NamespacesTopic from the provided source NamespacesTopic +func (topic *NamespacesTopic) AssignProperties_From_NamespacesTopic(source *v20211101s.NamespacesTopic) error { + + // ObjectMeta + topic.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Topic_Spec + err := spec.AssignProperties_From_Namespaces_Topic_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topic_Spec() to populate field Spec") + } + topic.Spec = spec + + // Status + var status Namespaces_Topic_STATUS + err = status.AssignProperties_From_Namespaces_Topic_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topic_STATUS() to populate field Status") + } + topic.Status = status + + // Invoke the augmentConversionForNamespacesTopic interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespacesTopic); ok { + err := augmentedTopic.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopic populates the provided destination NamespacesTopic from our NamespacesTopic +func (topic *NamespacesTopic) AssignProperties_To_NamespacesTopic(destination *v20211101s.NamespacesTopic) error { + + // ObjectMeta + destination.ObjectMeta = *topic.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.Namespaces_Topic_Spec + err := topic.Spec.AssignProperties_To_Namespaces_Topic_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topic_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20211101s.Namespaces_Topic_STATUS + err = topic.Status.AssignProperties_To_Namespaces_Topic_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topic_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForNamespacesTopic interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespacesTopic); ok { + err := augmentedTopic.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 (topic *NamespacesTopic) OriginalGVK() *schema.GroupVersionKind { @@ -133,6 +221,11 @@ type NamespacesTopicList struct { Items []NamespacesTopic `json:"items"` } +type augmentConversionForNamespacesTopic interface { + AssignPropertiesFrom(src *v20211101s.NamespacesTopic) error + AssignPropertiesTo(dst *v20211101s.NamespacesTopic) error +} + // Storage version of v1api20210101preview.Namespaces_Topic_Spec type Namespaces_Topic_Spec struct { AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` @@ -163,20 +256,252 @@ var _ genruntime.ConvertibleSpec = &Namespaces_Topic_Spec{} // ConvertSpecFrom populates our Namespaces_Topic_Spec from the provided source func (topic *Namespaces_Topic_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == topic { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*v20211101s.Namespaces_Topic_Spec) + if ok { + // Populate our instance from source + return topic.AssignProperties_From_Namespaces_Topic_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topic_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = topic.AssignProperties_From_Namespaces_Topic_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") } - return source.ConvertSpecTo(topic) + return nil } // ConvertSpecTo populates the provided destination from our Namespaces_Topic_Spec func (topic *Namespaces_Topic_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == topic { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*v20211101s.Namespaces_Topic_Spec) + if ok { + // Populate destination from our instance + return topic.AssignProperties_To_Namespaces_Topic_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topic_Spec{} + err := topic.AssignProperties_To_Namespaces_Topic_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_Topic_Spec populates our Namespaces_Topic_Spec from the provided source Namespaces_Topic_Spec +func (topic *Namespaces_Topic_Spec) AssignProperties_From_Namespaces_Topic_Spec(source *v20211101s.Namespaces_Topic_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AutoDeleteOnIdle + topic.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // AzureName + topic.AzureName = source.AzureName + + // DefaultMessageTimeToLive + topic.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + topic.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + topic.EnableBatchedOperations = &enableBatchedOperation + } else { + topic.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + topic.EnableExpress = &enableExpress + } else { + topic.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + topic.EnablePartitioning = &enablePartitioning + } else { + topic.EnablePartitioning = nil + } + + // MaxMessageSizeInKilobytes + if source.MaxMessageSizeInKilobytes != nil { + propertyBag.Add("MaxMessageSizeInKilobytes", *source.MaxMessageSizeInKilobytes) + } else { + propertyBag.Remove("MaxMessageSizeInKilobytes") + } + + // MaxSizeInMegabytes + topic.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // OriginalVersion + topic.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + topic.Owner = &owner + } else { + topic.Owner = nil + } + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + topic.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + topic.RequiresDuplicateDetection = nil + } + + // SupportOrdering + if source.SupportOrdering != nil { + supportOrdering := *source.SupportOrdering + topic.SupportOrdering = &supportOrdering + } else { + topic.SupportOrdering = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + topic.PropertyBag = propertyBag + } else { + topic.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topic_Spec interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespaces_Topic_Spec); ok { + err := augmentedTopic.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topic_Spec populates the provided destination Namespaces_Topic_Spec from our Namespaces_Topic_Spec +func (topic *Namespaces_Topic_Spec) AssignProperties_To_Namespaces_Topic_Spec(destination *v20211101s.Namespaces_Topic_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(topic.PropertyBag) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(topic.AutoDeleteOnIdle) + + // AzureName + destination.AzureName = topic.AzureName + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(topic.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(topic.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if topic.EnableBatchedOperations != nil { + enableBatchedOperation := *topic.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if topic.EnableExpress != nil { + enableExpress := *topic.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if topic.EnablePartitioning != nil { + enablePartitioning := *topic.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // MaxMessageSizeInKilobytes + if propertyBag.Contains("MaxMessageSizeInKilobytes") { + var maxMessageSizeInKilobyte int + err := propertyBag.Pull("MaxMessageSizeInKilobytes", &maxMessageSizeInKilobyte) + if err != nil { + return errors.Wrap(err, "pulling 'MaxMessageSizeInKilobytes' from propertyBag") + } + + destination.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobyte + } else { + destination.MaxMessageSizeInKilobytes = nil + } + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(topic.MaxSizeInMegabytes) + + // OriginalVersion + destination.OriginalVersion = topic.OriginalVersion + + // Owner + if topic.Owner != nil { + owner := topic.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // RequiresDuplicateDetection + if topic.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *topic.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil } - return destination.ConvertSpecFrom(topic) + // SupportOrdering + if topic.SupportOrdering != nil { + supportOrdering := *topic.SupportOrdering + destination.SupportOrdering = &supportOrdering + } else { + destination.SupportOrdering = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topic_Spec interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespaces_Topic_Spec); ok { + err := augmentedTopic.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20210101preview.Namespaces_Topic_STATUS @@ -209,20 +534,362 @@ var _ genruntime.ConvertibleStatus = &Namespaces_Topic_STATUS{} // ConvertStatusFrom populates our Namespaces_Topic_STATUS from the provided source func (topic *Namespaces_Topic_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == topic { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*v20211101s.Namespaces_Topic_STATUS) + if ok { + // Populate our instance from source + return topic.AssignProperties_From_Namespaces_Topic_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topic_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = topic.AssignProperties_From_Namespaces_Topic_STATUS(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()") } - return source.ConvertStatusTo(topic) + return nil } // ConvertStatusTo populates the provided destination from our Namespaces_Topic_STATUS func (topic *Namespaces_Topic_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == topic { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*v20211101s.Namespaces_Topic_STATUS) + if ok { + // Populate destination from our instance + return topic.AssignProperties_To_Namespaces_Topic_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topic_STATUS{} + err := topic.AssignProperties_To_Namespaces_Topic_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_Topic_STATUS populates our Namespaces_Topic_STATUS from the provided source Namespaces_Topic_STATUS +func (topic *Namespaces_Topic_STATUS) AssignProperties_From_Namespaces_Topic_STATUS(source *v20211101s.Namespaces_Topic_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AccessedAt + topic.AccessedAt = genruntime.ClonePointerToString(source.AccessedAt) + + // AutoDeleteOnIdle + topic.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // Conditions + topic.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CountDetails + if source.CountDetails != nil { + var countDetail MessageCountDetails_STATUS + err := countDetail.AssignProperties_From_MessageCountDetails_STATUS(source.CountDetails) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_MessageCountDetails_STATUS() to populate field CountDetails") + } + topic.CountDetails = &countDetail + } else { + topic.CountDetails = nil + } + + // CreatedAt + topic.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DefaultMessageTimeToLive + topic.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + topic.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + topic.EnableBatchedOperations = &enableBatchedOperation + } else { + topic.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + topic.EnableExpress = &enableExpress + } else { + topic.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + topic.EnablePartitioning = &enablePartitioning + } else { + topic.EnablePartitioning = nil + } + + // Id + topic.Id = genruntime.ClonePointerToString(source.Id) + + // Location + if source.Location != nil { + propertyBag.Add("Location", *source.Location) + } else { + propertyBag.Remove("Location") + } + + // MaxMessageSizeInKilobytes + if source.MaxMessageSizeInKilobytes != nil { + propertyBag.Add("MaxMessageSizeInKilobytes", *source.MaxMessageSizeInKilobytes) + } else { + propertyBag.Remove("MaxMessageSizeInKilobytes") + } + + // MaxSizeInMegabytes + topic.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // Name + topic.Name = genruntime.ClonePointerToString(source.Name) + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + topic.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + topic.RequiresDuplicateDetection = nil + } + + // SizeInBytes + topic.SizeInBytes = genruntime.ClonePointerToInt(source.SizeInBytes) + + // Status + topic.Status = genruntime.ClonePointerToString(source.Status) + + // SubscriptionCount + topic.SubscriptionCount = genruntime.ClonePointerToInt(source.SubscriptionCount) + + // SupportOrdering + if source.SupportOrdering != nil { + supportOrdering := *source.SupportOrdering + topic.SupportOrdering = &supportOrdering + } else { + topic.SupportOrdering = 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") + } + topic.SystemData = &systemDatum + } else { + topic.SystemData = nil + } + + // Type + topic.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + topic.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + topic.PropertyBag = propertyBag + } else { + topic.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topic_STATUS interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespaces_Topic_STATUS); ok { + err := augmentedTopic.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topic_STATUS populates the provided destination Namespaces_Topic_STATUS from our Namespaces_Topic_STATUS +func (topic *Namespaces_Topic_STATUS) AssignProperties_To_Namespaces_Topic_STATUS(destination *v20211101s.Namespaces_Topic_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(topic.PropertyBag) + + // AccessedAt + destination.AccessedAt = genruntime.ClonePointerToString(topic.AccessedAt) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(topic.AutoDeleteOnIdle) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(topic.Conditions) + + // CountDetails + if topic.CountDetails != nil { + var countDetail v20211101s.MessageCountDetails_STATUS + err := topic.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_MessageCountDetails_STATUS() to populate field CountDetails") + } + destination.CountDetails = &countDetail + } else { + destination.CountDetails = nil + } + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(topic.CreatedAt) + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(topic.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(topic.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if topic.EnableBatchedOperations != nil { + enableBatchedOperation := *topic.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if topic.EnableExpress != nil { + enableExpress := *topic.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if topic.EnablePartitioning != nil { + enablePartitioning := *topic.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // Id + destination.Id = genruntime.ClonePointerToString(topic.Id) + + // Location + if propertyBag.Contains("Location") { + var location string + err := propertyBag.Pull("Location", &location) + if err != nil { + return errors.Wrap(err, "pulling 'Location' from propertyBag") + } + + destination.Location = &location + } else { + destination.Location = nil } - return destination.ConvertStatusFrom(topic) + // MaxMessageSizeInKilobytes + if propertyBag.Contains("MaxMessageSizeInKilobytes") { + var maxMessageSizeInKilobyte int + err := propertyBag.Pull("MaxMessageSizeInKilobytes", &maxMessageSizeInKilobyte) + if err != nil { + return errors.Wrap(err, "pulling 'MaxMessageSizeInKilobytes' from propertyBag") + } + + destination.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobyte + } else { + destination.MaxMessageSizeInKilobytes = nil + } + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(topic.MaxSizeInMegabytes) + + // Name + destination.Name = genruntime.ClonePointerToString(topic.Name) + + // RequiresDuplicateDetection + if topic.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *topic.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // SizeInBytes + destination.SizeInBytes = genruntime.ClonePointerToInt(topic.SizeInBytes) + + // Status + destination.Status = genruntime.ClonePointerToString(topic.Status) + + // SubscriptionCount + destination.SubscriptionCount = genruntime.ClonePointerToInt(topic.SubscriptionCount) + + // SupportOrdering + if topic.SupportOrdering != nil { + supportOrdering := *topic.SupportOrdering + destination.SupportOrdering = &supportOrdering + } else { + destination.SupportOrdering = nil + } + + // SystemData + if topic.SystemData != nil { + var systemDatum v20211101s.SystemData_STATUS + err := topic.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(topic.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(topic.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topic_STATUS interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespaces_Topic_STATUS); ok { + err := augmentedTopic.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespaces_Topic_Spec interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Topic_Spec) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Topic_Spec) error +} + +type augmentConversionForNamespaces_Topic_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Topic_STATUS) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Topic_STATUS) error } func init() { diff --git a/v2/api/servicebus/v1api20210101previewstorage/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1api20210101previewstorage/namespaces_topic_types_gen_test.go index d360b09141c..0458b230465 100644 --- a/v2/api/servicebus/v1api20210101previewstorage/namespaces_topic_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101previewstorage/namespaces_topic_types_gen_test.go @@ -5,6 +5,7 @@ package v1api20210101previewstorage import ( "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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_NamespacesTopic_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 NamespacesTopic to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesTopic, NamespacesTopicGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesTopic tests if a specific instance of NamespacesTopic round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesTopic(subject NamespacesTopic) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesTopic + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesTopic + 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_NamespacesTopic_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopic to NamespacesTopic via AssignProperties_To_NamespacesTopic & AssignProperties_From_NamespacesTopic returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopic, NamespacesTopicGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopic tests if a specific instance of NamespacesTopic can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopic(subject NamespacesTopic) 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.NamespacesTopic + err := copied.AssignProperties_To_NamespacesTopic(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopic + err = actual.AssignProperties_From_NamespacesTopic(&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_NamespacesTopic_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -78,6 +164,48 @@ func AddRelatedPropertyGeneratorsForNamespacesTopic(gens map[string]gopter.Gen) gens["Status"] = Namespaces_Topic_STATUSGenerator() } +func Test_Namespaces_Topic_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topic_Spec to Namespaces_Topic_Spec via AssignProperties_To_Namespaces_Topic_Spec & AssignProperties_From_Namespaces_Topic_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topic_Spec, Namespaces_Topic_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topic_Spec tests if a specific instance of Namespaces_Topic_Spec can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topic_Spec(subject Namespaces_Topic_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 v20211101s.Namespaces_Topic_Spec + err := copied.AssignProperties_To_Namespaces_Topic_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topic_Spec + err = actual.AssignProperties_From_Namespaces_Topic_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_Topic_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -149,6 +277,48 @@ func AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec(gens map[string]go gens["SupportOrdering"] = gen.PtrOf(gen.Bool()) } +func Test_Namespaces_Topic_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topic_STATUS to Namespaces_Topic_STATUS via AssignProperties_To_Namespaces_Topic_STATUS & AssignProperties_From_Namespaces_Topic_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topic_STATUS, Namespaces_Topic_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topic_STATUS tests if a specific instance of Namespaces_Topic_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topic_STATUS(subject Namespaces_Topic_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 v20211101s.Namespaces_Topic_STATUS + err := copied.AssignProperties_To_Namespaces_Topic_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topic_STATUS + err = actual.AssignProperties_From_Namespaces_Topic_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_Topic_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscription_types_gen.go index 6348ea008a8..20910134ea6 100644 --- a/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscription_types_gen.go +++ b/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscription_types_gen.go @@ -4,19 +4,18 @@ package v1api20210101previewstorage import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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=servicebus.azure.com,resources=namespacestopicssubscriptions,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=servicebus.azure.com,resources={namespacestopicssubscriptions/status,namespacestopicssubscriptions/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 (subscription *NamespacesTopicsSubscription) SetConditions(conditions condi subscription.Status.Conditions = conditions } +var _ conversion.Convertible = &NamespacesTopicsSubscription{} + +// ConvertFrom populates our NamespacesTopicsSubscription from the provided hub NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20211101s.NamespacesTopicsSubscription) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopicsSubscription but received %T instead", hub) + } + + return subscription.AssignProperties_From_NamespacesTopicsSubscription(source) +} + +// ConvertTo populates the provided hub NamespacesTopicsSubscription from our NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20211101s.NamespacesTopicsSubscription) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopicsSubscription but received %T instead", hub) + } + + return subscription.AssignProperties_To_NamespacesTopicsSubscription(destination) +} + var _ genruntime.KubernetesResource = &NamespacesTopicsSubscription{} // AzureName returns the Azure name of the resource @@ -110,8 +131,75 @@ func (subscription *NamespacesTopicsSubscription) SetStatus(status genruntime.Co return nil } -// Hub marks that this NamespacesTopicsSubscription is the hub type for conversion -func (subscription *NamespacesTopicsSubscription) Hub() {} +// AssignProperties_From_NamespacesTopicsSubscription populates our NamespacesTopicsSubscription from the provided source NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) AssignProperties_From_NamespacesTopicsSubscription(source *v20211101s.NamespacesTopicsSubscription) error { + + // ObjectMeta + subscription.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Topics_Subscription_Spec + err := spec.AssignProperties_From_Namespaces_Topics_Subscription_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscription_Spec() to populate field Spec") + } + subscription.Spec = spec + + // Status + var status Namespaces_Topics_Subscription_STATUS + err = status.AssignProperties_From_Namespaces_Topics_Subscription_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscription_STATUS() to populate field Status") + } + subscription.Status = status + + // Invoke the augmentConversionForNamespacesTopicsSubscription interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespacesTopicsSubscription); ok { + err := augmentedSubscription.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscription populates the provided destination NamespacesTopicsSubscription from our NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) AssignProperties_To_NamespacesTopicsSubscription(destination *v20211101s.NamespacesTopicsSubscription) error { + + // ObjectMeta + destination.ObjectMeta = *subscription.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.Namespaces_Topics_Subscription_Spec + err := subscription.Spec.AssignProperties_To_Namespaces_Topics_Subscription_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscription_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20211101s.Namespaces_Topics_Subscription_STATUS + err = subscription.Status.AssignProperties_To_Namespaces_Topics_Subscription_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscription_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForNamespacesTopicsSubscription interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespacesTopicsSubscription); ok { + err := augmentedSubscription.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 (subscription *NamespacesTopicsSubscription) OriginalGVK() *schema.GroupVersionKind { @@ -133,6 +221,11 @@ type NamespacesTopicsSubscriptionList struct { Items []NamespacesTopicsSubscription `json:"items"` } +type augmentConversionForNamespacesTopicsSubscription interface { + AssignPropertiesFrom(src *v20211101s.NamespacesTopicsSubscription) error + AssignPropertiesTo(dst *v20211101s.NamespacesTopicsSubscription) error +} + // Storage version of v1api20210101preview.Namespaces_Topics_Subscription_Spec type Namespaces_Topics_Subscription_Spec struct { AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` @@ -166,20 +259,274 @@ var _ genruntime.ConvertibleSpec = &Namespaces_Topics_Subscription_Spec{} // ConvertSpecFrom populates our Namespaces_Topics_Subscription_Spec from the provided source func (subscription *Namespaces_Topics_Subscription_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == subscription { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*v20211101s.Namespaces_Topics_Subscription_Spec) + if ok { + // Populate our instance from source + return subscription.AssignProperties_From_Namespaces_Topics_Subscription_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topics_Subscription_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = subscription.AssignProperties_From_Namespaces_Topics_Subscription_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") } - return source.ConvertSpecTo(subscription) + return nil } // ConvertSpecTo populates the provided destination from our Namespaces_Topics_Subscription_Spec func (subscription *Namespaces_Topics_Subscription_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == subscription { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*v20211101s.Namespaces_Topics_Subscription_Spec) + if ok { + // Populate destination from our instance + return subscription.AssignProperties_To_Namespaces_Topics_Subscription_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topics_Subscription_Spec{} + err := subscription.AssignProperties_To_Namespaces_Topics_Subscription_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 destination.ConvertSpecFrom(subscription) + return nil +} + +// AssignProperties_From_Namespaces_Topics_Subscription_Spec populates our Namespaces_Topics_Subscription_Spec from the provided source Namespaces_Topics_Subscription_Spec +func (subscription *Namespaces_Topics_Subscription_Spec) AssignProperties_From_Namespaces_Topics_Subscription_Spec(source *v20211101s.Namespaces_Topics_Subscription_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AutoDeleteOnIdle + subscription.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // AzureName + subscription.AzureName = source.AzureName + + // ClientAffineProperties + if source.ClientAffineProperties != nil { + propertyBag.Add("ClientAffineProperties", *source.ClientAffineProperties) + } else { + propertyBag.Remove("ClientAffineProperties") + } + + // DeadLetteringOnFilterEvaluationExceptions + if source.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *source.DeadLetteringOnFilterEvaluationExceptions + subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + subscription.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + subscription.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + subscription.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + subscription.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + subscription.EnableBatchedOperations = &enableBatchedOperation + } else { + subscription.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + subscription.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + subscription.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // IsClientAffine + if source.IsClientAffine != nil { + propertyBag.Add("IsClientAffine", *source.IsClientAffine) + } else { + propertyBag.Remove("IsClientAffine") + } + + // LockDuration + subscription.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + subscription.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // OriginalVersion + subscription.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + subscription.Owner = &owner + } else { + subscription.Owner = nil + } + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + subscription.RequiresSession = &requiresSession + } else { + subscription.RequiresSession = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + subscription.PropertyBag = propertyBag + } else { + subscription.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topics_Subscription_Spec interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespaces_Topics_Subscription_Spec); ok { + err := augmentedSubscription.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topics_Subscription_Spec populates the provided destination Namespaces_Topics_Subscription_Spec from our Namespaces_Topics_Subscription_Spec +func (subscription *Namespaces_Topics_Subscription_Spec) AssignProperties_To_Namespaces_Topics_Subscription_Spec(destination *v20211101s.Namespaces_Topics_Subscription_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(subscription.PropertyBag) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(subscription.AutoDeleteOnIdle) + + // AzureName + destination.AzureName = subscription.AzureName + + // ClientAffineProperties + if propertyBag.Contains("ClientAffineProperties") { + var clientAffineProperty v20211101s.SBClientAffineProperties + err := propertyBag.Pull("ClientAffineProperties", &clientAffineProperty) + if err != nil { + return errors.Wrap(err, "pulling 'ClientAffineProperties' from propertyBag") + } + + destination.ClientAffineProperties = &clientAffineProperty + } else { + destination.ClientAffineProperties = nil + } + + // DeadLetteringOnFilterEvaluationExceptions + if subscription.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *subscription.DeadLetteringOnFilterEvaluationExceptions + destination.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + destination.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if subscription.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *subscription.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(subscription.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(subscription.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if subscription.EnableBatchedOperations != nil { + enableBatchedOperation := *subscription.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(subscription.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(subscription.ForwardTo) + + // IsClientAffine + if propertyBag.Contains("IsClientAffine") { + var isClientAffine bool + err := propertyBag.Pull("IsClientAffine", &isClientAffine) + if err != nil { + return errors.Wrap(err, "pulling 'IsClientAffine' from propertyBag") + } + + destination.IsClientAffine = &isClientAffine + } else { + destination.IsClientAffine = nil + } + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(subscription.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(subscription.MaxDeliveryCount) + + // OriginalVersion + destination.OriginalVersion = subscription.OriginalVersion + + // Owner + if subscription.Owner != nil { + owner := subscription.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // RequiresSession + if subscription.RequiresSession != nil { + requiresSession := *subscription.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topics_Subscription_Spec interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespaces_Topics_Subscription_Spec); ok { + err := augmentedSubscription.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20210101preview.Namespaces_Topics_Subscription_STATUS @@ -213,20 +560,378 @@ var _ genruntime.ConvertibleStatus = &Namespaces_Topics_Subscription_STATUS{} // ConvertStatusFrom populates our Namespaces_Topics_Subscription_STATUS from the provided source func (subscription *Namespaces_Topics_Subscription_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == subscription { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*v20211101s.Namespaces_Topics_Subscription_STATUS) + if ok { + // Populate our instance from source + return subscription.AssignProperties_From_Namespaces_Topics_Subscription_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topics_Subscription_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") } - return source.ConvertStatusTo(subscription) + // Update our instance from src + err = subscription.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS func (subscription *Namespaces_Topics_Subscription_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == subscription { - return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*v20211101s.Namespaces_Topics_Subscription_STATUS) + if ok { + // Populate destination from our instance + return subscription.AssignProperties_To_Namespaces_Topics_Subscription_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topics_Subscription_STATUS{} + err := subscription.AssignProperties_To_Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS populates our Namespaces_Topics_Subscription_STATUS from the provided source Namespaces_Topics_Subscription_STATUS +func (subscription *Namespaces_Topics_Subscription_STATUS) AssignProperties_From_Namespaces_Topics_Subscription_STATUS(source *v20211101s.Namespaces_Topics_Subscription_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AccessedAt + subscription.AccessedAt = genruntime.ClonePointerToString(source.AccessedAt) + + // AutoDeleteOnIdle + subscription.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // ClientAffineProperties + if source.ClientAffineProperties != nil { + propertyBag.Add("ClientAffineProperties", *source.ClientAffineProperties) + } else { + propertyBag.Remove("ClientAffineProperties") + } + + // Conditions + subscription.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CountDetails + if source.CountDetails != nil { + var countDetail MessageCountDetails_STATUS + err := countDetail.AssignProperties_From_MessageCountDetails_STATUS(source.CountDetails) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_MessageCountDetails_STATUS() to populate field CountDetails") + } + subscription.CountDetails = &countDetail + } else { + subscription.CountDetails = nil + } + + // CreatedAt + subscription.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DeadLetteringOnFilterEvaluationExceptions + if source.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *source.DeadLetteringOnFilterEvaluationExceptions + subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + subscription.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + subscription.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + subscription.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + subscription.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + subscription.EnableBatchedOperations = &enableBatchedOperation + } else { + subscription.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + subscription.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + subscription.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // Id + subscription.Id = genruntime.ClonePointerToString(source.Id) + + // IsClientAffine + if source.IsClientAffine != nil { + propertyBag.Add("IsClientAffine", *source.IsClientAffine) + } else { + propertyBag.Remove("IsClientAffine") + } + + // Location + if source.Location != nil { + propertyBag.Add("Location", *source.Location) + } else { + propertyBag.Remove("Location") + } + + // LockDuration + subscription.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + subscription.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // MessageCount + subscription.MessageCount = genruntime.ClonePointerToInt(source.MessageCount) + + // Name + subscription.Name = genruntime.ClonePointerToString(source.Name) + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + subscription.RequiresSession = &requiresSession + } else { + subscription.RequiresSession = nil + } + + // Status + subscription.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") + } + subscription.SystemData = &systemDatum + } else { + subscription.SystemData = nil } - return destination.ConvertStatusFrom(subscription) + // Type + subscription.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + subscription.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + subscription.PropertyBag = propertyBag + } else { + subscription.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topics_Subscription_STATUS interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespaces_Topics_Subscription_STATUS); ok { + err := augmentedSubscription.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topics_Subscription_STATUS populates the provided destination Namespaces_Topics_Subscription_STATUS from our Namespaces_Topics_Subscription_STATUS +func (subscription *Namespaces_Topics_Subscription_STATUS) AssignProperties_To_Namespaces_Topics_Subscription_STATUS(destination *v20211101s.Namespaces_Topics_Subscription_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(subscription.PropertyBag) + + // AccessedAt + destination.AccessedAt = genruntime.ClonePointerToString(subscription.AccessedAt) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(subscription.AutoDeleteOnIdle) + + // ClientAffineProperties + if propertyBag.Contains("ClientAffineProperties") { + var clientAffineProperty v20211101s.SBClientAffineProperties_STATUS + err := propertyBag.Pull("ClientAffineProperties", &clientAffineProperty) + if err != nil { + return errors.Wrap(err, "pulling 'ClientAffineProperties' from propertyBag") + } + + destination.ClientAffineProperties = &clientAffineProperty + } else { + destination.ClientAffineProperties = nil + } + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(subscription.Conditions) + + // CountDetails + if subscription.CountDetails != nil { + var countDetail v20211101s.MessageCountDetails_STATUS + err := subscription.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_MessageCountDetails_STATUS() to populate field CountDetails") + } + destination.CountDetails = &countDetail + } else { + destination.CountDetails = nil + } + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(subscription.CreatedAt) + + // DeadLetteringOnFilterEvaluationExceptions + if subscription.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *subscription.DeadLetteringOnFilterEvaluationExceptions + destination.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + destination.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if subscription.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *subscription.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(subscription.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(subscription.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if subscription.EnableBatchedOperations != nil { + enableBatchedOperation := *subscription.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(subscription.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(subscription.ForwardTo) + + // Id + destination.Id = genruntime.ClonePointerToString(subscription.Id) + + // IsClientAffine + if propertyBag.Contains("IsClientAffine") { + var isClientAffine bool + err := propertyBag.Pull("IsClientAffine", &isClientAffine) + if err != nil { + return errors.Wrap(err, "pulling 'IsClientAffine' from propertyBag") + } + + destination.IsClientAffine = &isClientAffine + } else { + destination.IsClientAffine = nil + } + + // Location + if propertyBag.Contains("Location") { + var location string + err := propertyBag.Pull("Location", &location) + if err != nil { + return errors.Wrap(err, "pulling 'Location' from propertyBag") + } + + destination.Location = &location + } else { + destination.Location = nil + } + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(subscription.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(subscription.MaxDeliveryCount) + + // MessageCount + destination.MessageCount = genruntime.ClonePointerToInt(subscription.MessageCount) + + // Name + destination.Name = genruntime.ClonePointerToString(subscription.Name) + + // RequiresSession + if subscription.RequiresSession != nil { + requiresSession := *subscription.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // Status + destination.Status = genruntime.ClonePointerToString(subscription.Status) + + // SystemData + if subscription.SystemData != nil { + var systemDatum v20211101s.SystemData_STATUS + err := subscription.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(subscription.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(subscription.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topics_Subscription_STATUS interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespaces_Topics_Subscription_STATUS); ok { + err := augmentedSubscription.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespaces_Topics_Subscription_Spec interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Topics_Subscription_Spec) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Topics_Subscription_Spec) error +} + +type augmentConversionForNamespaces_Topics_Subscription_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Topics_Subscription_STATUS) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Topics_Subscription_STATUS) error } func init() { diff --git a/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscription_types_gen_test.go b/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscription_types_gen_test.go index 8b082fb61d4..e612ca9583a 100644 --- a/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscription_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscription_types_gen_test.go @@ -5,6 +5,7 @@ package v1api20210101previewstorage import ( "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesTopicsSubscription, NamespacesTopicsSubscriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesTopicsSubscription tests if a specific instance of NamespacesTopicsSubscription round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesTopicsSubscription(subject NamespacesTopicsSubscription) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesTopicsSubscription + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesTopicsSubscription + 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_NamespacesTopicsSubscription_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscription to NamespacesTopicsSubscription via AssignProperties_To_NamespacesTopicsSubscription & AssignProperties_From_NamespacesTopicsSubscription returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscription, NamespacesTopicsSubscriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscription tests if a specific instance of NamespacesTopicsSubscription can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscription(subject NamespacesTopicsSubscription) 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.NamespacesTopicsSubscription + err := copied.AssignProperties_To_NamespacesTopicsSubscription(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscription + err = actual.AssignProperties_From_NamespacesTopicsSubscription(&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_NamespacesTopicsSubscription_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -79,6 +165,48 @@ func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription(gens map[string gens["Status"] = Namespaces_Topics_Subscription_STATUSGenerator() } +func Test_Namespaces_Topics_Subscription_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscription_Spec to Namespaces_Topics_Subscription_Spec via AssignProperties_To_Namespaces_Topics_Subscription_Spec & AssignProperties_From_Namespaces_Topics_Subscription_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscription_Spec, Namespaces_Topics_Subscription_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscription_Spec tests if a specific instance of Namespaces_Topics_Subscription_Spec can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscription_Spec(subject Namespaces_Topics_Subscription_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 v20211101s.Namespaces_Topics_Subscription_Spec + err := copied.AssignProperties_To_Namespaces_Topics_Subscription_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscription_Spec + err = actual.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -152,6 +280,48 @@ func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(gens gens["RequiresSession"] = gen.PtrOf(gen.Bool()) } +func Test_Namespaces_Topics_Subscription_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscription_STATUS to Namespaces_Topics_Subscription_STATUS via AssignProperties_To_Namespaces_Topics_Subscription_STATUS & AssignProperties_From_Namespaces_Topics_Subscription_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscription_STATUS, Namespaces_Topics_Subscription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscription_STATUS tests if a specific instance of Namespaces_Topics_Subscription_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscription_STATUS(subject Namespaces_Topics_Subscription_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 v20211101s.Namespaces_Topics_Subscription_STATUS + err := copied.AssignProperties_To_Namespaces_Topics_Subscription_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscription_STATUS + err = actual.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen.go index 27ee9f472ee..ff95fb1ecb8 100644 --- a/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen.go +++ b/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen.go @@ -4,19 +4,18 @@ package v1api20210101previewstorage import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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=servicebus.azure.com,resources=namespacestopicssubscriptionsrules,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=servicebus.azure.com,resources={namespacestopicssubscriptionsrules/status,namespacestopicssubscriptionsrules/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 *NamespacesTopicsSubscriptionsRule) SetConditions(conditions conditio rule.Status.Conditions = conditions } +var _ conversion.Convertible = &NamespacesTopicsSubscriptionsRule{} + +// ConvertFrom populates our NamespacesTopicsSubscriptionsRule from the provided hub NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20211101s.NamespacesTopicsSubscriptionsRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + } + + return rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule(source) +} + +// ConvertTo populates the provided hub NamespacesTopicsSubscriptionsRule from our NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20211101s.NamespacesTopicsSubscriptionsRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(destination) +} + var _ genruntime.KubernetesResource = &NamespacesTopicsSubscriptionsRule{} // AzureName returns the Azure name of the resource @@ -110,8 +131,75 @@ func (rule *NamespacesTopicsSubscriptionsRule) SetStatus(status genruntime.Conve return nil } -// Hub marks that this NamespacesTopicsSubscriptionsRule is the hub type for conversion -func (rule *NamespacesTopicsSubscriptionsRule) Hub() {} +// AssignProperties_From_NamespacesTopicsSubscriptionsRule populates our NamespacesTopicsSubscriptionsRule from the provided source NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) AssignProperties_From_NamespacesTopicsSubscriptionsRule(source *v20211101s.NamespacesTopicsSubscriptionsRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Topics_Subscriptions_Rule_Spec + err := spec.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status Namespaces_Topics_Subscriptions_Rule_STATUS + err = status.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS() to populate field Status") + } + rule.Status = status + + // Invoke the augmentConversionForNamespacesTopicsSubscriptionsRule interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesTopicsSubscriptionsRule); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscriptionsRule populates the provided destination NamespacesTopicsSubscriptionsRule from our NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) AssignProperties_To_NamespacesTopicsSubscriptionsRule(destination *v20211101s.NamespacesTopicsSubscriptionsRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec + err := rule.Spec.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS + err = rule.Status.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForNamespacesTopicsSubscriptionsRule interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesTopicsSubscriptionsRule); 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 *NamespacesTopicsSubscriptionsRule) OriginalGVK() *schema.GroupVersionKind { @@ -133,6 +221,11 @@ type NamespacesTopicsSubscriptionsRuleList struct { Items []NamespacesTopicsSubscriptionsRule `json:"items"` } +type augmentConversionForNamespacesTopicsSubscriptionsRule interface { + AssignPropertiesFrom(src *v20211101s.NamespacesTopicsSubscriptionsRule) error + AssignPropertiesTo(dst *v20211101s.NamespacesTopicsSubscriptionsRule) error +} + // Storage version of v1api20210101preview.Namespaces_Topics_Subscriptions_Rule_Spec type Namespaces_Topics_Subscriptions_Rule_Spec struct { Action *Action `json:"action,omitempty"` @@ -159,20 +252,206 @@ var _ genruntime.ConvertibleSpec = &Namespaces_Topics_Subscriptions_Rule_Spec{} // ConvertSpecFrom populates our Namespaces_Topics_Subscriptions_Rule_Spec from the provided source func (rule *Namespaces_Topics_Subscriptions_Rule_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.(*v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec(src) + if err != nil { + return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()") } - return source.ConvertSpecTo(rule) + return nil } // ConvertSpecTo populates the provided destination from our Namespaces_Topics_Subscriptions_Rule_Spec func (rule *Namespaces_Topics_Subscriptions_Rule_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.(*v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec{} + err := rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec populates our Namespaces_Topics_Subscriptions_Rule_Spec from the provided source Namespaces_Topics_Subscriptions_Rule_Spec +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec(source *v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Action + if source.Action != nil { + var action Action + err := action.AssignProperties_From_Action(source.Action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Action() to populate field Action") + } + rule.Action = &action + } else { + rule.Action = nil + } + + // AzureName + rule.AzureName = source.AzureName + + // CorrelationFilter + if source.CorrelationFilter != nil { + var correlationFilter CorrelationFilter + err := correlationFilter.AssignProperties_From_CorrelationFilter(source.CorrelationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CorrelationFilter() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil + } + + // FilterType + rule.FilterType = genruntime.ClonePointerToString(source.FilterType) + + // OriginalVersion + rule.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + rule.Owner = &owner + } else { + rule.Owner = nil + } + + // SqlFilter + if source.SqlFilter != nil { + var sqlFilter SqlFilter + err := sqlFilter.AssignProperties_From_SqlFilter(source.SqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SqlFilter() to populate field SqlFilter") + } + rule.SqlFilter = &sqlFilter + } else { + rule.SqlFilter = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + rule.PropertyBag = propertyBag + } else { + rule.PropertyBag = nil } - return destination.ConvertSpecFrom(rule) + // Invoke the augmentConversionForNamespaces_Topics_Subscriptions_Rule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec populates the provided destination Namespaces_Topics_Subscriptions_Rule_Spec from our Namespaces_Topics_Subscriptions_Rule_Spec +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(destination *v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) + + // Action + if rule.Action != nil { + var action v20211101s.Action + err := rule.Action.AssignProperties_To_Action(&action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Action() to populate field Action") + } + destination.Action = &action + } else { + destination.Action = nil + } + + // AzureName + destination.AzureName = rule.AzureName + + // CorrelationFilter + if rule.CorrelationFilter != nil { + var correlationFilter v20211101s.CorrelationFilter + err := rule.CorrelationFilter.AssignProperties_To_CorrelationFilter(&correlationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CorrelationFilter() to populate field CorrelationFilter") + } + destination.CorrelationFilter = &correlationFilter + } else { + destination.CorrelationFilter = nil + } + + // FilterType + destination.FilterType = genruntime.ClonePointerToString(rule.FilterType) + + // OriginalVersion + destination.OriginalVersion = rule.OriginalVersion + + // Owner + if rule.Owner != nil { + owner := rule.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // SqlFilter + if rule.SqlFilter != nil { + var sqlFilter v20211101s.SqlFilter + err := rule.SqlFilter.AssignProperties_To_SqlFilter(&sqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SqlFilter() to populate field SqlFilter") + } + destination.SqlFilter = &sqlFilter + } else { + destination.SqlFilter = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topics_Subscriptions_Rule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Topics_Subscriptions_Rule_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 v1api20210101preview.Namespaces_Topics_Subscriptions_Rule_STATUS @@ -193,20 +472,246 @@ var _ genruntime.ConvertibleStatus = &Namespaces_Topics_Subscriptions_Rule_STATU // ConvertStatusFrom populates our Namespaces_Topics_Subscriptions_Rule_STATUS from the provided source func (rule *Namespaces_Topics_Subscriptions_Rule_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.(*v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS(src) } - return source.ConvertStatusTo(rule) + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS func (rule *Namespaces_Topics_Subscriptions_Rule_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.(*v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS{} + err := rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS populates our Namespaces_Topics_Subscriptions_Rule_STATUS from the provided source Namespaces_Topics_Subscriptions_Rule_STATUS +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS(source *v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Action + if source.Action != nil { + var action Action_STATUS + err := action.AssignProperties_From_Action_STATUS(source.Action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Action_STATUS() to populate field Action") + } + rule.Action = &action + } else { + rule.Action = nil + } + + // Conditions + rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CorrelationFilter + if source.CorrelationFilter != nil { + var correlationFilter CorrelationFilter_STATUS + err := correlationFilter.AssignProperties_From_CorrelationFilter_STATUS(source.CorrelationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CorrelationFilter_STATUS() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil + } + + // FilterType + rule.FilterType = genruntime.ClonePointerToString(source.FilterType) + + // Id + rule.Id = genruntime.ClonePointerToString(source.Id) + + // Location + if source.Location != nil { + propertyBag.Add("Location", *source.Location) + } else { + propertyBag.Remove("Location") + } + + // Name + rule.Name = genruntime.ClonePointerToString(source.Name) + + // SqlFilter + if source.SqlFilter != nil { + var sqlFilter SqlFilter_STATUS + err := sqlFilter.AssignProperties_From_SqlFilter_STATUS(source.SqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SqlFilter_STATUS() to populate field SqlFilter") + } + rule.SqlFilter = &sqlFilter + } else { + rule.SqlFilter = 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) + + // Update the property bag + if len(propertyBag) > 0 { + rule.PropertyBag = propertyBag + } else { + rule.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topics_Subscriptions_Rule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS populates the provided destination Namespaces_Topics_Subscriptions_Rule_STATUS from our Namespaces_Topics_Subscriptions_Rule_STATUS +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(destination *v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) + + // Action + if rule.Action != nil { + var action v20211101s.Action_STATUS + err := rule.Action.AssignProperties_To_Action_STATUS(&action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Action_STATUS() to populate field Action") + } + destination.Action = &action + } else { + destination.Action = nil + } + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) + + // CorrelationFilter + if rule.CorrelationFilter != nil { + var correlationFilter v20211101s.CorrelationFilter_STATUS + err := rule.CorrelationFilter.AssignProperties_To_CorrelationFilter_STATUS(&correlationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CorrelationFilter_STATUS() to populate field CorrelationFilter") + } + destination.CorrelationFilter = &correlationFilter + } else { + destination.CorrelationFilter = nil + } + + // FilterType + destination.FilterType = genruntime.ClonePointerToString(rule.FilterType) + + // Id + destination.Id = genruntime.ClonePointerToString(rule.Id) + + // Location + if propertyBag.Contains("Location") { + var location string + err := propertyBag.Pull("Location", &location) + if err != nil { + return errors.Wrap(err, "pulling 'Location' from propertyBag") + } + + destination.Location = &location + } else { + destination.Location = nil + } + + // Name + destination.Name = genruntime.ClonePointerToString(rule.Name) + + // SqlFilter + if rule.SqlFilter != nil { + var sqlFilter v20211101s.SqlFilter_STATUS + err := rule.SqlFilter.AssignProperties_To_SqlFilter_STATUS(&sqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SqlFilter_STATUS() to populate field SqlFilter") + } + destination.SqlFilter = &sqlFilter + } else { + destination.SqlFilter = nil + } + + // SystemData + if rule.SystemData != nil { + var systemDatum v20211101s.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_Topics_Subscriptions_Rule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Topics_Subscriptions_Rule_STATUS); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } } - return destination.ConvertStatusFrom(rule) + // No error + return nil } // Storage version of v1api20210101preview.Action @@ -219,6 +724,84 @@ type Action struct { SqlExpression *string `json:"sqlExpression,omitempty"` } +// AssignProperties_From_Action populates our Action from the provided source Action +func (action *Action) AssignProperties_From_Action(source *v20211101s.Action) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CompatibilityLevel + action.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + action.RequiresPreprocessing = &requiresPreprocessing + } else { + action.RequiresPreprocessing = nil + } + + // SqlExpression + action.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + action.PropertyBag = propertyBag + } else { + action.PropertyBag = nil + } + + // Invoke the augmentConversionForAction interface (if implemented) to customize the conversion + var actionAsAny any = action + if augmentedAction, ok := actionAsAny.(augmentConversionForAction); ok { + err := augmentedAction.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Action populates the provided destination Action from our Action +func (action *Action) AssignProperties_To_Action(destination *v20211101s.Action) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(action.PropertyBag) + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(action.CompatibilityLevel) + + // RequiresPreprocessing + if action.RequiresPreprocessing != nil { + requiresPreprocessing := *action.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(action.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForAction interface (if implemented) to customize the conversion + var actionAsAny any = action + if augmentedAction, ok := actionAsAny.(augmentConversionForAction); ok { + err := augmentedAction.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210101preview.Action_STATUS // Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter // expression. @@ -229,6 +812,94 @@ type Action_STATUS struct { SqlExpression *string `json:"sqlExpression,omitempty"` } +// AssignProperties_From_Action_STATUS populates our Action_STATUS from the provided source Action_STATUS +func (action *Action_STATUS) AssignProperties_From_Action_STATUS(source *v20211101s.Action_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CompatibilityLevel + action.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + action.RequiresPreprocessing = &requiresPreprocessing + } else { + action.RequiresPreprocessing = nil + } + + // SqlExpression + action.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + action.PropertyBag = propertyBag + } else { + action.PropertyBag = nil + } + + // Invoke the augmentConversionForAction_STATUS interface (if implemented) to customize the conversion + var actionAsAny any = action + if augmentedAction, ok := actionAsAny.(augmentConversionForAction_STATUS); ok { + err := augmentedAction.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Action_STATUS populates the provided destination Action_STATUS from our Action_STATUS +func (action *Action_STATUS) AssignProperties_To_Action_STATUS(destination *v20211101s.Action_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(action.PropertyBag) + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(action.CompatibilityLevel) + + // RequiresPreprocessing + if action.RequiresPreprocessing != nil { + requiresPreprocessing := *action.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(action.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForAction_STATUS interface (if implemented) to customize the conversion + var actionAsAny any = action + if augmentedAction, ok := actionAsAny.(augmentConversionForAction_STATUS); ok { + err := augmentedAction.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespaces_Topics_Subscriptions_Rule_Spec interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) error +} + +type augmentConversionForNamespaces_Topics_Subscriptions_Rule_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) error +} + // Storage version of v1api20210101preview.CorrelationFilter // Represents the correlation filter expression. type CorrelationFilter struct { @@ -245,6 +916,126 @@ type CorrelationFilter struct { To *string `json:"to,omitempty"` } +// AssignProperties_From_CorrelationFilter populates our CorrelationFilter from the provided source CorrelationFilter +func (filter *CorrelationFilter) AssignProperties_From_CorrelationFilter(source *v20211101s.CorrelationFilter) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ContentType + filter.ContentType = genruntime.ClonePointerToString(source.ContentType) + + // CorrelationId + filter.CorrelationId = genruntime.ClonePointerToString(source.CorrelationId) + + // Label + filter.Label = genruntime.ClonePointerToString(source.Label) + + // MessageId + filter.MessageId = genruntime.ClonePointerToString(source.MessageId) + + // Properties + filter.Properties = genruntime.CloneMapOfStringToString(source.Properties) + + // ReplyTo + filter.ReplyTo = genruntime.ClonePointerToString(source.ReplyTo) + + // ReplyToSessionId + filter.ReplyToSessionId = genruntime.ClonePointerToString(source.ReplyToSessionId) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SessionId + filter.SessionId = genruntime.ClonePointerToString(source.SessionId) + + // To + filter.To = genruntime.ClonePointerToString(source.To) + + // Update the property bag + if len(propertyBag) > 0 { + filter.PropertyBag = propertyBag + } else { + filter.PropertyBag = nil + } + + // Invoke the augmentConversionForCorrelationFilter interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForCorrelationFilter); ok { + err := augmentedFilter.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_CorrelationFilter populates the provided destination CorrelationFilter from our CorrelationFilter +func (filter *CorrelationFilter) AssignProperties_To_CorrelationFilter(destination *v20211101s.CorrelationFilter) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(filter.PropertyBag) + + // ContentType + destination.ContentType = genruntime.ClonePointerToString(filter.ContentType) + + // CorrelationId + destination.CorrelationId = genruntime.ClonePointerToString(filter.CorrelationId) + + // Label + destination.Label = genruntime.ClonePointerToString(filter.Label) + + // MessageId + destination.MessageId = genruntime.ClonePointerToString(filter.MessageId) + + // Properties + destination.Properties = genruntime.CloneMapOfStringToString(filter.Properties) + + // ReplyTo + destination.ReplyTo = genruntime.ClonePointerToString(filter.ReplyTo) + + // ReplyToSessionId + destination.ReplyToSessionId = genruntime.ClonePointerToString(filter.ReplyToSessionId) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SessionId + destination.SessionId = genruntime.ClonePointerToString(filter.SessionId) + + // To + destination.To = genruntime.ClonePointerToString(filter.To) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForCorrelationFilter interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForCorrelationFilter); ok { + err := augmentedFilter.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210101preview.CorrelationFilter_STATUS // Represents the correlation filter expression. type CorrelationFilter_STATUS struct { @@ -261,6 +1052,126 @@ type CorrelationFilter_STATUS struct { To *string `json:"to,omitempty"` } +// AssignProperties_From_CorrelationFilter_STATUS populates our CorrelationFilter_STATUS from the provided source CorrelationFilter_STATUS +func (filter *CorrelationFilter_STATUS) AssignProperties_From_CorrelationFilter_STATUS(source *v20211101s.CorrelationFilter_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ContentType + filter.ContentType = genruntime.ClonePointerToString(source.ContentType) + + // CorrelationId + filter.CorrelationId = genruntime.ClonePointerToString(source.CorrelationId) + + // Label + filter.Label = genruntime.ClonePointerToString(source.Label) + + // MessageId + filter.MessageId = genruntime.ClonePointerToString(source.MessageId) + + // Properties + filter.Properties = genruntime.CloneMapOfStringToString(source.Properties) + + // ReplyTo + filter.ReplyTo = genruntime.ClonePointerToString(source.ReplyTo) + + // ReplyToSessionId + filter.ReplyToSessionId = genruntime.ClonePointerToString(source.ReplyToSessionId) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SessionId + filter.SessionId = genruntime.ClonePointerToString(source.SessionId) + + // To + filter.To = genruntime.ClonePointerToString(source.To) + + // Update the property bag + if len(propertyBag) > 0 { + filter.PropertyBag = propertyBag + } else { + filter.PropertyBag = nil + } + + // Invoke the augmentConversionForCorrelationFilter_STATUS interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForCorrelationFilter_STATUS); ok { + err := augmentedFilter.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_CorrelationFilter_STATUS populates the provided destination CorrelationFilter_STATUS from our CorrelationFilter_STATUS +func (filter *CorrelationFilter_STATUS) AssignProperties_To_CorrelationFilter_STATUS(destination *v20211101s.CorrelationFilter_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(filter.PropertyBag) + + // ContentType + destination.ContentType = genruntime.ClonePointerToString(filter.ContentType) + + // CorrelationId + destination.CorrelationId = genruntime.ClonePointerToString(filter.CorrelationId) + + // Label + destination.Label = genruntime.ClonePointerToString(filter.Label) + + // MessageId + destination.MessageId = genruntime.ClonePointerToString(filter.MessageId) + + // Properties + destination.Properties = genruntime.CloneMapOfStringToString(filter.Properties) + + // ReplyTo + destination.ReplyTo = genruntime.ClonePointerToString(filter.ReplyTo) + + // ReplyToSessionId + destination.ReplyToSessionId = genruntime.ClonePointerToString(filter.ReplyToSessionId) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SessionId + destination.SessionId = genruntime.ClonePointerToString(filter.SessionId) + + // To + destination.To = genruntime.ClonePointerToString(filter.To) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForCorrelationFilter_STATUS interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForCorrelationFilter_STATUS); ok { + err := augmentedFilter.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210101preview.SqlFilter // Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. type SqlFilter struct { @@ -270,6 +1181,84 @@ type SqlFilter struct { SqlExpression *string `json:"sqlExpression,omitempty"` } +// AssignProperties_From_SqlFilter populates our SqlFilter from the provided source SqlFilter +func (filter *SqlFilter) AssignProperties_From_SqlFilter(source *v20211101s.SqlFilter) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CompatibilityLevel + filter.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SqlExpression + filter.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + filter.PropertyBag = propertyBag + } else { + filter.PropertyBag = nil + } + + // Invoke the augmentConversionForSqlFilter interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForSqlFilter); ok { + err := augmentedFilter.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_SqlFilter populates the provided destination SqlFilter from our SqlFilter +func (filter *SqlFilter) AssignProperties_To_SqlFilter(destination *v20211101s.SqlFilter) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(filter.PropertyBag) + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(filter.CompatibilityLevel) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(filter.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForSqlFilter interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForSqlFilter); ok { + err := augmentedFilter.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20210101preview.SqlFilter_STATUS // Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. type SqlFilter_STATUS struct { @@ -279,6 +1268,114 @@ type SqlFilter_STATUS struct { SqlExpression *string `json:"sqlExpression,omitempty"` } +// AssignProperties_From_SqlFilter_STATUS populates our SqlFilter_STATUS from the provided source SqlFilter_STATUS +func (filter *SqlFilter_STATUS) AssignProperties_From_SqlFilter_STATUS(source *v20211101s.SqlFilter_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CompatibilityLevel + filter.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SqlExpression + filter.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + filter.PropertyBag = propertyBag + } else { + filter.PropertyBag = nil + } + + // Invoke the augmentConversionForSqlFilter_STATUS interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForSqlFilter_STATUS); ok { + err := augmentedFilter.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_SqlFilter_STATUS populates the provided destination SqlFilter_STATUS from our SqlFilter_STATUS +func (filter *SqlFilter_STATUS) AssignProperties_To_SqlFilter_STATUS(destination *v20211101s.SqlFilter_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(filter.PropertyBag) + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(filter.CompatibilityLevel) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(filter.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForSqlFilter_STATUS interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForSqlFilter_STATUS); ok { + err := augmentedFilter.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForAction interface { + AssignPropertiesFrom(src *v20211101s.Action) error + AssignPropertiesTo(dst *v20211101s.Action) error +} + +type augmentConversionForAction_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Action_STATUS) error + AssignPropertiesTo(dst *v20211101s.Action_STATUS) error +} + +type augmentConversionForCorrelationFilter interface { + AssignPropertiesFrom(src *v20211101s.CorrelationFilter) error + AssignPropertiesTo(dst *v20211101s.CorrelationFilter) error +} + +type augmentConversionForCorrelationFilter_STATUS interface { + AssignPropertiesFrom(src *v20211101s.CorrelationFilter_STATUS) error + AssignPropertiesTo(dst *v20211101s.CorrelationFilter_STATUS) error +} + +type augmentConversionForSqlFilter interface { + AssignPropertiesFrom(src *v20211101s.SqlFilter) error + AssignPropertiesTo(dst *v20211101s.SqlFilter) error +} + +type augmentConversionForSqlFilter_STATUS interface { + AssignPropertiesFrom(src *v20211101s.SqlFilter_STATUS) error + AssignPropertiesTo(dst *v20211101s.SqlFilter_STATUS) error +} + func init() { SchemeBuilder.Register(&NamespacesTopicsSubscriptionsRule{}, &NamespacesTopicsSubscriptionsRuleList{}) } diff --git a/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen_test.go b/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen_test.go index 6a634aa6980..c502755aaee 100644 --- a/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen_test.go @@ -5,6 +5,7 @@ package v1api20210101previewstorage import ( "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesTopicsSubscriptionsRule, NamespacesTopicsSubscriptionsRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesTopicsSubscriptionsRule tests if a specific instance of NamespacesTopicsSubscriptionsRule round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesTopicsSubscriptionsRule(subject NamespacesTopicsSubscriptionsRule) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesTopicsSubscriptionsRule + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesTopicsSubscriptionsRule + 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_NamespacesTopicsSubscriptionsRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscriptionsRule to NamespacesTopicsSubscriptionsRule via AssignProperties_To_NamespacesTopicsSubscriptionsRule & AssignProperties_From_NamespacesTopicsSubscriptionsRule returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule, NamespacesTopicsSubscriptionsRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule tests if a specific instance of NamespacesTopicsSubscriptionsRule can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule(subject NamespacesTopicsSubscriptionsRule) 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.NamespacesTopicsSubscriptionsRule + err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscriptionsRule + err = actual.AssignProperties_From_NamespacesTopicsSubscriptionsRule(&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_NamespacesTopicsSubscriptionsRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -79,6 +165,48 @@ func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule(gens map[s gens["Status"] = Namespaces_Topics_Subscriptions_Rule_STATUSGenerator() } +func Test_Namespaces_Topics_Subscriptions_Rule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscriptions_Rule_Spec to Namespaces_Topics_Subscriptions_Rule_Spec via AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec & AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_Spec, Namespaces_Topics_Subscriptions_Rule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_Spec tests if a specific instance of Namespaces_Topics_Subscriptions_Rule_Spec can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_Spec(subject Namespaces_Topics_Subscriptions_Rule_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 v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec + err := copied.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscriptions_Rule_Spec + err = actual.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -158,6 +286,48 @@ func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(ge gens["SqlFilter"] = gen.PtrOf(SqlFilterGenerator()) } +func Test_Namespaces_Topics_Subscriptions_Rule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscriptions_Rule_STATUS to Namespaces_Topics_Subscriptions_Rule_STATUS via AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS & AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_STATUS, Namespaces_Topics_Subscriptions_Rule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_STATUS tests if a specific instance of Namespaces_Topics_Subscriptions_Rule_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_STATUS(subject Namespaces_Topics_Subscriptions_Rule_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 v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS + err := copied.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscriptions_Rule_STATUS + err = actual.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -239,6 +409,48 @@ func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS( gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } +func Test_Action_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Action to Action via AssignProperties_To_Action & AssignProperties_From_Action returns original", + prop.ForAll(RunPropertyAssignmentTestForAction, ActionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAction tests if a specific instance of Action can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForAction(subject Action) 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.Action + err := copied.AssignProperties_To_Action(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Action + err = actual.AssignProperties_From_Action(&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_Action_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -301,6 +513,48 @@ func AddIndependentPropertyGeneratorsForAction(gens map[string]gopter.Gen) { gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) } +func Test_Action_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Action_STATUS to Action_STATUS via AssignProperties_To_Action_STATUS & AssignProperties_From_Action_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForAction_STATUS, Action_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAction_STATUS tests if a specific instance of Action_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForAction_STATUS(subject Action_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 v20211101s.Action_STATUS + err := copied.AssignProperties_To_Action_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Action_STATUS + err = actual.AssignProperties_From_Action_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_Action_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -363,6 +617,48 @@ func AddIndependentPropertyGeneratorsForAction_STATUS(gens map[string]gopter.Gen gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) } +func Test_CorrelationFilter_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CorrelationFilter to CorrelationFilter via AssignProperties_To_CorrelationFilter & AssignProperties_From_CorrelationFilter returns original", + prop.ForAll(RunPropertyAssignmentTestForCorrelationFilter, CorrelationFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCorrelationFilter tests if a specific instance of CorrelationFilter can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForCorrelationFilter(subject CorrelationFilter) 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.CorrelationFilter + err := copied.AssignProperties_To_CorrelationFilter(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CorrelationFilter + err = actual.AssignProperties_From_CorrelationFilter(&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_CorrelationFilter_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -432,6 +728,48 @@ func AddIndependentPropertyGeneratorsForCorrelationFilter(gens map[string]gopter gens["To"] = gen.PtrOf(gen.AlphaString()) } +func Test_CorrelationFilter_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CorrelationFilter_STATUS to CorrelationFilter_STATUS via AssignProperties_To_CorrelationFilter_STATUS & AssignProperties_From_CorrelationFilter_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForCorrelationFilter_STATUS, CorrelationFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCorrelationFilter_STATUS tests if a specific instance of CorrelationFilter_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForCorrelationFilter_STATUS(subject CorrelationFilter_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 v20211101s.CorrelationFilter_STATUS + err := copied.AssignProperties_To_CorrelationFilter_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CorrelationFilter_STATUS + err = actual.AssignProperties_From_CorrelationFilter_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_CorrelationFilter_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -502,6 +840,48 @@ func AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS(gens map[string gens["To"] = gen.PtrOf(gen.AlphaString()) } +func Test_SqlFilter_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SqlFilter to SqlFilter via AssignProperties_To_SqlFilter & AssignProperties_From_SqlFilter returns original", + prop.ForAll(RunPropertyAssignmentTestForSqlFilter, SqlFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSqlFilter tests if a specific instance of SqlFilter can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSqlFilter(subject SqlFilter) 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.SqlFilter + err := copied.AssignProperties_To_SqlFilter(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SqlFilter + err = actual.AssignProperties_From_SqlFilter(&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_SqlFilter_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -564,6 +944,48 @@ func AddIndependentPropertyGeneratorsForSqlFilter(gens map[string]gopter.Gen) { gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) } +func Test_SqlFilter_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SqlFilter_STATUS to SqlFilter_STATUS via AssignProperties_To_SqlFilter_STATUS & AssignProperties_From_SqlFilter_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSqlFilter_STATUS, SqlFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSqlFilter_STATUS tests if a specific instance of SqlFilter_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSqlFilter_STATUS(subject SqlFilter_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 v20211101s.SqlFilter_STATUS + err := copied.AssignProperties_To_SqlFilter_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SqlFilter_STATUS + err = actual.AssignProperties_From_SqlFilter_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_SqlFilter_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/servicebus/v1api20210101previewstorage/structure.txt b/v2/api/servicebus/v1api20210101previewstorage/structure.txt index 2ee82450480..b9f8342b94c 100644 --- a/v2/api/servicebus/v1api20210101previewstorage/structure.txt +++ b/v2/api/servicebus/v1api20210101previewstorage/structure.txt @@ -302,72 +302,115 @@ github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewst │ │ └── PropertyBag: genruntime.PropertyBag │ ├── Type: *string │ └── UpdatedAt: *string -└── NamespacesTopicsSubscriptionsRule: Resource - ├── Owner: github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview.NamespacesTopicsSubscription - ├── Spec: Object (8 properties) - │ ├── Action: *Object (4 properties) - │ │ ├── CompatibilityLevel: *int - │ │ ├── PropertyBag: genruntime.PropertyBag - │ │ ├── RequiresPreprocessing: *bool - │ │ └── SqlExpression: *string - │ ├── AzureName: Validated (2 rules) - │ │ ├── Rule 0: MaxLength: 50 - │ │ └── Rule 1: MinLength: 1 - │ ├── CorrelationFilter: *Object (11 properties) - │ │ ├── ContentType: *string - │ │ ├── CorrelationId: *string - │ │ ├── Label: *string - │ │ ├── MessageId: *string - │ │ ├── Properties: map[string]string - │ │ ├── PropertyBag: genruntime.PropertyBag - │ │ ├── ReplyTo: *string - │ │ ├── ReplyToSessionId: *string - │ │ ├── RequiresPreprocessing: *bool - │ │ ├── SessionId: *string - │ │ └── To: *string - │ ├── FilterType: *string - │ ├── OriginalVersion: string - │ ├── Owner: *genruntime.KnownResourceReference - │ ├── PropertyBag: genruntime.PropertyBag - │ └── SqlFilter: *Object (4 properties) - │ ├── CompatibilityLevel: *int - │ ├── PropertyBag: genruntime.PropertyBag - │ ├── RequiresPreprocessing: *bool - │ └── SqlExpression: *string - └── Status: Object (10 properties) - ├── Action: *Object (4 properties) - │ ├── CompatibilityLevel: *int - │ ├── PropertyBag: genruntime.PropertyBag - │ ├── RequiresPreprocessing: *bool - │ └── SqlExpression: *string - ├── Conditions: conditions.Condition[] - ├── CorrelationFilter: *Object (11 properties) - │ ├── ContentType: *string - │ ├── CorrelationId: *string - │ ├── Label: *string - │ ├── MessageId: *string - │ ├── Properties: map[string]string - │ ├── PropertyBag: genruntime.PropertyBag - │ ├── ReplyTo: *string - │ ├── ReplyToSessionId: *string - │ ├── RequiresPreprocessing: *bool - │ ├── SessionId: *string - │ └── To: *string - ├── FilterType: *string - ├── Id: *string - ├── Name: *string - ├── PropertyBag: genruntime.PropertyBag - ├── SqlFilter: *Object (4 properties) - │ ├── CompatibilityLevel: *int - │ ├── PropertyBag: genruntime.PropertyBag - │ ├── RequiresPreprocessing: *bool - │ └── SqlExpression: *string - ├── SystemData: *Object (7 properties) - │ ├── CreatedAt: *string - │ ├── CreatedBy: *string - │ ├── CreatedByType: *string - │ ├── LastModifiedAt: *string - │ ├── LastModifiedBy: *string - │ ├── LastModifiedByType: *string - │ └── PropertyBag: genruntime.PropertyBag - └── Type: *string +├── NamespacesTopicsSubscriptionsRule: Resource +│ ├── Owner: github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview.NamespacesTopicsSubscription +│ ├── Spec: Object (8 properties) +│ │ ├── Action: *Object (4 properties) +│ │ │ ├── CompatibilityLevel: *int +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── RequiresPreprocessing: *bool +│ │ │ └── SqlExpression: *string +│ │ ├── AzureName: Validated (2 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ └── Rule 1: MinLength: 1 +│ │ ├── CorrelationFilter: *Object (11 properties) +│ │ │ ├── ContentType: *string +│ │ │ ├── CorrelationId: *string +│ │ │ ├── Label: *string +│ │ │ ├── MessageId: *string +│ │ │ ├── Properties: map[string]string +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── ReplyTo: *string +│ │ │ ├── ReplyToSessionId: *string +│ │ │ ├── RequiresPreprocessing: *bool +│ │ │ ├── SessionId: *string +│ │ │ └── To: *string +│ │ ├── FilterType: *string +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── SqlFilter: *Object (4 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *string +│ └── Status: Object (10 properties) +│ ├── Action: *Object (4 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CorrelationFilter: *Object (11 properties) +│ │ ├── ContentType: *string +│ │ ├── CorrelationId: *string +│ │ ├── Label: *string +│ │ ├── MessageId: *string +│ │ ├── Properties: map[string]string +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── ReplyTo: *string +│ │ ├── ReplyToSessionId: *string +│ │ ├── RequiresPreprocessing: *bool +│ │ ├── SessionId: *string +│ │ └── To: *string +│ ├── FilterType: *string +│ ├── Id: *string +│ ├── Name: *string +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── SqlFilter: *Object (4 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *string +│ ├── SystemData: *Object (7 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *string +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ ├── LastModifiedByType: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ └── Type: *string +├── augmentConversionForAction: Interface +├── augmentConversionForAction_STATUS: Interface +├── augmentConversionForCorrelationFilter: Interface +├── augmentConversionForCorrelationFilter_STATUS: Interface +├── augmentConversionForDictionaryValue_STATUS: Interface +├── augmentConversionForEncryption: Interface +├── augmentConversionForEncryption_STATUS: Interface +├── augmentConversionForIdentity: Interface +├── augmentConversionForIdentity_STATUS: Interface +├── augmentConversionForKeyVaultProperties: Interface +├── augmentConversionForKeyVaultProperties_STATUS: Interface +├── augmentConversionForMessageCountDetails_STATUS: Interface +├── augmentConversionForNamespace: Interface +├── augmentConversionForNamespaceOperatorSecrets: Interface +├── augmentConversionForNamespaceOperatorSpec: Interface +├── augmentConversionForNamespace_STATUS: Interface +├── augmentConversionForNamespace_Spec: Interface +├── augmentConversionForNamespacesAuthorizationRule: Interface +├── augmentConversionForNamespacesAuthorizationRuleOperatorSecrets: Interface +├── augmentConversionForNamespacesAuthorizationRuleOperatorSpec: Interface +├── augmentConversionForNamespacesQueue: Interface +├── augmentConversionForNamespacesTopic: Interface +├── augmentConversionForNamespacesTopicsSubscription: Interface +├── augmentConversionForNamespacesTopicsSubscriptionsRule: Interface +├── augmentConversionForNamespaces_AuthorizationRule_STATUS: Interface +├── augmentConversionForNamespaces_AuthorizationRule_Spec: Interface +├── augmentConversionForNamespaces_Queue_STATUS: Interface +├── augmentConversionForNamespaces_Queue_Spec: Interface +├── augmentConversionForNamespaces_Topic_STATUS: Interface +├── augmentConversionForNamespaces_Topic_Spec: Interface +├── augmentConversionForNamespaces_Topics_Subscription_STATUS: Interface +├── augmentConversionForNamespaces_Topics_Subscription_Spec: Interface +├── augmentConversionForNamespaces_Topics_Subscriptions_Rule_STATUS: Interface +├── augmentConversionForNamespaces_Topics_Subscriptions_Rule_Spec: Interface +├── augmentConversionForPrivateEndpointConnection_STATUS: Interface +├── augmentConversionForSBSku: Interface +├── augmentConversionForSBSku_STATUS: Interface +├── augmentConversionForSqlFilter: Interface +├── augmentConversionForSqlFilter_STATUS: Interface +├── augmentConversionForSystemData_STATUS: Interface +├── augmentConversionForUserAssignedIdentityDetails: Interface +├── augmentConversionForUserAssignedIdentityProperties: Interface +└── augmentConversionForUserAssignedIdentityProperties_STATUS: Interface diff --git a/v2/api/servicebus/v1api20211101/doc.go b/v2/api/servicebus/v1api20211101/doc.go new file mode 100644 index 00000000000..e93abc75ed2 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/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 v1api20211101 contains API Schema definitions for the servicebus v1api20211101 API group +// +groupName=servicebus.azure.com +package v1api20211101 diff --git a/v2/api/servicebus/v1api20211101/groupversion_info_gen.go b/v2/api/servicebus/v1api20211101/groupversion_info_gen.go new file mode 100644 index 00000000000..4f3c6e0f57f --- /dev/null +++ b/v2/api/servicebus/v1api20211101/groupversion_info_gen.go @@ -0,0 +1,31 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package v1api20211101 contains API Schema definitions for the servicebus v1api20211101 API group +// +kubebuilder:object:generate=true +// All object properties are optional by default, this will be overridden when needed: +// +kubebuilder:validation:Optional +// +groupName=servicebus.azure.com +package v1api20211101 + +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: "servicebus.azure.com", Version: "v1api20211101"} + + // 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/servicebus/v1api20211101/namespace_spec_arm_types_gen.go b/v2/api/servicebus/v1api20211101/namespace_spec_arm_types_gen.go new file mode 100644 index 00000000000..dbe17b1e8a4 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespace_spec_arm_types_gen.go @@ -0,0 +1,137 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +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: The Geo-location where the resource lives + Location *string `json:"location,omitempty"` + Name string `json:"name,omitempty"` + + // Properties: Properties of the namespace. + Properties *SBNamespaceProperties_ARM `json:"properties,omitempty"` + + // Sku: Properties of SKU + Sku *SBSku_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 "2021-11-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.ServiceBus/namespaces" +func (namespace *Namespace_Spec_ARM) GetType() string { + return "Microsoft.ServiceBus/namespaces" +} + +// Properties to configure User Assigned Identities 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"` +} + +// Properties of the namespace. +type SBNamespaceProperties_ARM struct { + // AlternateName: Alternate name for namespace + AlternateName *string `json:"alternateName,omitempty"` + + // DisableLocalAuth: This property disables SAS authentication for the Service Bus namespace. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Encryption: Properties of BYOK Encryption description + Encryption *Encryption_ARM `json:"encryption,omitempty"` + + // ZoneRedundant: Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// SKU of the namespace. +type SBSku_ARM struct { + // Capacity: The specified messaging units for the tier. For Premium tier, capacity are 1,2 and 4. + Capacity *int `json:"capacity,omitempty"` + + // Name: Name of this SKU. + Name *SBSku_Name `json:"name,omitempty"` + + // Tier: The billing tier of this particular SKU. + Tier *SBSku_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 SBSku_Name string + +const ( + SBSku_Name_Basic = SBSku_Name("Basic") + SBSku_Name_Premium = SBSku_Name("Premium") + SBSku_Name_Standard = SBSku_Name("Standard") +) + +// +kubebuilder:validation:Enum={"Basic","Premium","Standard"} +type SBSku_Tier string + +const ( + SBSku_Tier_Basic = SBSku_Tier("Basic") + SBSku_Tier_Premium = SBSku_Tier("Premium") + SBSku_Tier_Standard = SBSku_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: Version of KeyVault + KeyVersion *string `json:"keyVersion,omitempty"` +} + +type UserAssignedIdentityProperties_ARM struct { + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} diff --git a/v2/api/servicebus/v1api20211101/namespace_spec_arm_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespace_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..38b96881117 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespace_spec_arm_types_gen_test.go @@ -0,0 +1,581 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +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(SBNamespaceProperties_ARMGenerator()) + gens["Sku"] = gen.PtrOf(SBSku_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_SBNamespaceProperties_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 SBNamespaceProperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBNamespaceProperties_ARM, SBNamespaceProperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBNamespaceProperties_ARM runs a test to see if a specific instance of SBNamespaceProperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBNamespaceProperties_ARM(subject SBNamespaceProperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBNamespaceProperties_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 SBNamespaceProperties_ARM instances for property testing - lazily instantiated by +// SBNamespaceProperties_ARMGenerator() +var sbNamespaceProperties_ARMGenerator gopter.Gen + +// SBNamespaceProperties_ARMGenerator returns a generator of SBNamespaceProperties_ARM instances for property testing. +// We first initialize sbNamespaceProperties_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 SBNamespaceProperties_ARMGenerator() gopter.Gen { + if sbNamespaceProperties_ARMGenerator != nil { + return sbNamespaceProperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBNamespaceProperties_ARM(generators) + sbNamespaceProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBNamespaceProperties_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBNamespaceProperties_ARM(generators) + AddRelatedPropertyGeneratorsForSBNamespaceProperties_ARM(generators) + sbNamespaceProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBNamespaceProperties_ARM{}), generators) + + return sbNamespaceProperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBNamespaceProperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBNamespaceProperties_ARM(gens map[string]gopter.Gen) { + gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForSBNamespaceProperties_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBNamespaceProperties_ARM(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(Encryption_ARMGenerator()) +} + +func Test_SBSku_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 SBSku_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSku_ARM, SBSku_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSku_ARM runs a test to see if a specific instance of SBSku_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSku_ARM(subject SBSku_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSku_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 SBSku_ARM instances for property testing - lazily instantiated by SBSku_ARMGenerator() +var sbSku_ARMGenerator gopter.Gen + +// SBSku_ARMGenerator returns a generator of SBSku_ARM instances for property testing. +func SBSku_ARMGenerator() gopter.Gen { + if sbSku_ARMGenerator != nil { + return sbSku_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSku_ARM(generators) + sbSku_ARMGenerator = gen.Struct(reflect.TypeOf(SBSku_ARM{}), generators) + + return sbSku_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBSku_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSku_ARM(gens map[string]gopter.Gen) { + gens["Capacity"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf(SBSku_Name_Basic, SBSku_Name_Premium, SBSku_Name_Standard)) + gens["Tier"] = gen.PtrOf(gen.OneConstOf(SBSku_Tier_Basic, SBSku_Tier_Premium, SBSku_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/servicebus/v1api20211101/namespace_status_arm_types_gen.go b/v2/api/servicebus/v1api20211101/namespace_status_arm_types_gen.go new file mode 100644 index 00000000000..768d65b09b3 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespace_status_arm_types_gen.go @@ -0,0 +1,207 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +type Namespace_STATUS_ARM struct { + // Id: Resource Id + Id *string `json:"id,omitempty"` + + // Identity: Properties of BYOK Identity description + Identity *Identity_STATUS_ARM `json:"identity,omitempty"` + + // Location: The Geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Name: Resource name + Name *string `json:"name,omitempty"` + + // Properties: Properties of the namespace. + Properties *SBNamespaceProperties_STATUS_ARM `json:"properties,omitempty"` + + // Sku: Properties of SKU + Sku *SBSku_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: Resource type + Type *string `json:"type,omitempty"` +} + +// Properties to configure User Assigned Identities 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"` +} + +// Properties of the namespace. +type SBNamespaceProperties_STATUS_ARM struct { + // AlternateName: Alternate name for namespace + AlternateName *string `json:"alternateName,omitempty"` + + // CreatedAt: The time the namespace was created + CreatedAt *string `json:"createdAt,omitempty"` + + // DisableLocalAuth: This property disables SAS authentication for the Service Bus namespace. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Encryption: Properties of BYOK Encryption description + Encryption *Encryption_STATUS_ARM `json:"encryption,omitempty"` + + // MetricId: Identifier for Azure Insights metrics + MetricId *string `json:"metricId,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"` + + // 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 Premium Service Bus Namespace in regions supported availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// SKU of the namespace. +type SBSku_STATUS_ARM struct { + // Capacity: The specified messaging units for the tier. For Premium tier, capacity are 1,2 and 4. + Capacity *int `json:"capacity,omitempty"` + + // Name: Name of this SKU. + Name *SBSku_Name_STATUS `json:"name,omitempty"` + + // Tier: The billing tier of this particular SKU. + Tier *SBSku_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 SBSku_Name_STATUS string + +const ( + SBSku_Name_STATUS_Basic = SBSku_Name_STATUS("Basic") + SBSku_Name_STATUS_Premium = SBSku_Name_STATUS("Premium") + SBSku_Name_STATUS_Standard = SBSku_Name_STATUS("Standard") +) + +type SBSku_Tier_STATUS string + +const ( + SBSku_Tier_STATUS_Basic = SBSku_Tier_STATUS("Basic") + SBSku_Tier_STATUS_Premium = SBSku_Tier_STATUS("Premium") + SBSku_Tier_STATUS_Standard = SBSku_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: Version of KeyVault + 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/servicebus/v1api20211101/namespace_status_arm_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespace_status_arm_types_gen_test.go new file mode 100644 index 00000000000..ee14008f7aa --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespace_status_arm_types_gen_test.go @@ -0,0 +1,738 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +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(SBNamespaceProperties_STATUS_ARMGenerator()) + gens["Sku"] = gen.PtrOf(SBSku_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_SBNamespaceProperties_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 SBNamespaceProperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBNamespaceProperties_STATUS_ARM, SBNamespaceProperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBNamespaceProperties_STATUS_ARM runs a test to see if a specific instance of SBNamespaceProperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBNamespaceProperties_STATUS_ARM(subject SBNamespaceProperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBNamespaceProperties_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 SBNamespaceProperties_STATUS_ARM instances for property testing - lazily instantiated by +// SBNamespaceProperties_STATUS_ARMGenerator() +var sbNamespaceProperties_STATUS_ARMGenerator gopter.Gen + +// SBNamespaceProperties_STATUS_ARMGenerator returns a generator of SBNamespaceProperties_STATUS_ARM instances for property testing. +// We first initialize sbNamespaceProperties_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 SBNamespaceProperties_STATUS_ARMGenerator() gopter.Gen { + if sbNamespaceProperties_STATUS_ARMGenerator != nil { + return sbNamespaceProperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM(generators) + sbNamespaceProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBNamespaceProperties_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM(generators) + sbNamespaceProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBNamespaceProperties_STATUS_ARM{}), generators) + + return sbNamespaceProperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["MetricId"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString()) + gens["ServiceBusEndpoint"] = gen.PtrOf(gen.AlphaString()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(Encryption_STATUS_ARMGenerator()) + gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnection_STATUS_ARMGenerator()) +} + +func Test_SBSku_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 SBSku_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSku_STATUS_ARM, SBSku_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSku_STATUS_ARM runs a test to see if a specific instance of SBSku_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSku_STATUS_ARM(subject SBSku_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSku_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 SBSku_STATUS_ARM instances for property testing - lazily instantiated by SBSku_STATUS_ARMGenerator() +var sbSku_STATUS_ARMGenerator gopter.Gen + +// SBSku_STATUS_ARMGenerator returns a generator of SBSku_STATUS_ARM instances for property testing. +func SBSku_STATUS_ARMGenerator() gopter.Gen { + if sbSku_STATUS_ARMGenerator != nil { + return sbSku_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSku_STATUS_ARM(generators) + sbSku_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBSku_STATUS_ARM{}), generators) + + return sbSku_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBSku_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSku_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Capacity"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf(SBSku_Name_STATUS_Basic, SBSku_Name_STATUS_Premium, SBSku_Name_STATUS_Standard)) + gens["Tier"] = gen.PtrOf(gen.OneConstOf(SBSku_Tier_STATUS_Basic, SBSku_Tier_STATUS_Premium, SBSku_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/servicebus/v1api20211101/namespace_types_gen.go b/v2/api/servicebus/v1api20211101/namespace_types_gen.go new file mode 100644 index 00000000000..2c2f4de058c --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespace_types_gen.go @@ -0,0 +1,3366 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/namespace-preview.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.(*v20211101s.Namespace) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/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.(*v20211101s.Namespace) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/Namespace but received %T instead", hub) + } + + return namespace.AssignProperties_To_Namespace(destination) +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20211101-namespace,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespaces,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespaces.servicebus.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 "2021-11-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 +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces" +func (namespace *Namespace) GetType() string { + return "Microsoft.ServiceBus/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 &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: namespace.Spec.Owner.Name, + } +} + +// 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-servicebus-azure-com-v1api20211101-namespace,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespaces,verbs=create;update,versions=v1api20211101,name=validate.v1api20211101.namespaces.servicebus.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.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.validateSecretDestinations() + }, + } +} + +// 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.Endpoint, + 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 *v20211101s.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 *v20211101s.Namespace) error { + + // ObjectMeta + destination.ObjectMeta = *namespace.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.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 v20211101s.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: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/namespace-preview.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName} +type NamespaceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Namespace `json:"items"` +} + +// +kubebuilder:validation:Enum={"2021-11-01"} +type APIVersion string + +const APIVersion_Value = APIVersion("2021-11-01") + +type Namespace_Spec struct { + // AlternateName: Alternate name for namespace + 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"` + + // DisableLocalAuth: This property disables SAS authentication for the Service Bus 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"` + + // +kubebuilder:validation:Required + // Location: The Geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not + // passed directly to Azure + OperatorSpec *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"` + + // Sku: Properties of SKU + Sku *SBSku `json:"sku,omitempty"` + + // Tags: Resource tags + Tags map[string]string `json:"tags,omitempty"` + + // ZoneRedundant: Enabling this property creates a Premium Service Bus 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.DisableLocalAuth != nil || + namespace.Encryption != nil || + namespace.ZoneRedundant != nil { + result.Properties = &SBNamespaceProperties_ARM{} + } + if namespace.AlternateName != nil { + alternateName := *namespace.AlternateName + result.Properties.AlternateName = &alternateName + } + 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.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.(*SBSku_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)) + + // 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 "Location": + if typedInput.Location != nil { + location := *typedInput.Location + namespace.Location = &location + } + + // no assignment for property "OperatorSpec" + + // Set property "Owner": + namespace.Owner = &genruntime.KnownResourceReference{Name: owner.Name} + + // Set property "Sku": + if typedInput.Sku != nil { + var sku1 SBSku + 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.(*v20211101s.Namespace_Spec) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.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.(*v20211101s.Namespace_Spec) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.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 *v20211101s.Namespace_Spec) error { + + // AlternateName + namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) + + // AzureName + namespace.AzureName = source.AzureName + + // 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 + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // 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 + } + + // Sku + if source.Sku != nil { + var sku SBSku + err := sku.AssignProperties_From_SBSku(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBSku() 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 *v20211101s.Namespace_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AlternateName + destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName) + + // AzureName + destination.AzureName = namespace.AzureName + + // DisableLocalAuth + if namespace.DisableLocalAuth != nil { + disableLocalAuth := *namespace.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Encryption + if namespace.Encryption != nil { + var encryption v20211101s.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 v20211101s.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 + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // 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() + + // Owner + if namespace.Owner != nil { + owner := namespace.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // Sku + if namespace.Sku != nil { + var sku v20211101s.SBSku + err := namespace.Sku.AssignProperties_To_SBSku(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBSku() 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) + + // 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 + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // Sku + if source.Sku != nil { + var sku SBSku + err := sku.Initialize_From_SBSku_STATUS(source.Sku) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_SBSku_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 for namespace + AlternateName *string `json:"alternateName,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 Service Bus namespace. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Encryption: Properties of BYOK Encryption description + Encryption *Encryption_STATUS `json:"encryption,omitempty"` + + // Id: Resource Id + Id *string `json:"id,omitempty"` + + // Identity: Properties of BYOK Identity description + Identity *Identity_STATUS `json:"identity,omitempty"` + + // Location: The Geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // MetricId: Identifier for Azure Insights metrics + MetricId *string `json:"metricId,omitempty"` + + // Name: Resource name + 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"` + + // ServiceBusEndpoint: Endpoint you can use to perform Service Bus operations. + ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"` + + // Sku: Properties of SKU + Sku *SBSku_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: Resource type + Type *string `json:"type,omitempty"` + + // UpdatedAt: The time the namespace was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` + + // ZoneRedundant: Enabling this property creates a Premium Service Bus 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.(*v20211101s.Namespace_STATUS) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.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.(*v20211101s.Namespace_STATUS) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.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 + } + } + + // 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 "Location": + if typedInput.Location != nil { + location := *typedInput.Location + namespace.Location = &location + } + + // Set property "MetricId": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MetricId != nil { + metricId := *typedInput.Properties.MetricId + namespace.MetricId = &metricId + } + } + + // 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 "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 SBSku_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 *v20211101s.Namespace_STATUS) error { + + // AlternateName + namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) + + // 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 + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // MetricId + namespace.MetricId = genruntime.ClonePointerToString(source.MetricId) + + // 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) + + // ServiceBusEndpoint + namespace.ServiceBusEndpoint = genruntime.ClonePointerToString(source.ServiceBusEndpoint) + + // Sku + if source.Sku != nil { + var sku SBSku_STATUS + err := sku.AssignProperties_From_SBSku_STATUS(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBSku_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 *v20211101s.Namespace_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AlternateName + destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName) + + // 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 v20211101s.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 v20211101s.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 + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // MetricId + destination.MetricId = genruntime.ClonePointerToString(namespace.MetricId) + + // Name + destination.Name = genruntime.ClonePointerToString(namespace.Name) + + // PrivateEndpointConnections + if namespace.PrivateEndpointConnections != nil { + privateEndpointConnectionList := make([]v20211101s.PrivateEndpointConnection_STATUS, len(namespace.PrivateEndpointConnections)) + for privateEndpointConnectionIndex, privateEndpointConnectionItem := range namespace.PrivateEndpointConnections { + // Shadow the loop variable to avoid aliasing + privateEndpointConnectionItem := privateEndpointConnectionItem + var privateEndpointConnection v20211101s.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) + + // ServiceBusEndpoint + destination.ServiceBusEndpoint = genruntime.ClonePointerToString(namespace.ServiceBusEndpoint) + + // Sku + if namespace.Sku != nil { + var sku v20211101s.SBSku_STATUS + err := namespace.Sku.AssignProperties_To_SBSku_STATUS(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBSku_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 v20211101s.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 *v20211101s.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 *v20211101s.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([]v20211101s.KeyVaultProperties, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty v20211101s.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 *v20211101s.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 *v20211101s.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([]v20211101s.KeyVaultProperties_STATUS, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty v20211101s.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 User Assigned Identities 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 *v20211101s.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 *v20211101s.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([]v20211101s.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities)) + for userAssignedIdentityIndex, userAssignedIdentityItem := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityItem := userAssignedIdentityItem + var userAssignedIdentity v20211101s.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 User Assigned Identities 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 *v20211101s.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 *v20211101s.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]v20211101s.UserAssignedIdentity_STATUS, len(identity.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + var userAssignedIdentity v20211101s.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 +} + +// 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 - + // /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 *v20211101s.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 *v20211101s.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 of the namespace. +type SBSku struct { + // Capacity: The specified messaging units for the tier. For Premium tier, capacity are 1,2 and 4. + Capacity *int `json:"capacity,omitempty"` + + // +kubebuilder:validation:Required + // Name: Name of this SKU. + Name *SBSku_Name `json:"name,omitempty"` + + // Tier: The billing tier of this particular SKU. + Tier *SBSku_Tier `json:"tier,omitempty"` +} + +var _ genruntime.ARMTransformer = &SBSku{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (sbSku *SBSku) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if sbSku == nil { + return nil, nil + } + result := &SBSku_ARM{} + + // Set property "Capacity": + if sbSku.Capacity != nil { + capacity := *sbSku.Capacity + result.Capacity = &capacity + } + + // Set property "Name": + if sbSku.Name != nil { + name := *sbSku.Name + result.Name = &name + } + + // Set property "Tier": + if sbSku.Tier != nil { + tier := *sbSku.Tier + result.Tier = &tier + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (sbSku *SBSku) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SBSku_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (sbSku *SBSku) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SBSku_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SBSku_ARM, got %T", armInput) + } + + // Set property "Capacity": + if typedInput.Capacity != nil { + capacity := *typedInput.Capacity + sbSku.Capacity = &capacity + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + sbSku.Name = &name + } + + // Set property "Tier": + if typedInput.Tier != nil { + tier := *typedInput.Tier + sbSku.Tier = &tier + } + + // No error + return nil +} + +// AssignProperties_From_SBSku populates our SBSku from the provided source SBSku +func (sbSku *SBSku) AssignProperties_From_SBSku(source *v20211101s.SBSku) error { + + // Capacity + sbSku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + if source.Name != nil { + name := SBSku_Name(*source.Name) + sbSku.Name = &name + } else { + sbSku.Name = nil + } + + // Tier + if source.Tier != nil { + tier := SBSku_Tier(*source.Tier) + sbSku.Tier = &tier + } else { + sbSku.Tier = nil + } + + // No error + return nil +} + +// AssignProperties_To_SBSku populates the provided destination SBSku from our SBSku +func (sbSku *SBSku) AssignProperties_To_SBSku(destination *v20211101s.SBSku) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Capacity + destination.Capacity = genruntime.ClonePointerToInt(sbSku.Capacity) + + // Name + if sbSku.Name != nil { + name := string(*sbSku.Name) + destination.Name = &name + } else { + destination.Name = nil + } + + // Tier + if sbSku.Tier != nil { + tier := string(*sbSku.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_SBSku_STATUS populates our SBSku from the provided source SBSku_STATUS +func (sbSku *SBSku) Initialize_From_SBSku_STATUS(source *SBSku_STATUS) error { + + // Capacity + sbSku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + if source.Name != nil { + name := SBSku_Name(*source.Name) + sbSku.Name = &name + } else { + sbSku.Name = nil + } + + // Tier + if source.Tier != nil { + tier := SBSku_Tier(*source.Tier) + sbSku.Tier = &tier + } else { + sbSku.Tier = nil + } + + // No error + return nil +} + +// SKU of the namespace. +type SBSku_STATUS struct { + // Capacity: The specified messaging units for the tier. For Premium tier, capacity are 1,2 and 4. + Capacity *int `json:"capacity,omitempty"` + + // Name: Name of this SKU. + Name *SBSku_Name_STATUS `json:"name,omitempty"` + + // Tier: The billing tier of this particular SKU. + Tier *SBSku_Tier_STATUS `json:"tier,omitempty"` +} + +var _ genruntime.FromARMConverter = &SBSku_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (sbSku *SBSku_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SBSku_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (sbSku *SBSku_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SBSku_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SBSku_STATUS_ARM, got %T", armInput) + } + + // Set property "Capacity": + if typedInput.Capacity != nil { + capacity := *typedInput.Capacity + sbSku.Capacity = &capacity + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + sbSku.Name = &name + } + + // Set property "Tier": + if typedInput.Tier != nil { + tier := *typedInput.Tier + sbSku.Tier = &tier + } + + // No error + return nil +} + +// AssignProperties_From_SBSku_STATUS populates our SBSku_STATUS from the provided source SBSku_STATUS +func (sbSku *SBSku_STATUS) AssignProperties_From_SBSku_STATUS(source *v20211101s.SBSku_STATUS) error { + + // Capacity + sbSku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + if source.Name != nil { + name := SBSku_Name_STATUS(*source.Name) + sbSku.Name = &name + } else { + sbSku.Name = nil + } + + // Tier + if source.Tier != nil { + tier := SBSku_Tier_STATUS(*source.Tier) + sbSku.Tier = &tier + } else { + sbSku.Tier = nil + } + + // No error + return nil +} + +// AssignProperties_To_SBSku_STATUS populates the provided destination SBSku_STATUS from our SBSku_STATUS +func (sbSku *SBSku_STATUS) AssignProperties_To_SBSku_STATUS(destination *v20211101s.SBSku_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Capacity + destination.Capacity = genruntime.ClonePointerToInt(sbSku.Capacity) + + // Name + if sbSku.Name != nil { + name := string(*sbSku.Name) + destination.Name = &name + } else { + destination.Name = nil + } + + // Tier + if sbSku.Tier != nil { + tier := string(*sbSku.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 *v20211101s.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 *v20211101s.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: Version of KeyVault + 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 *v20211101s.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 *v20211101s.KeyVaultProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Identity + if properties.Identity != nil { + var identity v20211101s.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: Version of KeyVault + 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 *v20211101s.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 *v20211101s.KeyVaultProperties_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Identity + if properties.Identity != nil { + var identity v20211101s.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 { + // Endpoint: indicates where the Endpoint secret should be placed. If omitted, the secret will not be retrieved from Azure. + Endpoint *genruntime.SecretDestination `json:"endpoint,omitempty"` + + // 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 { + + // Endpoint + if source.Endpoint != nil { + endpoint := source.Endpoint.Copy() + secrets.Endpoint = &endpoint + } else { + secrets.Endpoint = nil + } + + // 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() + + // Endpoint + if secrets.Endpoint != nil { + endpoint := secrets.Endpoint.Copy() + destination.Endpoint = &endpoint + } else { + destination.Endpoint = nil + } + + // 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 *v20211101s.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 *v20211101s.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 *v20211101s.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 *v20211101s.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 *v20211101s.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 *v20211101s.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 *v20211101s.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 *v20211101s.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/servicebus/v1api20211101/namespace_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespace_types_gen_test.go new file mode 100644 index 00000000000..82737a32e34 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespace_types_gen_test.go @@ -0,0 +1,2162 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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["Location"] = 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(SBSkuGenerator()) +} + +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 v1api20211101storage 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 v20211101s.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["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MetricId"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = 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(SBSku_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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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() + 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 v1api20211101storage 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 v20211101s.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_SBSku_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBSku to SBSku via AssignProperties_To_SBSku & AssignProperties_From_SBSku returns original", + prop.ForAll(RunPropertyAssignmentTestForSBSku, SBSkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBSku tests if a specific instance of SBSku can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSBSku(subject SBSku) 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.SBSku + err := copied.AssignProperties_To_SBSku(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBSku + err = actual.AssignProperties_From_SBSku(&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_SBSku_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 SBSku via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSku, SBSkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSku runs a test to see if a specific instance of SBSku round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSku(subject SBSku) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSku + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SBSku instances for property testing - lazily instantiated by SBSkuGenerator() +var sbSkuGenerator gopter.Gen + +// SBSkuGenerator returns a generator of SBSku instances for property testing. +func SBSkuGenerator() gopter.Gen { + if sbSkuGenerator != nil { + return sbSkuGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSku(generators) + sbSkuGenerator = gen.Struct(reflect.TypeOf(SBSku{}), generators) + + return sbSkuGenerator +} + +// AddIndependentPropertyGeneratorsForSBSku is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSku(gens map[string]gopter.Gen) { + gens["Capacity"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf(SBSku_Name_Basic, SBSku_Name_Premium, SBSku_Name_Standard)) + gens["Tier"] = gen.PtrOf(gen.OneConstOf(SBSku_Tier_Basic, SBSku_Tier_Premium, SBSku_Tier_Standard)) +} + +func Test_SBSku_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBSku_STATUS to SBSku_STATUS via AssignProperties_To_SBSku_STATUS & AssignProperties_From_SBSku_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSBSku_STATUS, SBSku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBSku_STATUS tests if a specific instance of SBSku_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSBSku_STATUS(subject SBSku_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 v20211101s.SBSku_STATUS + err := copied.AssignProperties_To_SBSku_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBSku_STATUS + err = actual.AssignProperties_From_SBSku_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_SBSku_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 SBSku_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSku_STATUS, SBSku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSku_STATUS runs a test to see if a specific instance of SBSku_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSku_STATUS(subject SBSku_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSku_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 SBSku_STATUS instances for property testing - lazily instantiated by SBSku_STATUSGenerator() +var sbSku_STATUSGenerator gopter.Gen + +// SBSku_STATUSGenerator returns a generator of SBSku_STATUS instances for property testing. +func SBSku_STATUSGenerator() gopter.Gen { + if sbSku_STATUSGenerator != nil { + return sbSku_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSku_STATUS(generators) + sbSku_STATUSGenerator = gen.Struct(reflect.TypeOf(SBSku_STATUS{}), generators) + + return sbSku_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSBSku_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSku_STATUS(gens map[string]gopter.Gen) { + gens["Capacity"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf(SBSku_Name_STATUS_Basic, SBSku_Name_STATUS_Premium, SBSku_Name_STATUS_Standard)) + gens["Tier"] = gen.PtrOf(gen.OneConstOf(SBSku_Tier_STATUS_Basic, SBSku_Tier_STATUS_Premium, SBSku_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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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() + 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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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/servicebus/v1api20211101/namespaces_authorization_rule_spec_arm_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_spec_arm_types_gen.go new file mode 100644 index 00000000000..90224aca744 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/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 v1api20211101 + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_AuthorizationRule_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: AuthorizationRule properties. + 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 "2021-11-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.ServiceBus/namespaces/AuthorizationRules" +func (rule *Namespaces_AuthorizationRule_Spec_ARM) GetType() string { + return "Microsoft.ServiceBus/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/servicebus/v1api20211101/namespaces_authorization_rule_spec_arm_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..b79b18cb5de --- /dev/null +++ b/v2/api/servicebus/v1api20211101/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 v1api20211101 + +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/servicebus/v1api20211101/namespaces_authorization_rule_status_arm_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_status_arm_types_gen.go new file mode 100644 index 00000000000..48587780d5d --- /dev/null +++ b/v2/api/servicebus/v1api20211101/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 v1api20211101 + +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: AuthorizationRule properties. + 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/servicebus/v1api20211101/namespaces_authorization_rule_status_arm_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_status_arm_types_gen_test.go new file mode 100644 index 00000000000..f38a9a7a832 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/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 v1api20211101 + +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/servicebus/v1api20211101/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_types_gen.go new file mode 100644 index 00000000000..2dd14fdb5d6 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_types_gen.go @@ -0,0 +1,1006 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.(*v20211101s.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/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.(*v20211101s.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20211101-namespacesauthorizationrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesauthorizationrules,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespacesauthorizationrules.servicebus.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 "2021-11-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 +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/AuthorizationRules" +func (rule *NamespacesAuthorizationRule) GetType() string { + return "Microsoft.ServiceBus/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 &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: rule.Spec.Owner.Name, + } +} + +// 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-servicebus-azure-com-v1api20211101-namespacesauthorizationrule,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesauthorizationrules,verbs=create;update,versions=v1api20211101,name=validate.v1api20211101.namespacesauthorizationrules.servicebus.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.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.validateSecretDestinations() + }, + } +} + +// 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 *v20211101s.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 *v20211101s.NamespacesAuthorizationRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.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 v20211101s.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: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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: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"` + + // 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 servicebus.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"servicebus.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} + + // 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.(*v20211101s.Namespaces_AuthorizationRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.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.(*v20211101s.Namespaces_AuthorizationRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_AuthorizationRule_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.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 *v20211101s.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 *v20211101s.Namespaces_AuthorizationRule_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // 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() + + // 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.(*v20211101s.Namespaces_AuthorizationRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.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.(*v20211101s.Namespaces_AuthorizationRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.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 *v20211101s.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 *v20211101s.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 v20211101s.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 *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/servicebus/v1api20211101/namespaces_authorization_rule_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_types_gen_test.go new file mode 100644 index 00000000000..8bfd91ecdd7 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/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 v1api20211101 + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v1api20211101storage 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/servicebus/v1api20211101/namespaces_queue_spec_arm_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_queue_spec_arm_types_gen.go new file mode 100644 index 00000000000..18b232ea3c5 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_queue_spec_arm_types_gen.go @@ -0,0 +1,88 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_Queue_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: Queue Properties + Properties *SBQueueProperties_ARM `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespaces_Queue_Spec_ARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01" +func (queue Namespaces_Queue_Spec_ARM) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetName returns the Name of the resource +func (queue *Namespaces_Queue_Spec_ARM) GetName() string { + return queue.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/queues" +func (queue *Namespaces_Queue_Spec_ARM) GetType() string { + return "Microsoft.ServiceBus/namespaces/queues" +} + +// The Queue Properties definition. +type SBQueueProperties_ARM struct { + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // DeadLetteringOnMessageExpiration: A value that indicates whether this queue has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: A value that indicates whether Express Entities are enabled. An express queue holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: A value that indicates whether the queue is to be partitioned across multiple message brokers. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // LockDuration: ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for + // other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: The maximum delivery count. A message is automatically deadlettered after this number of deliveries. + // default value is 10. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the queue. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + + // RequiresDuplicateDetection: A value indicating if this queue requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // RequiresSession: A value that indicates whether the queue supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_queue_spec_arm_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_queue_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..3f43c77f78c --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_queue_spec_arm_types_gen_test.go @@ -0,0 +1,168 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +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_Queue_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_Queue_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Queue_Spec_ARM, Namespaces_Queue_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Queue_Spec_ARM runs a test to see if a specific instance of Namespaces_Queue_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Queue_Spec_ARM(subject Namespaces_Queue_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Queue_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_Queue_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_Queue_Spec_ARMGenerator() +var namespaces_Queue_Spec_ARMGenerator gopter.Gen + +// Namespaces_Queue_Spec_ARMGenerator returns a generator of Namespaces_Queue_Spec_ARM instances for property testing. +// We first initialize namespaces_Queue_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_Queue_Spec_ARMGenerator() gopter.Gen { + if namespaces_Queue_Spec_ARMGenerator != nil { + return namespaces_Queue_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec_ARM(generators) + namespaces_Queue_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Queue_Spec_ARM(generators) + namespaces_Queue_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_Spec_ARM{}), generators) + + return namespaces_Queue_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_Queue_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Queue_Spec_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBQueueProperties_ARMGenerator()) +} + +func Test_SBQueueProperties_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 SBQueueProperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBQueueProperties_ARM, SBQueueProperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBQueueProperties_ARM runs a test to see if a specific instance of SBQueueProperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBQueueProperties_ARM(subject SBQueueProperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBQueueProperties_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 SBQueueProperties_ARM instances for property testing - lazily instantiated by +// SBQueueProperties_ARMGenerator() +var sbQueueProperties_ARMGenerator gopter.Gen + +// SBQueueProperties_ARMGenerator returns a generator of SBQueueProperties_ARM instances for property testing. +func SBQueueProperties_ARMGenerator() gopter.Gen { + if sbQueueProperties_ARMGenerator != nil { + return sbQueueProperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBQueueProperties_ARM(generators) + sbQueueProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBQueueProperties_ARM{}), generators) + + return sbQueueProperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBQueueProperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBQueueProperties_ARM(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_queue_status_arm_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_queue_status_arm_types_gen.go new file mode 100644 index 00000000000..b30e510b52e --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_queue_status_arm_types_gen.go @@ -0,0 +1,122 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +type Namespaces_Queue_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: Queue Properties + Properties *SBQueueProperties_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"` +} + +// The Queue Properties definition. +type SBQueueProperties_STATUS_ARM struct { + // AccessedAt: Last time a message was sent, or the last time there was a receive request to this queue. + AccessedAt *string `json:"accessedAt,omitempty"` + + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // CountDetails: Message Count Details. + CountDetails *MessageCountDetails_STATUS_ARM `json:"countDetails,omitempty"` + + // CreatedAt: The exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DeadLetteringOnMessageExpiration: A value that indicates whether this queue has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: A value that indicates whether Express Entities are enabled. An express queue holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: A value that indicates whether the queue is to be partitioned across multiple message brokers. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // LockDuration: ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for + // other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: The maximum delivery count. A message is automatically deadlettered after this number of deliveries. + // default value is 10. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the queue. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + + // MessageCount: The number of messages in the queue. + MessageCount *int `json:"messageCount,omitempty"` + + // RequiresDuplicateDetection: A value indicating if this queue requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // RequiresSession: A value that indicates whether the queue supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` + + // SizeInBytes: The size of the queue, in bytes. + SizeInBytes *int `json:"sizeInBytes,omitempty"` + + // Status: Enumerates the possible values for the status of a messaging entity. + Status *EntityStatus_STATUS `json:"status,omitempty"` + + // UpdatedAt: The exact time the message was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +// Message Count Details. +type MessageCountDetails_STATUS_ARM struct { + // ActiveMessageCount: Number of active messages in the queue, topic, or subscription. + ActiveMessageCount *int `json:"activeMessageCount,omitempty"` + + // DeadLetterMessageCount: Number of messages that are dead lettered. + DeadLetterMessageCount *int `json:"deadLetterMessageCount,omitempty"` + + // ScheduledMessageCount: Number of scheduled messages. + ScheduledMessageCount *int `json:"scheduledMessageCount,omitempty"` + + // TransferDeadLetterMessageCount: Number of messages transferred into dead letters. + TransferDeadLetterMessageCount *int `json:"transferDeadLetterMessageCount,omitempty"` + + // TransferMessageCount: Number of messages transferred to another queue, topic, or subscription. + TransferMessageCount *int `json:"transferMessageCount,omitempty"` +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_queue_status_arm_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_queue_status_arm_types_gen_test.go new file mode 100644 index 00000000000..8650a2b03c5 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_queue_status_arm_types_gen_test.go @@ -0,0 +1,266 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +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_Queue_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_Queue_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Queue_STATUS_ARM, Namespaces_Queue_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Queue_STATUS_ARM runs a test to see if a specific instance of Namespaces_Queue_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Queue_STATUS_ARM(subject Namespaces_Queue_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Queue_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_Queue_STATUS_ARM instances for property testing - lazily instantiated by +// Namespaces_Queue_STATUS_ARMGenerator() +var namespaces_Queue_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Queue_STATUS_ARMGenerator returns a generator of Namespaces_Queue_STATUS_ARM instances for property testing. +// We first initialize namespaces_Queue_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_Queue_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Queue_STATUS_ARMGenerator != nil { + return namespaces_Queue_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS_ARM(generators) + namespaces_Queue_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS_ARM(generators) + namespaces_Queue_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_STATUS_ARM{}), generators) + + return namespaces_Queue_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Queue_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_Queue_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBQueueProperties_STATUS_ARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) +} + +func Test_SBQueueProperties_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 SBQueueProperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBQueueProperties_STATUS_ARM, SBQueueProperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBQueueProperties_STATUS_ARM runs a test to see if a specific instance of SBQueueProperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBQueueProperties_STATUS_ARM(subject SBQueueProperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBQueueProperties_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 SBQueueProperties_STATUS_ARM instances for property testing - lazily instantiated by +// SBQueueProperties_STATUS_ARMGenerator() +var sbQueueProperties_STATUS_ARMGenerator gopter.Gen + +// SBQueueProperties_STATUS_ARMGenerator returns a generator of SBQueueProperties_STATUS_ARM instances for property testing. +// We first initialize sbQueueProperties_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 SBQueueProperties_STATUS_ARMGenerator() gopter.Gen { + if sbQueueProperties_STATUS_ARMGenerator != nil { + return sbQueueProperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBQueueProperties_STATUS_ARM(generators) + sbQueueProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBQueueProperties_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBQueueProperties_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForSBQueueProperties_STATUS_ARM(generators) + sbQueueProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBQueueProperties_STATUS_ARM{}), generators) + + return sbQueueProperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBQueueProperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBQueueProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["MessageCount"] = gen.PtrOf(gen.Int()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) + gens["SizeInBytes"] = gen.PtrOf(gen.Int()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + EntityStatus_STATUS_Active, + EntityStatus_STATUS_Creating, + EntityStatus_STATUS_Deleting, + EntityStatus_STATUS_Disabled, + EntityStatus_STATUS_ReceiveDisabled, + EntityStatus_STATUS_Renaming, + EntityStatus_STATUS_Restoring, + EntityStatus_STATUS_SendDisabled, + EntityStatus_STATUS_Unknown)) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForSBQueueProperties_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBQueueProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUS_ARMGenerator()) +} + +func Test_MessageCountDetails_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 MessageCountDetails_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForMessageCountDetails_STATUS_ARM, MessageCountDetails_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForMessageCountDetails_STATUS_ARM runs a test to see if a specific instance of MessageCountDetails_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForMessageCountDetails_STATUS_ARM(subject MessageCountDetails_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual MessageCountDetails_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 MessageCountDetails_STATUS_ARM instances for property testing - lazily instantiated by +// MessageCountDetails_STATUS_ARMGenerator() +var messageCountDetails_STATUS_ARMGenerator gopter.Gen + +// MessageCountDetails_STATUS_ARMGenerator returns a generator of MessageCountDetails_STATUS_ARM instances for property testing. +func MessageCountDetails_STATUS_ARMGenerator() gopter.Gen { + if messageCountDetails_STATUS_ARMGenerator != nil { + return messageCountDetails_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS_ARM(generators) + messageCountDetails_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(MessageCountDetails_STATUS_ARM{}), generators) + + return messageCountDetails_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS_ARM(gens map[string]gopter.Gen) { + gens["ActiveMessageCount"] = gen.PtrOf(gen.Int()) + gens["DeadLetterMessageCount"] = gen.PtrOf(gen.Int()) + gens["ScheduledMessageCount"] = gen.PtrOf(gen.Int()) + gens["TransferDeadLetterMessageCount"] = gen.PtrOf(gen.Int()) + gens["TransferMessageCount"] = gen.PtrOf(gen.Int()) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen.go new file mode 100644 index 00000000000..409f153fa2a --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen.go @@ -0,0 +1,1807 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/Queue.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName} +type NamespacesQueue struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Queue_Spec `json:"spec,omitempty"` + Status Namespaces_Queue_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesQueue{} + +// GetConditions returns the conditions of the resource +func (queue *NamespacesQueue) GetConditions() conditions.Conditions { + return queue.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (queue *NamespacesQueue) SetConditions(conditions conditions.Conditions) { + queue.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesQueue{} + +// ConvertFrom populates our NamespacesQueue from the provided hub NamespacesQueue +func (queue *NamespacesQueue) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20211101s.NamespacesQueue) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesQueue but received %T instead", hub) + } + + return queue.AssignProperties_From_NamespacesQueue(source) +} + +// ConvertTo populates the provided hub NamespacesQueue from our NamespacesQueue +func (queue *NamespacesQueue) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20211101s.NamespacesQueue) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesQueue but received %T instead", hub) + } + + return queue.AssignProperties_To_NamespacesQueue(destination) +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20211101-namespacesqueue,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesqueues,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespacesqueues.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &NamespacesQueue{} + +// Default applies defaults to the NamespacesQueue resource +func (queue *NamespacesQueue) Default() { + queue.defaultImpl() + var temp any = queue + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (queue *NamespacesQueue) defaultAzureName() { + if queue.Spec.AzureName == "" { + queue.Spec.AzureName = queue.Name + } +} + +// defaultImpl applies the code generated defaults to the NamespacesQueue resource +func (queue *NamespacesQueue) defaultImpl() { queue.defaultAzureName() } + +var _ genruntime.ImportableResource = &NamespacesQueue{} + +// InitializeSpec initializes the spec for this resource from the given status +func (queue *NamespacesQueue) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespaces_Queue_STATUS); ok { + return queue.Spec.Initialize_From_Namespaces_Queue_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespaces_Queue_STATUS but received %T instead", status) +} + +var _ genruntime.KubernetesResource = &NamespacesQueue{} + +// AzureName returns the Azure name of the resource +func (queue *NamespacesQueue) AzureName() string { + return queue.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01" +func (queue NamespacesQueue) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (queue *NamespacesQueue) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (queue *NamespacesQueue) GetSpec() genruntime.ConvertibleSpec { + return &queue.Spec +} + +// GetStatus returns the status of this resource +func (queue *NamespacesQueue) GetStatus() genruntime.ConvertibleStatus { + return &queue.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/queues" +func (queue *NamespacesQueue) GetType() string { + return "Microsoft.ServiceBus/namespaces/queues" +} + +// NewEmptyStatus returns a new empty (blank) status +func (queue *NamespacesQueue) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Queue_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (queue *NamespacesQueue) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: queue.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (queue *NamespacesQueue) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Queue_STATUS); ok { + queue.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Queue_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + queue.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-servicebus-azure-com-v1api20211101-namespacesqueue,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesqueues,verbs=create;update,versions=v1api20211101,name=validate.v1api20211101.namespacesqueues.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &NamespacesQueue{} + +// ValidateCreate validates the creation of the resource +func (queue *NamespacesQueue) ValidateCreate() (admission.Warnings, error) { + validations := queue.createValidations() + var temp any = queue + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + return genruntime.ValidateCreate(validations) +} + +// ValidateDelete validates the deletion of the resource +func (queue *NamespacesQueue) ValidateDelete() (admission.Warnings, error) { + validations := queue.deleteValidations() + var temp any = queue + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + return genruntime.ValidateDelete(validations) +} + +// ValidateUpdate validates an update of the resource +func (queue *NamespacesQueue) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { + validations := queue.updateValidations() + var temp any = queue + 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 (queue *NamespacesQueue) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){queue.validateResourceReferences} +} + +// deleteValidations validates the deletion of the resource +func (queue *NamespacesQueue) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (queue *NamespacesQueue) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return queue.validateResourceReferences() + }, + queue.validateWriteOnceProperties} +} + +// validateResourceReferences validates all resource references +func (queue *NamespacesQueue) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&queue.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (queue *NamespacesQueue) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*NamespacesQueue) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, queue) +} + +// AssignProperties_From_NamespacesQueue populates our NamespacesQueue from the provided source NamespacesQueue +func (queue *NamespacesQueue) AssignProperties_From_NamespacesQueue(source *v20211101s.NamespacesQueue) error { + + // ObjectMeta + queue.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Queue_Spec + err := spec.AssignProperties_From_Namespaces_Queue_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Queue_Spec() to populate field Spec") + } + queue.Spec = spec + + // Status + var status Namespaces_Queue_STATUS + err = status.AssignProperties_From_Namespaces_Queue_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Queue_STATUS() to populate field Status") + } + queue.Status = status + + // No error + return nil +} + +// AssignProperties_To_NamespacesQueue populates the provided destination NamespacesQueue from our NamespacesQueue +func (queue *NamespacesQueue) AssignProperties_To_NamespacesQueue(destination *v20211101s.NamespacesQueue) error { + + // ObjectMeta + destination.ObjectMeta = *queue.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.Namespaces_Queue_Spec + err := queue.Spec.AssignProperties_To_Namespaces_Queue_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Queue_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20211101s.Namespaces_Queue_STATUS + err = queue.Status.AssignProperties_To_Namespaces_Queue_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Queue_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 (queue *NamespacesQueue) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: queue.Spec.OriginalVersion(), + Kind: "NamespacesQueue", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/Queue.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName} +type NamespacesQueueList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesQueue `json:"items"` +} + +type Namespaces_Queue_Spec struct { + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // +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"` + + // DeadLetteringOnMessageExpiration: A value that indicates whether this queue has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: A value that indicates whether Express Entities are enabled. An express queue holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: A value that indicates whether the queue is to be partitioned across multiple message brokers. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // LockDuration: ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for + // other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: The maximum delivery count. A message is automatically deadlettered after this number of deliveries. + // default value is 10. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the queue. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,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 servicebus.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"Namespace"` + + // RequiresDuplicateDetection: A value indicating if this queue requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // RequiresSession: A value that indicates whether the queue supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` +} + +var _ genruntime.ARMTransformer = &Namespaces_Queue_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (queue *Namespaces_Queue_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if queue == nil { + return nil, nil + } + result := &Namespaces_Queue_Spec_ARM{} + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if queue.AutoDeleteOnIdle != nil || + queue.DeadLetteringOnMessageExpiration != nil || + queue.DefaultMessageTimeToLive != nil || + queue.DuplicateDetectionHistoryTimeWindow != nil || + queue.EnableBatchedOperations != nil || + queue.EnableExpress != nil || + queue.EnablePartitioning != nil || + queue.ForwardDeadLetteredMessagesTo != nil || + queue.ForwardTo != nil || + queue.LockDuration != nil || + queue.MaxDeliveryCount != nil || + queue.MaxMessageSizeInKilobytes != nil || + queue.MaxSizeInMegabytes != nil || + queue.RequiresDuplicateDetection != nil || + queue.RequiresSession != nil { + result.Properties = &SBQueueProperties_ARM{} + } + if queue.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *queue.AutoDeleteOnIdle + result.Properties.AutoDeleteOnIdle = &autoDeleteOnIdle + } + if queue.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *queue.DeadLetteringOnMessageExpiration + result.Properties.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } + if queue.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *queue.DefaultMessageTimeToLive + result.Properties.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + if queue.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *queue.DuplicateDetectionHistoryTimeWindow + result.Properties.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + if queue.EnableBatchedOperations != nil { + enableBatchedOperations := *queue.EnableBatchedOperations + result.Properties.EnableBatchedOperations = &enableBatchedOperations + } + if queue.EnableExpress != nil { + enableExpress := *queue.EnableExpress + result.Properties.EnableExpress = &enableExpress + } + if queue.EnablePartitioning != nil { + enablePartitioning := *queue.EnablePartitioning + result.Properties.EnablePartitioning = &enablePartitioning + } + if queue.ForwardDeadLetteredMessagesTo != nil { + forwardDeadLetteredMessagesTo := *queue.ForwardDeadLetteredMessagesTo + result.Properties.ForwardDeadLetteredMessagesTo = &forwardDeadLetteredMessagesTo + } + if queue.ForwardTo != nil { + forwardTo := *queue.ForwardTo + result.Properties.ForwardTo = &forwardTo + } + if queue.LockDuration != nil { + lockDuration := *queue.LockDuration + result.Properties.LockDuration = &lockDuration + } + if queue.MaxDeliveryCount != nil { + maxDeliveryCount := *queue.MaxDeliveryCount + result.Properties.MaxDeliveryCount = &maxDeliveryCount + } + if queue.MaxMessageSizeInKilobytes != nil { + maxMessageSizeInKilobytes := *queue.MaxMessageSizeInKilobytes + result.Properties.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobytes + } + if queue.MaxSizeInMegabytes != nil { + maxSizeInMegabytes := *queue.MaxSizeInMegabytes + result.Properties.MaxSizeInMegabytes = &maxSizeInMegabytes + } + if queue.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *queue.RequiresDuplicateDetection + result.Properties.RequiresDuplicateDetection = &requiresDuplicateDetection + } + if queue.RequiresSession != nil { + requiresSession := *queue.RequiresSession + result.Properties.RequiresSession = &requiresSession + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (queue *Namespaces_Queue_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Queue_Spec_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (queue *Namespaces_Queue_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Queue_Spec_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Queue_Spec_ARM, got %T", armInput) + } + + // Set property "AutoDeleteOnIdle": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *typedInput.Properties.AutoDeleteOnIdle + queue.AutoDeleteOnIdle = &autoDeleteOnIdle + } + } + + // Set property "AzureName": + queue.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // Set property "DeadLetteringOnMessageExpiration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *typedInput.Properties.DeadLetteringOnMessageExpiration + queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } + } + + // Set property "DefaultMessageTimeToLive": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *typedInput.Properties.DefaultMessageTimeToLive + queue.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + } + + // Set property "DuplicateDetectionHistoryTimeWindow": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *typedInput.Properties.DuplicateDetectionHistoryTimeWindow + queue.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + } + + // Set property "EnableBatchedOperations": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableBatchedOperations != nil { + enableBatchedOperations := *typedInput.Properties.EnableBatchedOperations + queue.EnableBatchedOperations = &enableBatchedOperations + } + } + + // Set property "EnableExpress": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableExpress != nil { + enableExpress := *typedInput.Properties.EnableExpress + queue.EnableExpress = &enableExpress + } + } + + // Set property "EnablePartitioning": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnablePartitioning != nil { + enablePartitioning := *typedInput.Properties.EnablePartitioning + queue.EnablePartitioning = &enablePartitioning + } + } + + // Set property "ForwardDeadLetteredMessagesTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardDeadLetteredMessagesTo != nil { + forwardDeadLetteredMessagesTo := *typedInput.Properties.ForwardDeadLetteredMessagesTo + queue.ForwardDeadLetteredMessagesTo = &forwardDeadLetteredMessagesTo + } + } + + // Set property "ForwardTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardTo != nil { + forwardTo := *typedInput.Properties.ForwardTo + queue.ForwardTo = &forwardTo + } + } + + // Set property "LockDuration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.LockDuration != nil { + lockDuration := *typedInput.Properties.LockDuration + queue.LockDuration = &lockDuration + } + } + + // Set property "MaxDeliveryCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxDeliveryCount != nil { + maxDeliveryCount := *typedInput.Properties.MaxDeliveryCount + queue.MaxDeliveryCount = &maxDeliveryCount + } + } + + // Set property "MaxMessageSizeInKilobytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxMessageSizeInKilobytes != nil { + maxMessageSizeInKilobytes := *typedInput.Properties.MaxMessageSizeInKilobytes + queue.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobytes + } + } + + // Set property "MaxSizeInMegabytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxSizeInMegabytes != nil { + maxSizeInMegabytes := *typedInput.Properties.MaxSizeInMegabytes + queue.MaxSizeInMegabytes = &maxSizeInMegabytes + } + } + + // Set property "Owner": + queue.Owner = &genruntime.KnownResourceReference{Name: owner.Name} + + // Set property "RequiresDuplicateDetection": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *typedInput.Properties.RequiresDuplicateDetection + queue.RequiresDuplicateDetection = &requiresDuplicateDetection + } + } + + // Set property "RequiresSession": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresSession != nil { + requiresSession := *typedInput.Properties.RequiresSession + queue.RequiresSession = &requiresSession + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Queue_Spec{} + +// ConvertSpecFrom populates our Namespaces_Queue_Spec from the provided source +func (queue *Namespaces_Queue_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20211101s.Namespaces_Queue_Spec) + if ok { + // Populate our instance from source + return queue.AssignProperties_From_Namespaces_Queue_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Queue_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = queue.AssignProperties_From_Namespaces_Queue_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_Queue_Spec +func (queue *Namespaces_Queue_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20211101s.Namespaces_Queue_Spec) + if ok { + // Populate destination from our instance + return queue.AssignProperties_To_Namespaces_Queue_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Queue_Spec{} + err := queue.AssignProperties_To_Namespaces_Queue_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_Queue_Spec populates our Namespaces_Queue_Spec from the provided source Namespaces_Queue_Spec +func (queue *Namespaces_Queue_Spec) AssignProperties_From_Namespaces_Queue_Spec(source *v20211101s.Namespaces_Queue_Spec) error { + + // AutoDeleteOnIdle + queue.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // AzureName + queue.AzureName = source.AzureName + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + queue.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + queue.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + queue.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + queue.EnableBatchedOperations = &enableBatchedOperation + } else { + queue.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + queue.EnableExpress = &enableExpress + } else { + queue.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + queue.EnablePartitioning = &enablePartitioning + } else { + queue.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + queue.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + queue.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // LockDuration + queue.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + queue.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + queue.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + queue.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + queue.Owner = &owner + } else { + queue.Owner = nil + } + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + queue.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + queue.RequiresDuplicateDetection = nil + } + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + queue.RequiresSession = &requiresSession + } else { + queue.RequiresSession = nil + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Queue_Spec populates the provided destination Namespaces_Queue_Spec from our Namespaces_Queue_Spec +func (queue *Namespaces_Queue_Spec) AssignProperties_To_Namespaces_Queue_Spec(destination *v20211101s.Namespaces_Queue_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(queue.AutoDeleteOnIdle) + + // AzureName + destination.AzureName = queue.AzureName + + // DeadLetteringOnMessageExpiration + if queue.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *queue.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(queue.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(queue.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if queue.EnableBatchedOperations != nil { + enableBatchedOperation := *queue.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if queue.EnableExpress != nil { + enableExpress := *queue.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if queue.EnablePartitioning != nil { + enablePartitioning := *queue.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(queue.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(queue.ForwardTo) + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(queue.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(queue.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + destination.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(queue.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(queue.MaxSizeInMegabytes) + + // OriginalVersion + destination.OriginalVersion = queue.OriginalVersion() + + // Owner + if queue.Owner != nil { + owner := queue.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // RequiresDuplicateDetection + if queue.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *queue.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // RequiresSession + if queue.RequiresSession != nil { + requiresSession := *queue.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Namespaces_Queue_STATUS populates our Namespaces_Queue_Spec from the provided source Namespaces_Queue_STATUS +func (queue *Namespaces_Queue_Spec) Initialize_From_Namespaces_Queue_STATUS(source *Namespaces_Queue_STATUS) error { + + // AutoDeleteOnIdle + queue.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + queue.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + queue.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + queue.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + queue.EnableBatchedOperations = &enableBatchedOperation + } else { + queue.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + queue.EnableExpress = &enableExpress + } else { + queue.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + queue.EnablePartitioning = &enablePartitioning + } else { + queue.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + queue.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + queue.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // LockDuration + queue.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + queue.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + queue.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + queue.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + queue.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + queue.RequiresDuplicateDetection = nil + } + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + queue.RequiresSession = &requiresSession + } else { + queue.RequiresSession = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (queue *Namespaces_Queue_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (queue *Namespaces_Queue_Spec) SetAzureName(azureName string) { queue.AzureName = azureName } + +type Namespaces_Queue_STATUS struct { + // AccessedAt: Last time a message was sent, or the last time there was a receive request to this queue. + AccessedAt *string `json:"accessedAt,omitempty"` + + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // CountDetails: Message Count Details. + CountDetails *MessageCountDetails_STATUS `json:"countDetails,omitempty"` + + // CreatedAt: The exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DeadLetteringOnMessageExpiration: A value that indicates whether this queue has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: A value that indicates whether Express Entities are enabled. An express queue holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: A value that indicates whether the queue is to be partitioned across multiple message brokers. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,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"` + + // LockDuration: ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for + // other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: The maximum delivery count. A message is automatically deadlettered after this number of deliveries. + // default value is 10. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the queue. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + + // MessageCount: The number of messages in the queue. + MessageCount *int `json:"messageCount,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // RequiresDuplicateDetection: A value indicating if this queue requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // RequiresSession: A value that indicates whether the queue supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` + + // SizeInBytes: The size of the queue, in bytes. + SizeInBytes *int `json:"sizeInBytes,omitempty"` + + // Status: Enumerates the possible values for the status of a messaging entity. + Status *EntityStatus_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_Queue_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Queue_STATUS from the provided source +func (queue *Namespaces_Queue_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20211101s.Namespaces_Queue_STATUS) + if ok { + // Populate our instance from source + return queue.AssignProperties_From_Namespaces_Queue_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Queue_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = queue.AssignProperties_From_Namespaces_Queue_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_Queue_STATUS +func (queue *Namespaces_Queue_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20211101s.Namespaces_Queue_STATUS) + if ok { + // Populate destination from our instance + return queue.AssignProperties_To_Namespaces_Queue_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Queue_STATUS{} + err := queue.AssignProperties_To_Namespaces_Queue_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_Queue_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (queue *Namespaces_Queue_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Queue_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (queue *Namespaces_Queue_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Queue_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Queue_STATUS_ARM, got %T", armInput) + } + + // Set property "AccessedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AccessedAt != nil { + accessedAt := *typedInput.Properties.AccessedAt + queue.AccessedAt = &accessedAt + } + } + + // Set property "AutoDeleteOnIdle": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *typedInput.Properties.AutoDeleteOnIdle + queue.AutoDeleteOnIdle = &autoDeleteOnIdle + } + } + + // no assignment for property "Conditions" + + // Set property "CountDetails": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CountDetails != nil { + var countDetails1 MessageCountDetails_STATUS + err := countDetails1.PopulateFromARM(owner, *typedInput.Properties.CountDetails) + if err != nil { + return err + } + countDetails := countDetails1 + queue.CountDetails = &countDetails + } + } + + // Set property "CreatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CreatedAt != nil { + createdAt := *typedInput.Properties.CreatedAt + queue.CreatedAt = &createdAt + } + } + + // Set property "DeadLetteringOnMessageExpiration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *typedInput.Properties.DeadLetteringOnMessageExpiration + queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } + } + + // Set property "DefaultMessageTimeToLive": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *typedInput.Properties.DefaultMessageTimeToLive + queue.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + } + + // Set property "DuplicateDetectionHistoryTimeWindow": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *typedInput.Properties.DuplicateDetectionHistoryTimeWindow + queue.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + } + + // Set property "EnableBatchedOperations": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableBatchedOperations != nil { + enableBatchedOperations := *typedInput.Properties.EnableBatchedOperations + queue.EnableBatchedOperations = &enableBatchedOperations + } + } + + // Set property "EnableExpress": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableExpress != nil { + enableExpress := *typedInput.Properties.EnableExpress + queue.EnableExpress = &enableExpress + } + } + + // Set property "EnablePartitioning": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnablePartitioning != nil { + enablePartitioning := *typedInput.Properties.EnablePartitioning + queue.EnablePartitioning = &enablePartitioning + } + } + + // Set property "ForwardDeadLetteredMessagesTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardDeadLetteredMessagesTo != nil { + forwardDeadLetteredMessagesTo := *typedInput.Properties.ForwardDeadLetteredMessagesTo + queue.ForwardDeadLetteredMessagesTo = &forwardDeadLetteredMessagesTo + } + } + + // Set property "ForwardTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardTo != nil { + forwardTo := *typedInput.Properties.ForwardTo + queue.ForwardTo = &forwardTo + } + } + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + queue.Id = &id + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + queue.Location = &location + } + + // Set property "LockDuration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.LockDuration != nil { + lockDuration := *typedInput.Properties.LockDuration + queue.LockDuration = &lockDuration + } + } + + // Set property "MaxDeliveryCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxDeliveryCount != nil { + maxDeliveryCount := *typedInput.Properties.MaxDeliveryCount + queue.MaxDeliveryCount = &maxDeliveryCount + } + } + + // Set property "MaxMessageSizeInKilobytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxMessageSizeInKilobytes != nil { + maxMessageSizeInKilobytes := *typedInput.Properties.MaxMessageSizeInKilobytes + queue.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobytes + } + } + + // Set property "MaxSizeInMegabytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxSizeInMegabytes != nil { + maxSizeInMegabytes := *typedInput.Properties.MaxSizeInMegabytes + queue.MaxSizeInMegabytes = &maxSizeInMegabytes + } + } + + // Set property "MessageCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MessageCount != nil { + messageCount := *typedInput.Properties.MessageCount + queue.MessageCount = &messageCount + } + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + queue.Name = &name + } + + // Set property "RequiresDuplicateDetection": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *typedInput.Properties.RequiresDuplicateDetection + queue.RequiresDuplicateDetection = &requiresDuplicateDetection + } + } + + // Set property "RequiresSession": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresSession != nil { + requiresSession := *typedInput.Properties.RequiresSession + queue.RequiresSession = &requiresSession + } + } + + // Set property "SizeInBytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SizeInBytes != nil { + sizeInBytes := *typedInput.Properties.SizeInBytes + queue.SizeInBytes = &sizeInBytes + } + } + + // Set property "Status": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Status != nil { + status := *typedInput.Properties.Status + queue.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 + queue.SystemData = &systemData + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + queue.Type = &typeVar + } + + // Set property "UpdatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.UpdatedAt != nil { + updatedAt := *typedInput.Properties.UpdatedAt + queue.UpdatedAt = &updatedAt + } + } + + // No error + return nil +} + +// AssignProperties_From_Namespaces_Queue_STATUS populates our Namespaces_Queue_STATUS from the provided source Namespaces_Queue_STATUS +func (queue *Namespaces_Queue_STATUS) AssignProperties_From_Namespaces_Queue_STATUS(source *v20211101s.Namespaces_Queue_STATUS) error { + + // AccessedAt + queue.AccessedAt = genruntime.ClonePointerToString(source.AccessedAt) + + // AutoDeleteOnIdle + queue.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // Conditions + queue.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CountDetails + if source.CountDetails != nil { + var countDetail MessageCountDetails_STATUS + err := countDetail.AssignProperties_From_MessageCountDetails_STATUS(source.CountDetails) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_MessageCountDetails_STATUS() to populate field CountDetails") + } + queue.CountDetails = &countDetail + } else { + queue.CountDetails = nil + } + + // CreatedAt + queue.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + queue.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + queue.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + queue.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + queue.EnableBatchedOperations = &enableBatchedOperation + } else { + queue.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + queue.EnableExpress = &enableExpress + } else { + queue.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + queue.EnablePartitioning = &enablePartitioning + } else { + queue.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + queue.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + queue.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // Id + queue.Id = genruntime.ClonePointerToString(source.Id) + + // Location + queue.Location = genruntime.ClonePointerToString(source.Location) + + // LockDuration + queue.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + queue.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + queue.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + queue.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // MessageCount + queue.MessageCount = genruntime.ClonePointerToInt(source.MessageCount) + + // Name + queue.Name = genruntime.ClonePointerToString(source.Name) + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + queue.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + queue.RequiresDuplicateDetection = nil + } + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + queue.RequiresSession = &requiresSession + } else { + queue.RequiresSession = nil + } + + // SizeInBytes + queue.SizeInBytes = genruntime.ClonePointerToInt(source.SizeInBytes) + + // Status + if source.Status != nil { + status := EntityStatus_STATUS(*source.Status) + queue.Status = &status + } else { + queue.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") + } + queue.SystemData = &systemDatum + } else { + queue.SystemData = nil + } + + // Type + queue.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + queue.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Queue_STATUS populates the provided destination Namespaces_Queue_STATUS from our Namespaces_Queue_STATUS +func (queue *Namespaces_Queue_STATUS) AssignProperties_To_Namespaces_Queue_STATUS(destination *v20211101s.Namespaces_Queue_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AccessedAt + destination.AccessedAt = genruntime.ClonePointerToString(queue.AccessedAt) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(queue.AutoDeleteOnIdle) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(queue.Conditions) + + // CountDetails + if queue.CountDetails != nil { + var countDetail v20211101s.MessageCountDetails_STATUS + err := queue.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_MessageCountDetails_STATUS() to populate field CountDetails") + } + destination.CountDetails = &countDetail + } else { + destination.CountDetails = nil + } + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(queue.CreatedAt) + + // DeadLetteringOnMessageExpiration + if queue.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *queue.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(queue.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(queue.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if queue.EnableBatchedOperations != nil { + enableBatchedOperation := *queue.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if queue.EnableExpress != nil { + enableExpress := *queue.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if queue.EnablePartitioning != nil { + enablePartitioning := *queue.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(queue.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(queue.ForwardTo) + + // Id + destination.Id = genruntime.ClonePointerToString(queue.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(queue.Location) + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(queue.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(queue.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + destination.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(queue.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(queue.MaxSizeInMegabytes) + + // MessageCount + destination.MessageCount = genruntime.ClonePointerToInt(queue.MessageCount) + + // Name + destination.Name = genruntime.ClonePointerToString(queue.Name) + + // RequiresDuplicateDetection + if queue.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *queue.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // RequiresSession + if queue.RequiresSession != nil { + requiresSession := *queue.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // SizeInBytes + destination.SizeInBytes = genruntime.ClonePointerToInt(queue.SizeInBytes) + + // Status + if queue.Status != nil { + status := string(*queue.Status) + destination.Status = &status + } else { + destination.Status = nil + } + + // SystemData + if queue.SystemData != nil { + var systemDatum v20211101s.SystemData_STATUS + err := queue.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(queue.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(queue.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Entity status. +type EntityStatus_STATUS string + +const ( + EntityStatus_STATUS_Active = EntityStatus_STATUS("Active") + EntityStatus_STATUS_Creating = EntityStatus_STATUS("Creating") + EntityStatus_STATUS_Deleting = EntityStatus_STATUS("Deleting") + EntityStatus_STATUS_Disabled = EntityStatus_STATUS("Disabled") + EntityStatus_STATUS_ReceiveDisabled = EntityStatus_STATUS("ReceiveDisabled") + EntityStatus_STATUS_Renaming = EntityStatus_STATUS("Renaming") + EntityStatus_STATUS_Restoring = EntityStatus_STATUS("Restoring") + EntityStatus_STATUS_SendDisabled = EntityStatus_STATUS("SendDisabled") + EntityStatus_STATUS_Unknown = EntityStatus_STATUS("Unknown") +) + +// Message Count Details. +type MessageCountDetails_STATUS struct { + // ActiveMessageCount: Number of active messages in the queue, topic, or subscription. + ActiveMessageCount *int `json:"activeMessageCount,omitempty"` + + // DeadLetterMessageCount: Number of messages that are dead lettered. + DeadLetterMessageCount *int `json:"deadLetterMessageCount,omitempty"` + + // ScheduledMessageCount: Number of scheduled messages. + ScheduledMessageCount *int `json:"scheduledMessageCount,omitempty"` + + // TransferDeadLetterMessageCount: Number of messages transferred into dead letters. + TransferDeadLetterMessageCount *int `json:"transferDeadLetterMessageCount,omitempty"` + + // TransferMessageCount: Number of messages transferred to another queue, topic, or subscription. + TransferMessageCount *int `json:"transferMessageCount,omitempty"` +} + +var _ genruntime.FromARMConverter = &MessageCountDetails_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (details *MessageCountDetails_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &MessageCountDetails_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (details *MessageCountDetails_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(MessageCountDetails_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected MessageCountDetails_STATUS_ARM, got %T", armInput) + } + + // Set property "ActiveMessageCount": + if typedInput.ActiveMessageCount != nil { + activeMessageCount := *typedInput.ActiveMessageCount + details.ActiveMessageCount = &activeMessageCount + } + + // Set property "DeadLetterMessageCount": + if typedInput.DeadLetterMessageCount != nil { + deadLetterMessageCount := *typedInput.DeadLetterMessageCount + details.DeadLetterMessageCount = &deadLetterMessageCount + } + + // Set property "ScheduledMessageCount": + if typedInput.ScheduledMessageCount != nil { + scheduledMessageCount := *typedInput.ScheduledMessageCount + details.ScheduledMessageCount = &scheduledMessageCount + } + + // Set property "TransferDeadLetterMessageCount": + if typedInput.TransferDeadLetterMessageCount != nil { + transferDeadLetterMessageCount := *typedInput.TransferDeadLetterMessageCount + details.TransferDeadLetterMessageCount = &transferDeadLetterMessageCount + } + + // Set property "TransferMessageCount": + if typedInput.TransferMessageCount != nil { + transferMessageCount := *typedInput.TransferMessageCount + details.TransferMessageCount = &transferMessageCount + } + + // No error + return nil +} + +// AssignProperties_From_MessageCountDetails_STATUS populates our MessageCountDetails_STATUS from the provided source MessageCountDetails_STATUS +func (details *MessageCountDetails_STATUS) AssignProperties_From_MessageCountDetails_STATUS(source *v20211101s.MessageCountDetails_STATUS) error { + + // ActiveMessageCount + details.ActiveMessageCount = genruntime.ClonePointerToInt(source.ActiveMessageCount) + + // DeadLetterMessageCount + details.DeadLetterMessageCount = genruntime.ClonePointerToInt(source.DeadLetterMessageCount) + + // ScheduledMessageCount + details.ScheduledMessageCount = genruntime.ClonePointerToInt(source.ScheduledMessageCount) + + // TransferDeadLetterMessageCount + details.TransferDeadLetterMessageCount = genruntime.ClonePointerToInt(source.TransferDeadLetterMessageCount) + + // TransferMessageCount + details.TransferMessageCount = genruntime.ClonePointerToInt(source.TransferMessageCount) + + // No error + return nil +} + +// AssignProperties_To_MessageCountDetails_STATUS populates the provided destination MessageCountDetails_STATUS from our MessageCountDetails_STATUS +func (details *MessageCountDetails_STATUS) AssignProperties_To_MessageCountDetails_STATUS(destination *v20211101s.MessageCountDetails_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ActiveMessageCount + destination.ActiveMessageCount = genruntime.ClonePointerToInt(details.ActiveMessageCount) + + // DeadLetterMessageCount + destination.DeadLetterMessageCount = genruntime.ClonePointerToInt(details.DeadLetterMessageCount) + + // ScheduledMessageCount + destination.ScheduledMessageCount = genruntime.ClonePointerToInt(details.ScheduledMessageCount) + + // TransferDeadLetterMessageCount + destination.TransferDeadLetterMessageCount = genruntime.ClonePointerToInt(details.TransferDeadLetterMessageCount) + + // TransferMessageCount + destination.TransferMessageCount = genruntime.ClonePointerToInt(details.TransferMessageCount) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&NamespacesQueue{}, &NamespacesQueueList{}) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen_test.go new file mode 100644 index 00000000000..0d0f0f3e79f --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen_test.go @@ -0,0 +1,541 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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_NamespacesQueue_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 NamespacesQueue to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesQueue, NamespacesQueueGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesQueue tests if a specific instance of NamespacesQueue round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesQueue(subject NamespacesQueue) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesQueue + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesQueue + 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_NamespacesQueue_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesQueue to NamespacesQueue via AssignProperties_To_NamespacesQueue & AssignProperties_From_NamespacesQueue returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesQueue, NamespacesQueueGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesQueue tests if a specific instance of NamespacesQueue can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespacesQueue(subject NamespacesQueue) 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.NamespacesQueue + err := copied.AssignProperties_To_NamespacesQueue(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesQueue + err = actual.AssignProperties_From_NamespacesQueue(&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_NamespacesQueue_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 NamespacesQueue via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesQueue, NamespacesQueueGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesQueue runs a test to see if a specific instance of NamespacesQueue round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesQueue(subject NamespacesQueue) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesQueue + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesQueue instances for property testing - lazily instantiated by NamespacesQueueGenerator() +var namespacesQueueGenerator gopter.Gen + +// NamespacesQueueGenerator returns a generator of NamespacesQueue instances for property testing. +func NamespacesQueueGenerator() gopter.Gen { + if namespacesQueueGenerator != nil { + return namespacesQueueGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesQueue(generators) + namespacesQueueGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue{}), generators) + + return namespacesQueueGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesQueue is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesQueue(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Queue_SpecGenerator() + gens["Status"] = Namespaces_Queue_STATUSGenerator() +} + +func Test_Namespaces_Queue_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Queue_Spec to Namespaces_Queue_Spec via AssignProperties_To_Namespaces_Queue_Spec & AssignProperties_From_Namespaces_Queue_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Queue_Spec, Namespaces_Queue_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Queue_Spec tests if a specific instance of Namespaces_Queue_Spec can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Queue_Spec(subject Namespaces_Queue_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 v20211101s.Namespaces_Queue_Spec + err := copied.AssignProperties_To_Namespaces_Queue_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Queue_Spec + err = actual.AssignProperties_From_Namespaces_Queue_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_Queue_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_Queue_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Queue_Spec, Namespaces_Queue_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Queue_Spec runs a test to see if a specific instance of Namespaces_Queue_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Queue_Spec(subject Namespaces_Queue_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Queue_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_Queue_Spec instances for property testing - lazily instantiated by +// Namespaces_Queue_SpecGenerator() +var namespaces_Queue_SpecGenerator gopter.Gen + +// Namespaces_Queue_SpecGenerator returns a generator of Namespaces_Queue_Spec instances for property testing. +func Namespaces_Queue_SpecGenerator() gopter.Gen { + if namespaces_Queue_SpecGenerator != nil { + return namespaces_Queue_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec(generators) + namespaces_Queue_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_Spec{}), generators) + + return namespaces_Queue_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) +} + +func Test_Namespaces_Queue_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Queue_STATUS to Namespaces_Queue_STATUS via AssignProperties_To_Namespaces_Queue_STATUS & AssignProperties_From_Namespaces_Queue_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Queue_STATUS, Namespaces_Queue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Queue_STATUS tests if a specific instance of Namespaces_Queue_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Queue_STATUS(subject Namespaces_Queue_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 v20211101s.Namespaces_Queue_STATUS + err := copied.AssignProperties_To_Namespaces_Queue_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Queue_STATUS + err = actual.AssignProperties_From_Namespaces_Queue_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_Queue_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_Queue_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Queue_STATUS, Namespaces_Queue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Queue_STATUS runs a test to see if a specific instance of Namespaces_Queue_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Queue_STATUS(subject Namespaces_Queue_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Queue_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_Queue_STATUS instances for property testing - lazily instantiated by +// Namespaces_Queue_STATUSGenerator() +var namespaces_Queue_STATUSGenerator gopter.Gen + +// Namespaces_Queue_STATUSGenerator returns a generator of Namespaces_Queue_STATUS instances for property testing. +// We first initialize namespaces_Queue_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_Queue_STATUSGenerator() gopter.Gen { + if namespaces_Queue_STATUSGenerator != nil { + return namespaces_Queue_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS(generators) + namespaces_Queue_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS(generators) + namespaces_Queue_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_STATUS{}), generators) + + return namespaces_Queue_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["MessageCount"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) + gens["SizeInBytes"] = gen.PtrOf(gen.Int()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + EntityStatus_STATUS_Active, + EntityStatus_STATUS_Creating, + EntityStatus_STATUS_Deleting, + EntityStatus_STATUS_Disabled, + EntityStatus_STATUS_ReceiveDisabled, + EntityStatus_STATUS_Renaming, + EntityStatus_STATUS_Restoring, + EntityStatus_STATUS_SendDisabled, + EntityStatus_STATUS_Unknown)) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_MessageCountDetails_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from MessageCountDetails_STATUS to MessageCountDetails_STATUS via AssignProperties_To_MessageCountDetails_STATUS & AssignProperties_From_MessageCountDetails_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForMessageCountDetails_STATUS, MessageCountDetails_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForMessageCountDetails_STATUS tests if a specific instance of MessageCountDetails_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForMessageCountDetails_STATUS(subject MessageCountDetails_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 v20211101s.MessageCountDetails_STATUS + err := copied.AssignProperties_To_MessageCountDetails_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual MessageCountDetails_STATUS + err = actual.AssignProperties_From_MessageCountDetails_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_MessageCountDetails_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 MessageCountDetails_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForMessageCountDetails_STATUS, MessageCountDetails_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForMessageCountDetails_STATUS runs a test to see if a specific instance of MessageCountDetails_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForMessageCountDetails_STATUS(subject MessageCountDetails_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual MessageCountDetails_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 MessageCountDetails_STATUS instances for property testing - lazily instantiated by +// MessageCountDetails_STATUSGenerator() +var messageCountDetails_STATUSGenerator gopter.Gen + +// MessageCountDetails_STATUSGenerator returns a generator of MessageCountDetails_STATUS instances for property testing. +func MessageCountDetails_STATUSGenerator() gopter.Gen { + if messageCountDetails_STATUSGenerator != nil { + return messageCountDetails_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS(generators) + messageCountDetails_STATUSGenerator = gen.Struct(reflect.TypeOf(MessageCountDetails_STATUS{}), generators) + + return messageCountDetails_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS(gens map[string]gopter.Gen) { + gens["ActiveMessageCount"] = gen.PtrOf(gen.Int()) + gens["DeadLetterMessageCount"] = gen.PtrOf(gen.Int()) + gens["ScheduledMessageCount"] = gen.PtrOf(gen.Int()) + gens["TransferDeadLetterMessageCount"] = gen.PtrOf(gen.Int()) + gens["TransferMessageCount"] = gen.PtrOf(gen.Int()) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topic_spec_arm_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topic_spec_arm_types_gen.go new file mode 100644 index 00000000000..693846947c7 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topic_spec_arm_types_gen.go @@ -0,0 +1,70 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_Topic_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: Properties of topic resource. + Properties *SBTopicProperties_ARM `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespaces_Topic_Spec_ARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01" +func (topic Namespaces_Topic_Spec_ARM) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetName returns the Name of the resource +func (topic *Namespaces_Topic_Spec_ARM) GetName() string { + return topic.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics" +func (topic *Namespaces_Topic_Spec_ARM) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics" +} + +// The Topic Properties definition. +type SBTopicProperties_ARM struct { + // AutoDeleteOnIdle: ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO8601 timespan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: Value that indicates whether Express Entities are enabled. An express topic holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: Value that indicates whether the topic to be partitioned across multiple message brokers is enabled. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the topic. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + + // RequiresDuplicateDetection: Value indicating if this topic requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // SupportOrdering: Value that indicates whether the topic supports ordering. + SupportOrdering *bool `json:"supportOrdering,omitempty"` +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topic_spec_arm_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_topic_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..6711914274a --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topic_spec_arm_types_gen_test.go @@ -0,0 +1,163 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +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_Topic_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_Topic_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topic_Spec_ARM, Namespaces_Topic_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topic_Spec_ARM runs a test to see if a specific instance of Namespaces_Topic_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topic_Spec_ARM(subject Namespaces_Topic_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topic_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_Topic_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_Topic_Spec_ARMGenerator() +var namespaces_Topic_Spec_ARMGenerator gopter.Gen + +// Namespaces_Topic_Spec_ARMGenerator returns a generator of Namespaces_Topic_Spec_ARM instances for property testing. +// We first initialize namespaces_Topic_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_Topic_Spec_ARMGenerator() gopter.Gen { + if namespaces_Topic_Spec_ARMGenerator != nil { + return namespaces_Topic_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec_ARM(generators) + namespaces_Topic_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topic_Spec_ARM(generators) + namespaces_Topic_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_Spec_ARM{}), generators) + + return namespaces_Topic_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topic_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topic_Spec_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBTopicProperties_ARMGenerator()) +} + +func Test_SBTopicProperties_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 SBTopicProperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBTopicProperties_ARM, SBTopicProperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBTopicProperties_ARM runs a test to see if a specific instance of SBTopicProperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBTopicProperties_ARM(subject SBTopicProperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBTopicProperties_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 SBTopicProperties_ARM instances for property testing - lazily instantiated by +// SBTopicProperties_ARMGenerator() +var sbTopicProperties_ARMGenerator gopter.Gen + +// SBTopicProperties_ARMGenerator returns a generator of SBTopicProperties_ARM instances for property testing. +func SBTopicProperties_ARMGenerator() gopter.Gen { + if sbTopicProperties_ARMGenerator != nil { + return sbTopicProperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBTopicProperties_ARM(generators) + sbTopicProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBTopicProperties_ARM{}), generators) + + return sbTopicProperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBTopicProperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBTopicProperties_ARM(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["SupportOrdering"] = gen.PtrOf(gen.Bool()) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topic_status_arm_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topic_status_arm_types_gen.go new file mode 100644 index 00000000000..ef5a9326e91 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topic_status_arm_types_gen.go @@ -0,0 +1,86 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +type Namespaces_Topic_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 of topic resource. + Properties *SBTopicProperties_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"` +} + +// The Topic Properties definition. +type SBTopicProperties_STATUS_ARM struct { + // AccessedAt: Last time the message was sent, or a request was received, for this topic. + AccessedAt *string `json:"accessedAt,omitempty"` + + // AutoDeleteOnIdle: ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // CountDetails: Message count details + CountDetails *MessageCountDetails_STATUS_ARM `json:"countDetails,omitempty"` + + // CreatedAt: Exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO8601 timespan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: Value that indicates whether Express Entities are enabled. An express topic holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: Value that indicates whether the topic to be partitioned across multiple message brokers is enabled. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the topic. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + + // RequiresDuplicateDetection: Value indicating if this topic requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // SizeInBytes: Size of the topic, in bytes. + SizeInBytes *int `json:"sizeInBytes,omitempty"` + + // Status: Enumerates the possible values for the status of a messaging entity. + Status *EntityStatus_STATUS `json:"status,omitempty"` + + // SubscriptionCount: Number of subscriptions. + SubscriptionCount *int `json:"subscriptionCount,omitempty"` + + // SupportOrdering: Value that indicates whether the topic supports ordering. + SupportOrdering *bool `json:"supportOrdering,omitempty"` + + // UpdatedAt: The exact time the message was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topic_status_arm_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_topic_status_arm_types_gen_test.go new file mode 100644 index 00000000000..575d5a022e0 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topic_status_arm_types_gen_test.go @@ -0,0 +1,196 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +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_Topic_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_Topic_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topic_STATUS_ARM, Namespaces_Topic_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topic_STATUS_ARM runs a test to see if a specific instance of Namespaces_Topic_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topic_STATUS_ARM(subject Namespaces_Topic_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topic_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_Topic_STATUS_ARM instances for property testing - lazily instantiated by +// Namespaces_Topic_STATUS_ARMGenerator() +var namespaces_Topic_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Topic_STATUS_ARMGenerator returns a generator of Namespaces_Topic_STATUS_ARM instances for property testing. +// We first initialize namespaces_Topic_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_Topic_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Topic_STATUS_ARMGenerator != nil { + return namespaces_Topic_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS_ARM(generators) + namespaces_Topic_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS_ARM(generators) + namespaces_Topic_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_STATUS_ARM{}), generators) + + return namespaces_Topic_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topic_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_Topic_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBTopicProperties_STATUS_ARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) +} + +func Test_SBTopicProperties_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 SBTopicProperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBTopicProperties_STATUS_ARM, SBTopicProperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBTopicProperties_STATUS_ARM runs a test to see if a specific instance of SBTopicProperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBTopicProperties_STATUS_ARM(subject SBTopicProperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBTopicProperties_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 SBTopicProperties_STATUS_ARM instances for property testing - lazily instantiated by +// SBTopicProperties_STATUS_ARMGenerator() +var sbTopicProperties_STATUS_ARMGenerator gopter.Gen + +// SBTopicProperties_STATUS_ARMGenerator returns a generator of SBTopicProperties_STATUS_ARM instances for property testing. +// We first initialize sbTopicProperties_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 SBTopicProperties_STATUS_ARMGenerator() gopter.Gen { + if sbTopicProperties_STATUS_ARMGenerator != nil { + return sbTopicProperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBTopicProperties_STATUS_ARM(generators) + sbTopicProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBTopicProperties_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBTopicProperties_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForSBTopicProperties_STATUS_ARM(generators) + sbTopicProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBTopicProperties_STATUS_ARM{}), generators) + + return sbTopicProperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBTopicProperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBTopicProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["SizeInBytes"] = gen.PtrOf(gen.Int()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + EntityStatus_STATUS_Active, + EntityStatus_STATUS_Creating, + EntityStatus_STATUS_Deleting, + EntityStatus_STATUS_Disabled, + EntityStatus_STATUS_ReceiveDisabled, + EntityStatus_STATUS_Renaming, + EntityStatus_STATUS_Restoring, + EntityStatus_STATUS_SendDisabled, + EntityStatus_STATUS_Unknown)) + gens["SubscriptionCount"] = gen.PtrOf(gen.Int()) + gens["SupportOrdering"] = gen.PtrOf(gen.Bool()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForSBTopicProperties_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBTopicProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUS_ARMGenerator()) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen.go new file mode 100644 index 00000000000..cf26e0e0106 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen.go @@ -0,0 +1,1422 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/topics.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName} +type NamespacesTopic struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Topic_Spec `json:"spec,omitempty"` + Status Namespaces_Topic_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesTopic{} + +// GetConditions returns the conditions of the resource +func (topic *NamespacesTopic) GetConditions() conditions.Conditions { + return topic.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (topic *NamespacesTopic) SetConditions(conditions conditions.Conditions) { + topic.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesTopic{} + +// ConvertFrom populates our NamespacesTopic from the provided hub NamespacesTopic +func (topic *NamespacesTopic) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20211101s.NamespacesTopic) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopic but received %T instead", hub) + } + + return topic.AssignProperties_From_NamespacesTopic(source) +} + +// ConvertTo populates the provided hub NamespacesTopic from our NamespacesTopic +func (topic *NamespacesTopic) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20211101s.NamespacesTopic) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopic but received %T instead", hub) + } + + return topic.AssignProperties_To_NamespacesTopic(destination) +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20211101-namespacestopic,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopics,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespacestopics.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &NamespacesTopic{} + +// Default applies defaults to the NamespacesTopic resource +func (topic *NamespacesTopic) Default() { + topic.defaultImpl() + var temp any = topic + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (topic *NamespacesTopic) defaultAzureName() { + if topic.Spec.AzureName == "" { + topic.Spec.AzureName = topic.Name + } +} + +// defaultImpl applies the code generated defaults to the NamespacesTopic resource +func (topic *NamespacesTopic) defaultImpl() { topic.defaultAzureName() } + +var _ genruntime.ImportableResource = &NamespacesTopic{} + +// InitializeSpec initializes the spec for this resource from the given status +func (topic *NamespacesTopic) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespaces_Topic_STATUS); ok { + return topic.Spec.Initialize_From_Namespaces_Topic_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespaces_Topic_STATUS but received %T instead", status) +} + +var _ genruntime.KubernetesResource = &NamespacesTopic{} + +// AzureName returns the Azure name of the resource +func (topic *NamespacesTopic) AzureName() string { + return topic.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01" +func (topic NamespacesTopic) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (topic *NamespacesTopic) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (topic *NamespacesTopic) GetSpec() genruntime.ConvertibleSpec { + return &topic.Spec +} + +// GetStatus returns the status of this resource +func (topic *NamespacesTopic) GetStatus() genruntime.ConvertibleStatus { + return &topic.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics" +func (topic *NamespacesTopic) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics" +} + +// NewEmptyStatus returns a new empty (blank) status +func (topic *NamespacesTopic) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Topic_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (topic *NamespacesTopic) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: topic.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (topic *NamespacesTopic) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Topic_STATUS); ok { + topic.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Topic_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + topic.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-servicebus-azure-com-v1api20211101-namespacestopic,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopics,verbs=create;update,versions=v1api20211101,name=validate.v1api20211101.namespacestopics.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &NamespacesTopic{} + +// ValidateCreate validates the creation of the resource +func (topic *NamespacesTopic) ValidateCreate() (admission.Warnings, error) { + validations := topic.createValidations() + var temp any = topic + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + return genruntime.ValidateCreate(validations) +} + +// ValidateDelete validates the deletion of the resource +func (topic *NamespacesTopic) ValidateDelete() (admission.Warnings, error) { + validations := topic.deleteValidations() + var temp any = topic + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + return genruntime.ValidateDelete(validations) +} + +// ValidateUpdate validates an update of the resource +func (topic *NamespacesTopic) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { + validations := topic.updateValidations() + var temp any = topic + 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 (topic *NamespacesTopic) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){topic.validateResourceReferences} +} + +// deleteValidations validates the deletion of the resource +func (topic *NamespacesTopic) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (topic *NamespacesTopic) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return topic.validateResourceReferences() + }, + topic.validateWriteOnceProperties} +} + +// validateResourceReferences validates all resource references +func (topic *NamespacesTopic) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&topic.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (topic *NamespacesTopic) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*NamespacesTopic) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, topic) +} + +// AssignProperties_From_NamespacesTopic populates our NamespacesTopic from the provided source NamespacesTopic +func (topic *NamespacesTopic) AssignProperties_From_NamespacesTopic(source *v20211101s.NamespacesTopic) error { + + // ObjectMeta + topic.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Topic_Spec + err := spec.AssignProperties_From_Namespaces_Topic_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topic_Spec() to populate field Spec") + } + topic.Spec = spec + + // Status + var status Namespaces_Topic_STATUS + err = status.AssignProperties_From_Namespaces_Topic_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topic_STATUS() to populate field Status") + } + topic.Status = status + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopic populates the provided destination NamespacesTopic from our NamespacesTopic +func (topic *NamespacesTopic) AssignProperties_To_NamespacesTopic(destination *v20211101s.NamespacesTopic) error { + + // ObjectMeta + destination.ObjectMeta = *topic.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.Namespaces_Topic_Spec + err := topic.Spec.AssignProperties_To_Namespaces_Topic_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topic_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20211101s.Namespaces_Topic_STATUS + err = topic.Status.AssignProperties_To_Namespaces_Topic_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topic_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 (topic *NamespacesTopic) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: topic.Spec.OriginalVersion(), + Kind: "NamespacesTopic", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/topics.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName} +type NamespacesTopicList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesTopic `json:"items"` +} + +type Namespaces_Topic_Spec struct { + // AutoDeleteOnIdle: ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // +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"` + + // DefaultMessageTimeToLive: ISO 8601 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO8601 timespan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: Value that indicates whether Express Entities are enabled. An express topic holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: Value that indicates whether the topic to be partitioned across multiple message brokers is enabled. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the topic. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,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 servicebus.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"Namespace"` + + // RequiresDuplicateDetection: Value indicating if this topic requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // SupportOrdering: Value that indicates whether the topic supports ordering. + SupportOrdering *bool `json:"supportOrdering,omitempty"` +} + +var _ genruntime.ARMTransformer = &Namespaces_Topic_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (topic *Namespaces_Topic_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if topic == nil { + return nil, nil + } + result := &Namespaces_Topic_Spec_ARM{} + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if topic.AutoDeleteOnIdle != nil || + topic.DefaultMessageTimeToLive != nil || + topic.DuplicateDetectionHistoryTimeWindow != nil || + topic.EnableBatchedOperations != nil || + topic.EnableExpress != nil || + topic.EnablePartitioning != nil || + topic.MaxMessageSizeInKilobytes != nil || + topic.MaxSizeInMegabytes != nil || + topic.RequiresDuplicateDetection != nil || + topic.SupportOrdering != nil { + result.Properties = &SBTopicProperties_ARM{} + } + if topic.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *topic.AutoDeleteOnIdle + result.Properties.AutoDeleteOnIdle = &autoDeleteOnIdle + } + if topic.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *topic.DefaultMessageTimeToLive + result.Properties.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + if topic.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *topic.DuplicateDetectionHistoryTimeWindow + result.Properties.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + if topic.EnableBatchedOperations != nil { + enableBatchedOperations := *topic.EnableBatchedOperations + result.Properties.EnableBatchedOperations = &enableBatchedOperations + } + if topic.EnableExpress != nil { + enableExpress := *topic.EnableExpress + result.Properties.EnableExpress = &enableExpress + } + if topic.EnablePartitioning != nil { + enablePartitioning := *topic.EnablePartitioning + result.Properties.EnablePartitioning = &enablePartitioning + } + if topic.MaxMessageSizeInKilobytes != nil { + maxMessageSizeInKilobytes := *topic.MaxMessageSizeInKilobytes + result.Properties.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobytes + } + if topic.MaxSizeInMegabytes != nil { + maxSizeInMegabytes := *topic.MaxSizeInMegabytes + result.Properties.MaxSizeInMegabytes = &maxSizeInMegabytes + } + if topic.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *topic.RequiresDuplicateDetection + result.Properties.RequiresDuplicateDetection = &requiresDuplicateDetection + } + if topic.SupportOrdering != nil { + supportOrdering := *topic.SupportOrdering + result.Properties.SupportOrdering = &supportOrdering + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (topic *Namespaces_Topic_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Topic_Spec_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (topic *Namespaces_Topic_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Topic_Spec_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Topic_Spec_ARM, got %T", armInput) + } + + // Set property "AutoDeleteOnIdle": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *typedInput.Properties.AutoDeleteOnIdle + topic.AutoDeleteOnIdle = &autoDeleteOnIdle + } + } + + // Set property "AzureName": + topic.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // Set property "DefaultMessageTimeToLive": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *typedInput.Properties.DefaultMessageTimeToLive + topic.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + } + + // Set property "DuplicateDetectionHistoryTimeWindow": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *typedInput.Properties.DuplicateDetectionHistoryTimeWindow + topic.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + } + + // Set property "EnableBatchedOperations": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableBatchedOperations != nil { + enableBatchedOperations := *typedInput.Properties.EnableBatchedOperations + topic.EnableBatchedOperations = &enableBatchedOperations + } + } + + // Set property "EnableExpress": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableExpress != nil { + enableExpress := *typedInput.Properties.EnableExpress + topic.EnableExpress = &enableExpress + } + } + + // Set property "EnablePartitioning": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnablePartitioning != nil { + enablePartitioning := *typedInput.Properties.EnablePartitioning + topic.EnablePartitioning = &enablePartitioning + } + } + + // Set property "MaxMessageSizeInKilobytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxMessageSizeInKilobytes != nil { + maxMessageSizeInKilobytes := *typedInput.Properties.MaxMessageSizeInKilobytes + topic.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobytes + } + } + + // Set property "MaxSizeInMegabytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxSizeInMegabytes != nil { + maxSizeInMegabytes := *typedInput.Properties.MaxSizeInMegabytes + topic.MaxSizeInMegabytes = &maxSizeInMegabytes + } + } + + // Set property "Owner": + topic.Owner = &genruntime.KnownResourceReference{Name: owner.Name} + + // Set property "RequiresDuplicateDetection": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *typedInput.Properties.RequiresDuplicateDetection + topic.RequiresDuplicateDetection = &requiresDuplicateDetection + } + } + + // Set property "SupportOrdering": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SupportOrdering != nil { + supportOrdering := *typedInput.Properties.SupportOrdering + topic.SupportOrdering = &supportOrdering + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Topic_Spec{} + +// ConvertSpecFrom populates our Namespaces_Topic_Spec from the provided source +func (topic *Namespaces_Topic_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20211101s.Namespaces_Topic_Spec) + if ok { + // Populate our instance from source + return topic.AssignProperties_From_Namespaces_Topic_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topic_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = topic.AssignProperties_From_Namespaces_Topic_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_Topic_Spec +func (topic *Namespaces_Topic_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20211101s.Namespaces_Topic_Spec) + if ok { + // Populate destination from our instance + return topic.AssignProperties_To_Namespaces_Topic_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topic_Spec{} + err := topic.AssignProperties_To_Namespaces_Topic_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_Topic_Spec populates our Namespaces_Topic_Spec from the provided source Namespaces_Topic_Spec +func (topic *Namespaces_Topic_Spec) AssignProperties_From_Namespaces_Topic_Spec(source *v20211101s.Namespaces_Topic_Spec) error { + + // AutoDeleteOnIdle + topic.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // AzureName + topic.AzureName = source.AzureName + + // DefaultMessageTimeToLive + topic.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + topic.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + topic.EnableBatchedOperations = &enableBatchedOperation + } else { + topic.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + topic.EnableExpress = &enableExpress + } else { + topic.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + topic.EnablePartitioning = &enablePartitioning + } else { + topic.EnablePartitioning = nil + } + + // MaxMessageSizeInKilobytes + topic.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + topic.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + topic.Owner = &owner + } else { + topic.Owner = nil + } + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + topic.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + topic.RequiresDuplicateDetection = nil + } + + // SupportOrdering + if source.SupportOrdering != nil { + supportOrdering := *source.SupportOrdering + topic.SupportOrdering = &supportOrdering + } else { + topic.SupportOrdering = nil + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topic_Spec populates the provided destination Namespaces_Topic_Spec from our Namespaces_Topic_Spec +func (topic *Namespaces_Topic_Spec) AssignProperties_To_Namespaces_Topic_Spec(destination *v20211101s.Namespaces_Topic_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(topic.AutoDeleteOnIdle) + + // AzureName + destination.AzureName = topic.AzureName + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(topic.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(topic.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if topic.EnableBatchedOperations != nil { + enableBatchedOperation := *topic.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if topic.EnableExpress != nil { + enableExpress := *topic.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if topic.EnablePartitioning != nil { + enablePartitioning := *topic.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // MaxMessageSizeInKilobytes + destination.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(topic.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(topic.MaxSizeInMegabytes) + + // OriginalVersion + destination.OriginalVersion = topic.OriginalVersion() + + // Owner + if topic.Owner != nil { + owner := topic.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // RequiresDuplicateDetection + if topic.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *topic.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // SupportOrdering + if topic.SupportOrdering != nil { + supportOrdering := *topic.SupportOrdering + destination.SupportOrdering = &supportOrdering + } else { + destination.SupportOrdering = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Namespaces_Topic_STATUS populates our Namespaces_Topic_Spec from the provided source Namespaces_Topic_STATUS +func (topic *Namespaces_Topic_Spec) Initialize_From_Namespaces_Topic_STATUS(source *Namespaces_Topic_STATUS) error { + + // AutoDeleteOnIdle + topic.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // DefaultMessageTimeToLive + topic.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + topic.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + topic.EnableBatchedOperations = &enableBatchedOperation + } else { + topic.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + topic.EnableExpress = &enableExpress + } else { + topic.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + topic.EnablePartitioning = &enablePartitioning + } else { + topic.EnablePartitioning = nil + } + + // MaxMessageSizeInKilobytes + topic.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + topic.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + topic.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + topic.RequiresDuplicateDetection = nil + } + + // SupportOrdering + if source.SupportOrdering != nil { + supportOrdering := *source.SupportOrdering + topic.SupportOrdering = &supportOrdering + } else { + topic.SupportOrdering = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (topic *Namespaces_Topic_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (topic *Namespaces_Topic_Spec) SetAzureName(azureName string) { topic.AzureName = azureName } + +type Namespaces_Topic_STATUS struct { + // AccessedAt: Last time the message was sent, or a request was received, for this topic. + AccessedAt *string `json:"accessedAt,omitempty"` + + // AutoDeleteOnIdle: ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // CountDetails: Message count details + CountDetails *MessageCountDetails_STATUS `json:"countDetails,omitempty"` + + // CreatedAt: Exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO8601 timespan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: Value that indicates whether Express Entities are enabled. An express topic holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: Value that indicates whether the topic to be partitioned across multiple message brokers is enabled. + EnablePartitioning *bool `json:"enablePartitioning,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"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the topic. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // RequiresDuplicateDetection: Value indicating if this topic requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // SizeInBytes: Size of the topic, in bytes. + SizeInBytes *int `json:"sizeInBytes,omitempty"` + + // Status: Enumerates the possible values for the status of a messaging entity. + Status *EntityStatus_STATUS `json:"status,omitempty"` + + // SubscriptionCount: Number of subscriptions. + SubscriptionCount *int `json:"subscriptionCount,omitempty"` + + // SupportOrdering: Value that indicates whether the topic supports ordering. + SupportOrdering *bool `json:"supportOrdering,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_Topic_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Topic_STATUS from the provided source +func (topic *Namespaces_Topic_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20211101s.Namespaces_Topic_STATUS) + if ok { + // Populate our instance from source + return topic.AssignProperties_From_Namespaces_Topic_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topic_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = topic.AssignProperties_From_Namespaces_Topic_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_Topic_STATUS +func (topic *Namespaces_Topic_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20211101s.Namespaces_Topic_STATUS) + if ok { + // Populate destination from our instance + return topic.AssignProperties_To_Namespaces_Topic_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topic_STATUS{} + err := topic.AssignProperties_To_Namespaces_Topic_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_Topic_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (topic *Namespaces_Topic_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Topic_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (topic *Namespaces_Topic_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Topic_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Topic_STATUS_ARM, got %T", armInput) + } + + // Set property "AccessedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AccessedAt != nil { + accessedAt := *typedInput.Properties.AccessedAt + topic.AccessedAt = &accessedAt + } + } + + // Set property "AutoDeleteOnIdle": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *typedInput.Properties.AutoDeleteOnIdle + topic.AutoDeleteOnIdle = &autoDeleteOnIdle + } + } + + // no assignment for property "Conditions" + + // Set property "CountDetails": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CountDetails != nil { + var countDetails1 MessageCountDetails_STATUS + err := countDetails1.PopulateFromARM(owner, *typedInput.Properties.CountDetails) + if err != nil { + return err + } + countDetails := countDetails1 + topic.CountDetails = &countDetails + } + } + + // Set property "CreatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CreatedAt != nil { + createdAt := *typedInput.Properties.CreatedAt + topic.CreatedAt = &createdAt + } + } + + // Set property "DefaultMessageTimeToLive": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *typedInput.Properties.DefaultMessageTimeToLive + topic.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + } + + // Set property "DuplicateDetectionHistoryTimeWindow": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *typedInput.Properties.DuplicateDetectionHistoryTimeWindow + topic.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + } + + // Set property "EnableBatchedOperations": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableBatchedOperations != nil { + enableBatchedOperations := *typedInput.Properties.EnableBatchedOperations + topic.EnableBatchedOperations = &enableBatchedOperations + } + } + + // Set property "EnableExpress": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableExpress != nil { + enableExpress := *typedInput.Properties.EnableExpress + topic.EnableExpress = &enableExpress + } + } + + // Set property "EnablePartitioning": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnablePartitioning != nil { + enablePartitioning := *typedInput.Properties.EnablePartitioning + topic.EnablePartitioning = &enablePartitioning + } + } + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + topic.Id = &id + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + topic.Location = &location + } + + // Set property "MaxMessageSizeInKilobytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxMessageSizeInKilobytes != nil { + maxMessageSizeInKilobytes := *typedInput.Properties.MaxMessageSizeInKilobytes + topic.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobytes + } + } + + // Set property "MaxSizeInMegabytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxSizeInMegabytes != nil { + maxSizeInMegabytes := *typedInput.Properties.MaxSizeInMegabytes + topic.MaxSizeInMegabytes = &maxSizeInMegabytes + } + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + topic.Name = &name + } + + // Set property "RequiresDuplicateDetection": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *typedInput.Properties.RequiresDuplicateDetection + topic.RequiresDuplicateDetection = &requiresDuplicateDetection + } + } + + // Set property "SizeInBytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SizeInBytes != nil { + sizeInBytes := *typedInput.Properties.SizeInBytes + topic.SizeInBytes = &sizeInBytes + } + } + + // Set property "Status": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Status != nil { + status := *typedInput.Properties.Status + topic.Status = &status + } + } + + // Set property "SubscriptionCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SubscriptionCount != nil { + subscriptionCount := *typedInput.Properties.SubscriptionCount + topic.SubscriptionCount = &subscriptionCount + } + } + + // Set property "SupportOrdering": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SupportOrdering != nil { + supportOrdering := *typedInput.Properties.SupportOrdering + topic.SupportOrdering = &supportOrdering + } + } + + // Set property "SystemData": + if typedInput.SystemData != nil { + var systemData1 SystemData_STATUS + err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) + if err != nil { + return err + } + systemData := systemData1 + topic.SystemData = &systemData + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + topic.Type = &typeVar + } + + // Set property "UpdatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.UpdatedAt != nil { + updatedAt := *typedInput.Properties.UpdatedAt + topic.UpdatedAt = &updatedAt + } + } + + // No error + return nil +} + +// AssignProperties_From_Namespaces_Topic_STATUS populates our Namespaces_Topic_STATUS from the provided source Namespaces_Topic_STATUS +func (topic *Namespaces_Topic_STATUS) AssignProperties_From_Namespaces_Topic_STATUS(source *v20211101s.Namespaces_Topic_STATUS) error { + + // AccessedAt + topic.AccessedAt = genruntime.ClonePointerToString(source.AccessedAt) + + // AutoDeleteOnIdle + topic.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // Conditions + topic.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CountDetails + if source.CountDetails != nil { + var countDetail MessageCountDetails_STATUS + err := countDetail.AssignProperties_From_MessageCountDetails_STATUS(source.CountDetails) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_MessageCountDetails_STATUS() to populate field CountDetails") + } + topic.CountDetails = &countDetail + } else { + topic.CountDetails = nil + } + + // CreatedAt + topic.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DefaultMessageTimeToLive + topic.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + topic.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + topic.EnableBatchedOperations = &enableBatchedOperation + } else { + topic.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + topic.EnableExpress = &enableExpress + } else { + topic.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + topic.EnablePartitioning = &enablePartitioning + } else { + topic.EnablePartitioning = nil + } + + // Id + topic.Id = genruntime.ClonePointerToString(source.Id) + + // Location + topic.Location = genruntime.ClonePointerToString(source.Location) + + // MaxMessageSizeInKilobytes + topic.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + topic.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // Name + topic.Name = genruntime.ClonePointerToString(source.Name) + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + topic.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + topic.RequiresDuplicateDetection = nil + } + + // SizeInBytes + topic.SizeInBytes = genruntime.ClonePointerToInt(source.SizeInBytes) + + // Status + if source.Status != nil { + status := EntityStatus_STATUS(*source.Status) + topic.Status = &status + } else { + topic.Status = nil + } + + // SubscriptionCount + topic.SubscriptionCount = genruntime.ClonePointerToInt(source.SubscriptionCount) + + // SupportOrdering + if source.SupportOrdering != nil { + supportOrdering := *source.SupportOrdering + topic.SupportOrdering = &supportOrdering + } else { + topic.SupportOrdering = 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") + } + topic.SystemData = &systemDatum + } else { + topic.SystemData = nil + } + + // Type + topic.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + topic.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topic_STATUS populates the provided destination Namespaces_Topic_STATUS from our Namespaces_Topic_STATUS +func (topic *Namespaces_Topic_STATUS) AssignProperties_To_Namespaces_Topic_STATUS(destination *v20211101s.Namespaces_Topic_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AccessedAt + destination.AccessedAt = genruntime.ClonePointerToString(topic.AccessedAt) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(topic.AutoDeleteOnIdle) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(topic.Conditions) + + // CountDetails + if topic.CountDetails != nil { + var countDetail v20211101s.MessageCountDetails_STATUS + err := topic.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_MessageCountDetails_STATUS() to populate field CountDetails") + } + destination.CountDetails = &countDetail + } else { + destination.CountDetails = nil + } + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(topic.CreatedAt) + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(topic.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(topic.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if topic.EnableBatchedOperations != nil { + enableBatchedOperation := *topic.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if topic.EnableExpress != nil { + enableExpress := *topic.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if topic.EnablePartitioning != nil { + enablePartitioning := *topic.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // Id + destination.Id = genruntime.ClonePointerToString(topic.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(topic.Location) + + // MaxMessageSizeInKilobytes + destination.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(topic.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(topic.MaxSizeInMegabytes) + + // Name + destination.Name = genruntime.ClonePointerToString(topic.Name) + + // RequiresDuplicateDetection + if topic.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *topic.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // SizeInBytes + destination.SizeInBytes = genruntime.ClonePointerToInt(topic.SizeInBytes) + + // Status + if topic.Status != nil { + status := string(*topic.Status) + destination.Status = &status + } else { + destination.Status = nil + } + + // SubscriptionCount + destination.SubscriptionCount = genruntime.ClonePointerToInt(topic.SubscriptionCount) + + // SupportOrdering + if topic.SupportOrdering != nil { + supportOrdering := *topic.SupportOrdering + destination.SupportOrdering = &supportOrdering + } else { + destination.SupportOrdering = nil + } + + // SystemData + if topic.SystemData != nil { + var systemDatum v20211101s.SystemData_STATUS + err := topic.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(topic.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(topic.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&NamespacesTopic{}, &NamespacesTopicList{}) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen_test.go new file mode 100644 index 00000000000..ab9cdbdfdf8 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen_test.go @@ -0,0 +1,424 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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_NamespacesTopic_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 NamespacesTopic to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesTopic, NamespacesTopicGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesTopic tests if a specific instance of NamespacesTopic round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesTopic(subject NamespacesTopic) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesTopic + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesTopic + 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_NamespacesTopic_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopic to NamespacesTopic via AssignProperties_To_NamespacesTopic & AssignProperties_From_NamespacesTopic returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopic, NamespacesTopicGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopic tests if a specific instance of NamespacesTopic can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopic(subject NamespacesTopic) 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.NamespacesTopic + err := copied.AssignProperties_To_NamespacesTopic(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopic + err = actual.AssignProperties_From_NamespacesTopic(&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_NamespacesTopic_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 NamespacesTopic via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopic, NamespacesTopicGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopic runs a test to see if a specific instance of NamespacesTopic round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopic(subject NamespacesTopic) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopic + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopic instances for property testing - lazily instantiated by NamespacesTopicGenerator() +var namespacesTopicGenerator gopter.Gen + +// NamespacesTopicGenerator returns a generator of NamespacesTopic instances for property testing. +func NamespacesTopicGenerator() gopter.Gen { + if namespacesTopicGenerator != nil { + return namespacesTopicGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesTopic(generators) + namespacesTopicGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic{}), generators) + + return namespacesTopicGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesTopic is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopic(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Topic_SpecGenerator() + gens["Status"] = Namespaces_Topic_STATUSGenerator() +} + +func Test_Namespaces_Topic_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topic_Spec to Namespaces_Topic_Spec via AssignProperties_To_Namespaces_Topic_Spec & AssignProperties_From_Namespaces_Topic_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topic_Spec, Namespaces_Topic_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topic_Spec tests if a specific instance of Namespaces_Topic_Spec can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topic_Spec(subject Namespaces_Topic_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 v20211101s.Namespaces_Topic_Spec + err := copied.AssignProperties_To_Namespaces_Topic_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topic_Spec + err = actual.AssignProperties_From_Namespaces_Topic_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_Topic_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_Topic_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topic_Spec, Namespaces_Topic_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topic_Spec runs a test to see if a specific instance of Namespaces_Topic_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topic_Spec(subject Namespaces_Topic_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topic_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_Topic_Spec instances for property testing - lazily instantiated by +// Namespaces_Topic_SpecGenerator() +var namespaces_Topic_SpecGenerator gopter.Gen + +// Namespaces_Topic_SpecGenerator returns a generator of Namespaces_Topic_Spec instances for property testing. +func Namespaces_Topic_SpecGenerator() gopter.Gen { + if namespaces_Topic_SpecGenerator != nil { + return namespaces_Topic_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec(generators) + namespaces_Topic_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_Spec{}), generators) + + return namespaces_Topic_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["SupportOrdering"] = gen.PtrOf(gen.Bool()) +} + +func Test_Namespaces_Topic_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topic_STATUS to Namespaces_Topic_STATUS via AssignProperties_To_Namespaces_Topic_STATUS & AssignProperties_From_Namespaces_Topic_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topic_STATUS, Namespaces_Topic_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topic_STATUS tests if a specific instance of Namespaces_Topic_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topic_STATUS(subject Namespaces_Topic_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 v20211101s.Namespaces_Topic_STATUS + err := copied.AssignProperties_To_Namespaces_Topic_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topic_STATUS + err = actual.AssignProperties_From_Namespaces_Topic_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_Topic_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_Topic_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topic_STATUS, Namespaces_Topic_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topic_STATUS runs a test to see if a specific instance of Namespaces_Topic_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topic_STATUS(subject Namespaces_Topic_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topic_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_Topic_STATUS instances for property testing - lazily instantiated by +// Namespaces_Topic_STATUSGenerator() +var namespaces_Topic_STATUSGenerator gopter.Gen + +// Namespaces_Topic_STATUSGenerator returns a generator of Namespaces_Topic_STATUS instances for property testing. +// We first initialize namespaces_Topic_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_Topic_STATUSGenerator() gopter.Gen { + if namespaces_Topic_STATUSGenerator != nil { + return namespaces_Topic_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS(generators) + namespaces_Topic_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS(generators) + namespaces_Topic_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_STATUS{}), generators) + + return namespaces_Topic_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["SizeInBytes"] = gen.PtrOf(gen.Int()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + EntityStatus_STATUS_Active, + EntityStatus_STATUS_Creating, + EntityStatus_STATUS_Deleting, + EntityStatus_STATUS_Disabled, + EntityStatus_STATUS_ReceiveDisabled, + EntityStatus_STATUS_Renaming, + EntityStatus_STATUS_Restoring, + EntityStatus_STATUS_SendDisabled, + EntityStatus_STATUS_Unknown)) + gens["SubscriptionCount"] = gen.PtrOf(gen.Int()) + gens["SupportOrdering"] = gen.PtrOf(gen.Bool()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_spec_arm_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_spec_arm_types_gen.go new file mode 100644 index 00000000000..0abe0c93fb9 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_spec_arm_types_gen.go @@ -0,0 +1,90 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_Topics_Subscription_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: Properties of subscriptions resource. + Properties *SBSubscriptionProperties_ARM `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespaces_Topics_Subscription_Spec_ARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01" +func (subscription Namespaces_Topics_Subscription_Spec_ARM) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetName returns the Name of the resource +func (subscription *Namespaces_Topics_Subscription_Spec_ARM) GetName() string { + return subscription.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions" +func (subscription *Namespaces_Topics_Subscription_Spec_ARM) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions" +} + +// Description of Subscription Resource. +type SBSubscriptionProperties_ARM struct { + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // ClientAffineProperties: Properties specific to client affine subscriptions. + ClientAffineProperties *SBClientAffineProperties_ARM `json:"clientAffineProperties,omitempty"` + + // DeadLetteringOnFilterEvaluationExceptions: Value that indicates whether a subscription has dead letter support on filter + // evaluation exceptions. + DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"` + + // DeadLetteringOnMessageExpiration: Value that indicates whether a subscription has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8061 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // IsClientAffine: Value that indicates whether the subscription has an affinity to the client id. + IsClientAffine *bool `json:"isClientAffine,omitempty"` + + // LockDuration: ISO 8061 lock duration timespan for the subscription. The default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: Number of maximum deliveries. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // RequiresSession: Value indicating if a subscription supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` +} + +// Properties specific to client affine subscriptions. +type SBClientAffineProperties_ARM struct { + // ClientId: Indicates the Client ID of the application that created the client-affine subscription. + ClientId *string `json:"clientId,omitempty"` + + // IsDurable: For client-affine subscriptions, this value indicates whether the subscription is durable or not. + IsDurable *bool `json:"isDurable,omitempty"` + + // IsShared: For client-affine subscriptions, this value indicates whether the subscription is shared or not. + IsShared *bool `json:"isShared,omitempty"` +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_spec_arm_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..deba624f42a --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_spec_arm_types_gen_test.go @@ -0,0 +1,242 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +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_Topics_Subscription_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_Topics_Subscription_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec_ARM, Namespaces_Topics_Subscription_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec_ARM runs a test to see if a specific instance of Namespaces_Topics_Subscription_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec_ARM(subject Namespaces_Topics_Subscription_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscription_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_Topics_Subscription_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscription_Spec_ARMGenerator() +var namespaces_Topics_Subscription_Spec_ARMGenerator gopter.Gen + +// Namespaces_Topics_Subscription_Spec_ARMGenerator returns a generator of Namespaces_Topics_Subscription_Spec_ARM instances for property testing. +// We first initialize namespaces_Topics_Subscription_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_Topics_Subscription_Spec_ARMGenerator() gopter.Gen { + if namespaces_Topics_Subscription_Spec_ARMGenerator != nil { + return namespaces_Topics_Subscription_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM(generators) + namespaces_Topics_Subscription_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM(generators) + namespaces_Topics_Subscription_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_Spec_ARM{}), generators) + + return namespaces_Topics_Subscription_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBSubscriptionProperties_ARMGenerator()) +} + +func Test_SBSubscriptionProperties_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 SBSubscriptionProperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSubscriptionProperties_ARM, SBSubscriptionProperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSubscriptionProperties_ARM runs a test to see if a specific instance of SBSubscriptionProperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSubscriptionProperties_ARM(subject SBSubscriptionProperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSubscriptionProperties_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 SBSubscriptionProperties_ARM instances for property testing - lazily instantiated by +// SBSubscriptionProperties_ARMGenerator() +var sbSubscriptionProperties_ARMGenerator gopter.Gen + +// SBSubscriptionProperties_ARMGenerator returns a generator of SBSubscriptionProperties_ARM instances for property testing. +// We first initialize sbSubscriptionProperties_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 SBSubscriptionProperties_ARMGenerator() gopter.Gen { + if sbSubscriptionProperties_ARMGenerator != nil { + return sbSubscriptionProperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSubscriptionProperties_ARM(generators) + sbSubscriptionProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBSubscriptionProperties_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSubscriptionProperties_ARM(generators) + AddRelatedPropertyGeneratorsForSBSubscriptionProperties_ARM(generators) + sbSubscriptionProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBSubscriptionProperties_ARM{}), generators) + + return sbSubscriptionProperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBSubscriptionProperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSubscriptionProperties_ARM(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnFilterEvaluationExceptions"] = gen.PtrOf(gen.Bool()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["IsClientAffine"] = gen.PtrOf(gen.Bool()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForSBSubscriptionProperties_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBSubscriptionProperties_ARM(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffineProperties_ARMGenerator()) +} + +func Test_SBClientAffineProperties_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 SBClientAffineProperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBClientAffineProperties_ARM, SBClientAffineProperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBClientAffineProperties_ARM runs a test to see if a specific instance of SBClientAffineProperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBClientAffineProperties_ARM(subject SBClientAffineProperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBClientAffineProperties_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 SBClientAffineProperties_ARM instances for property testing - lazily instantiated by +// SBClientAffineProperties_ARMGenerator() +var sbClientAffineProperties_ARMGenerator gopter.Gen + +// SBClientAffineProperties_ARMGenerator returns a generator of SBClientAffineProperties_ARM instances for property testing. +func SBClientAffineProperties_ARMGenerator() gopter.Gen { + if sbClientAffineProperties_ARMGenerator != nil { + return sbClientAffineProperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBClientAffineProperties_ARM(generators) + sbClientAffineProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBClientAffineProperties_ARM{}), generators) + + return sbClientAffineProperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBClientAffineProperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBClientAffineProperties_ARM(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["IsDurable"] = gen.PtrOf(gen.Bool()) + gens["IsShared"] = gen.PtrOf(gen.Bool()) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_status_arm_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_status_arm_types_gen.go new file mode 100644 index 00000000000..071732dd8b4 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_status_arm_types_gen.go @@ -0,0 +1,103 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +type Namespaces_Topics_Subscription_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 of subscriptions resource. + Properties *SBSubscriptionProperties_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"` +} + +// Description of Subscription Resource. +type SBSubscriptionProperties_STATUS_ARM struct { + // AccessedAt: Last time there was a receive request to this subscription. + AccessedAt *string `json:"accessedAt,omitempty"` + + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // ClientAffineProperties: Properties specific to client affine subscriptions. + ClientAffineProperties *SBClientAffineProperties_STATUS_ARM `json:"clientAffineProperties,omitempty"` + + // CountDetails: Message count details + CountDetails *MessageCountDetails_STATUS_ARM `json:"countDetails,omitempty"` + + // CreatedAt: Exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DeadLetteringOnFilterEvaluationExceptions: Value that indicates whether a subscription has dead letter support on filter + // evaluation exceptions. + DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"` + + // DeadLetteringOnMessageExpiration: Value that indicates whether a subscription has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8061 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // IsClientAffine: Value that indicates whether the subscription has an affinity to the client id. + IsClientAffine *bool `json:"isClientAffine,omitempty"` + + // LockDuration: ISO 8061 lock duration timespan for the subscription. The default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: Number of maximum deliveries. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // MessageCount: Number of messages. + MessageCount *int `json:"messageCount,omitempty"` + + // RequiresSession: Value indicating if a subscription supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` + + // Status: Enumerates the possible values for the status of a messaging entity. + Status *EntityStatus_STATUS `json:"status,omitempty"` + + // UpdatedAt: The exact time the message was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +// Properties specific to client affine subscriptions. +type SBClientAffineProperties_STATUS_ARM struct { + // ClientId: Indicates the Client ID of the application that created the client-affine subscription. + ClientId *string `json:"clientId,omitempty"` + + // IsDurable: For client-affine subscriptions, this value indicates whether the subscription is durable or not. + IsDurable *bool `json:"isDurable,omitempty"` + + // IsShared: For client-affine subscriptions, this value indicates whether the subscription is shared or not. + IsShared *bool `json:"isShared,omitempty"` +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_status_arm_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_status_arm_types_gen_test.go new file mode 100644 index 00000000000..2dd8511e946 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_status_arm_types_gen_test.go @@ -0,0 +1,261 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +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_Topics_Subscription_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_Topics_Subscription_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS_ARM, Namespaces_Topics_Subscription_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS_ARM runs a test to see if a specific instance of Namespaces_Topics_Subscription_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS_ARM(subject Namespaces_Topics_Subscription_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS_ARM instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscription_STATUS_ARMGenerator() +var namespaces_Topics_Subscription_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Topics_Subscription_STATUS_ARMGenerator returns a generator of Namespaces_Topics_Subscription_STATUS_ARM instances for property testing. +// We first initialize namespaces_Topics_Subscription_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_Topics_Subscription_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Topics_Subscription_STATUS_ARMGenerator != nil { + return namespaces_Topics_Subscription_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS_ARM(generators) + namespaces_Topics_Subscription_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS_ARM(generators) + namespaces_Topics_Subscription_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_STATUS_ARM{}), generators) + + return namespaces_Topics_Subscription_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_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_Topics_Subscription_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBSubscriptionProperties_STATUS_ARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) +} + +func Test_SBSubscriptionProperties_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 SBSubscriptionProperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSubscriptionProperties_STATUS_ARM, SBSubscriptionProperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSubscriptionProperties_STATUS_ARM runs a test to see if a specific instance of SBSubscriptionProperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSubscriptionProperties_STATUS_ARM(subject SBSubscriptionProperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSubscriptionProperties_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 SBSubscriptionProperties_STATUS_ARM instances for property testing - lazily instantiated by +// SBSubscriptionProperties_STATUS_ARMGenerator() +var sbSubscriptionProperties_STATUS_ARMGenerator gopter.Gen + +// SBSubscriptionProperties_STATUS_ARMGenerator returns a generator of SBSubscriptionProperties_STATUS_ARM instances for property testing. +// We first initialize sbSubscriptionProperties_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 SBSubscriptionProperties_STATUS_ARMGenerator() gopter.Gen { + if sbSubscriptionProperties_STATUS_ARMGenerator != nil { + return sbSubscriptionProperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM(generators) + sbSubscriptionProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBSubscriptionProperties_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM(generators) + sbSubscriptionProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBSubscriptionProperties_STATUS_ARM{}), generators) + + return sbSubscriptionProperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnFilterEvaluationExceptions"] = gen.PtrOf(gen.Bool()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["IsClientAffine"] = gen.PtrOf(gen.Bool()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MessageCount"] = gen.PtrOf(gen.Int()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + EntityStatus_STATUS_Active, + EntityStatus_STATUS_Creating, + EntityStatus_STATUS_Deleting, + EntityStatus_STATUS_Disabled, + EntityStatus_STATUS_ReceiveDisabled, + EntityStatus_STATUS_Renaming, + EntityStatus_STATUS_Restoring, + EntityStatus_STATUS_SendDisabled, + EntityStatus_STATUS_Unknown)) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffineProperties_STATUS_ARMGenerator()) + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUS_ARMGenerator()) +} + +func Test_SBClientAffineProperties_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 SBClientAffineProperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBClientAffineProperties_STATUS_ARM, SBClientAffineProperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBClientAffineProperties_STATUS_ARM runs a test to see if a specific instance of SBClientAffineProperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBClientAffineProperties_STATUS_ARM(subject SBClientAffineProperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBClientAffineProperties_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 SBClientAffineProperties_STATUS_ARM instances for property testing - lazily instantiated by +// SBClientAffineProperties_STATUS_ARMGenerator() +var sbClientAffineProperties_STATUS_ARMGenerator gopter.Gen + +// SBClientAffineProperties_STATUS_ARMGenerator returns a generator of SBClientAffineProperties_STATUS_ARM instances for property testing. +func SBClientAffineProperties_STATUS_ARMGenerator() gopter.Gen { + if sbClientAffineProperties_STATUS_ARMGenerator != nil { + return sbClientAffineProperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS_ARM(generators) + sbClientAffineProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBClientAffineProperties_STATUS_ARM{}), generators) + + return sbClientAffineProperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["IsDurable"] = gen.PtrOf(gen.Bool()) + gens["IsShared"] = gen.PtrOf(gen.Bool()) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen.go new file mode 100644 index 00000000000..55389b0883a --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen.go @@ -0,0 +1,1867 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/subscriptions.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName} +type NamespacesTopicsSubscription struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Topics_Subscription_Spec `json:"spec,omitempty"` + Status Namespaces_Topics_Subscription_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesTopicsSubscription{} + +// GetConditions returns the conditions of the resource +func (subscription *NamespacesTopicsSubscription) GetConditions() conditions.Conditions { + return subscription.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (subscription *NamespacesTopicsSubscription) SetConditions(conditions conditions.Conditions) { + subscription.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesTopicsSubscription{} + +// ConvertFrom populates our NamespacesTopicsSubscription from the provided hub NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20211101s.NamespacesTopicsSubscription) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopicsSubscription but received %T instead", hub) + } + + return subscription.AssignProperties_From_NamespacesTopicsSubscription(source) +} + +// ConvertTo populates the provided hub NamespacesTopicsSubscription from our NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20211101s.NamespacesTopicsSubscription) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopicsSubscription but received %T instead", hub) + } + + return subscription.AssignProperties_To_NamespacesTopicsSubscription(destination) +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20211101-namespacestopicssubscription,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptions,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespacestopicssubscriptions.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &NamespacesTopicsSubscription{} + +// Default applies defaults to the NamespacesTopicsSubscription resource +func (subscription *NamespacesTopicsSubscription) Default() { + subscription.defaultImpl() + var temp any = subscription + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (subscription *NamespacesTopicsSubscription) defaultAzureName() { + if subscription.Spec.AzureName == "" { + subscription.Spec.AzureName = subscription.Name + } +} + +// defaultImpl applies the code generated defaults to the NamespacesTopicsSubscription resource +func (subscription *NamespacesTopicsSubscription) defaultImpl() { subscription.defaultAzureName() } + +var _ genruntime.ImportableResource = &NamespacesTopicsSubscription{} + +// InitializeSpec initializes the spec for this resource from the given status +func (subscription *NamespacesTopicsSubscription) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespaces_Topics_Subscription_STATUS); ok { + return subscription.Spec.Initialize_From_Namespaces_Topics_Subscription_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespaces_Topics_Subscription_STATUS but received %T instead", status) +} + +var _ genruntime.KubernetesResource = &NamespacesTopicsSubscription{} + +// AzureName returns the Azure name of the resource +func (subscription *NamespacesTopicsSubscription) AzureName() string { + return subscription.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01" +func (subscription NamespacesTopicsSubscription) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (subscription *NamespacesTopicsSubscription) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (subscription *NamespacesTopicsSubscription) GetSpec() genruntime.ConvertibleSpec { + return &subscription.Spec +} + +// GetStatus returns the status of this resource +func (subscription *NamespacesTopicsSubscription) GetStatus() genruntime.ConvertibleStatus { + return &subscription.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions" +func (subscription *NamespacesTopicsSubscription) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions" +} + +// NewEmptyStatus returns a new empty (blank) status +func (subscription *NamespacesTopicsSubscription) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Topics_Subscription_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (subscription *NamespacesTopicsSubscription) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: subscription.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (subscription *NamespacesTopicsSubscription) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Topics_Subscription_STATUS); ok { + subscription.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Topics_Subscription_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + subscription.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-servicebus-azure-com-v1api20211101-namespacestopicssubscription,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptions,verbs=create;update,versions=v1api20211101,name=validate.v1api20211101.namespacestopicssubscriptions.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &NamespacesTopicsSubscription{} + +// ValidateCreate validates the creation of the resource +func (subscription *NamespacesTopicsSubscription) ValidateCreate() (admission.Warnings, error) { + validations := subscription.createValidations() + var temp any = subscription + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + return genruntime.ValidateCreate(validations) +} + +// ValidateDelete validates the deletion of the resource +func (subscription *NamespacesTopicsSubscription) ValidateDelete() (admission.Warnings, error) { + validations := subscription.deleteValidations() + var temp any = subscription + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + return genruntime.ValidateDelete(validations) +} + +// ValidateUpdate validates an update of the resource +func (subscription *NamespacesTopicsSubscription) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { + validations := subscription.updateValidations() + var temp any = subscription + 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 (subscription *NamespacesTopicsSubscription) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){subscription.validateResourceReferences} +} + +// deleteValidations validates the deletion of the resource +func (subscription *NamespacesTopicsSubscription) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (subscription *NamespacesTopicsSubscription) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return subscription.validateResourceReferences() + }, + subscription.validateWriteOnceProperties} +} + +// validateResourceReferences validates all resource references +func (subscription *NamespacesTopicsSubscription) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&subscription.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (subscription *NamespacesTopicsSubscription) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*NamespacesTopicsSubscription) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, subscription) +} + +// AssignProperties_From_NamespacesTopicsSubscription populates our NamespacesTopicsSubscription from the provided source NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) AssignProperties_From_NamespacesTopicsSubscription(source *v20211101s.NamespacesTopicsSubscription) error { + + // ObjectMeta + subscription.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Topics_Subscription_Spec + err := spec.AssignProperties_From_Namespaces_Topics_Subscription_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscription_Spec() to populate field Spec") + } + subscription.Spec = spec + + // Status + var status Namespaces_Topics_Subscription_STATUS + err = status.AssignProperties_From_Namespaces_Topics_Subscription_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscription_STATUS() to populate field Status") + } + subscription.Status = status + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscription populates the provided destination NamespacesTopicsSubscription from our NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) AssignProperties_To_NamespacesTopicsSubscription(destination *v20211101s.NamespacesTopicsSubscription) error { + + // ObjectMeta + destination.ObjectMeta = *subscription.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.Namespaces_Topics_Subscription_Spec + err := subscription.Spec.AssignProperties_To_Namespaces_Topics_Subscription_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscription_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20211101s.Namespaces_Topics_Subscription_STATUS + err = subscription.Status.AssignProperties_To_Namespaces_Topics_Subscription_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscription_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 (subscription *NamespacesTopicsSubscription) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: subscription.Spec.OriginalVersion(), + Kind: "NamespacesTopicsSubscription", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/subscriptions.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName} +type NamespacesTopicsSubscriptionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesTopicsSubscription `json:"items"` +} + +type Namespaces_Topics_Subscription_Spec struct { + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // +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"` + + // ClientAffineProperties: Properties specific to client affine subscriptions. + ClientAffineProperties *SBClientAffineProperties `json:"clientAffineProperties,omitempty"` + + // DeadLetteringOnFilterEvaluationExceptions: Value that indicates whether a subscription has dead letter support on filter + // evaluation exceptions. + DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"` + + // DeadLetteringOnMessageExpiration: Value that indicates whether a subscription has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8061 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // IsClientAffine: Value that indicates whether the subscription has an affinity to the client id. + IsClientAffine *bool `json:"isClientAffine,omitempty"` + + // LockDuration: ISO 8061 lock duration timespan for the subscription. The default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: Number of maximum deliveries. + MaxDeliveryCount *int `json:"maxDeliveryCount,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 servicebus.azure.com/NamespacesTopic resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"NamespacesTopic"` + + // RequiresSession: Value indicating if a subscription supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` +} + +var _ genruntime.ARMTransformer = &Namespaces_Topics_Subscription_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (subscription *Namespaces_Topics_Subscription_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if subscription == nil { + return nil, nil + } + result := &Namespaces_Topics_Subscription_Spec_ARM{} + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if subscription.AutoDeleteOnIdle != nil || + subscription.ClientAffineProperties != nil || + subscription.DeadLetteringOnFilterEvaluationExceptions != nil || + subscription.DeadLetteringOnMessageExpiration != nil || + subscription.DefaultMessageTimeToLive != nil || + subscription.DuplicateDetectionHistoryTimeWindow != nil || + subscription.EnableBatchedOperations != nil || + subscription.ForwardDeadLetteredMessagesTo != nil || + subscription.ForwardTo != nil || + subscription.IsClientAffine != nil || + subscription.LockDuration != nil || + subscription.MaxDeliveryCount != nil || + subscription.RequiresSession != nil { + result.Properties = &SBSubscriptionProperties_ARM{} + } + if subscription.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *subscription.AutoDeleteOnIdle + result.Properties.AutoDeleteOnIdle = &autoDeleteOnIdle + } + if subscription.ClientAffineProperties != nil { + clientAffineProperties_ARM, err := (*subscription.ClientAffineProperties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + clientAffineProperties := *clientAffineProperties_ARM.(*SBClientAffineProperties_ARM) + result.Properties.ClientAffineProperties = &clientAffineProperties + } + if subscription.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationExceptions := *subscription.DeadLetteringOnFilterEvaluationExceptions + result.Properties.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationExceptions + } + if subscription.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *subscription.DeadLetteringOnMessageExpiration + result.Properties.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } + if subscription.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *subscription.DefaultMessageTimeToLive + result.Properties.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + if subscription.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *subscription.DuplicateDetectionHistoryTimeWindow + result.Properties.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + if subscription.EnableBatchedOperations != nil { + enableBatchedOperations := *subscription.EnableBatchedOperations + result.Properties.EnableBatchedOperations = &enableBatchedOperations + } + if subscription.ForwardDeadLetteredMessagesTo != nil { + forwardDeadLetteredMessagesTo := *subscription.ForwardDeadLetteredMessagesTo + result.Properties.ForwardDeadLetteredMessagesTo = &forwardDeadLetteredMessagesTo + } + if subscription.ForwardTo != nil { + forwardTo := *subscription.ForwardTo + result.Properties.ForwardTo = &forwardTo + } + if subscription.IsClientAffine != nil { + isClientAffine := *subscription.IsClientAffine + result.Properties.IsClientAffine = &isClientAffine + } + if subscription.LockDuration != nil { + lockDuration := *subscription.LockDuration + result.Properties.LockDuration = &lockDuration + } + if subscription.MaxDeliveryCount != nil { + maxDeliveryCount := *subscription.MaxDeliveryCount + result.Properties.MaxDeliveryCount = &maxDeliveryCount + } + if subscription.RequiresSession != nil { + requiresSession := *subscription.RequiresSession + result.Properties.RequiresSession = &requiresSession + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (subscription *Namespaces_Topics_Subscription_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Topics_Subscription_Spec_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (subscription *Namespaces_Topics_Subscription_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Topics_Subscription_Spec_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Topics_Subscription_Spec_ARM, got %T", armInput) + } + + // Set property "AutoDeleteOnIdle": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *typedInput.Properties.AutoDeleteOnIdle + subscription.AutoDeleteOnIdle = &autoDeleteOnIdle + } + } + + // Set property "AzureName": + subscription.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // Set property "ClientAffineProperties": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ClientAffineProperties != nil { + var clientAffineProperties1 SBClientAffineProperties + err := clientAffineProperties1.PopulateFromARM(owner, *typedInput.Properties.ClientAffineProperties) + if err != nil { + return err + } + clientAffineProperties := clientAffineProperties1 + subscription.ClientAffineProperties = &clientAffineProperties + } + } + + // Set property "DeadLetteringOnFilterEvaluationExceptions": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationExceptions := *typedInput.Properties.DeadLetteringOnFilterEvaluationExceptions + subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationExceptions + } + } + + // Set property "DeadLetteringOnMessageExpiration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *typedInput.Properties.DeadLetteringOnMessageExpiration + subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } + } + + // Set property "DefaultMessageTimeToLive": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *typedInput.Properties.DefaultMessageTimeToLive + subscription.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + } + + // Set property "DuplicateDetectionHistoryTimeWindow": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *typedInput.Properties.DuplicateDetectionHistoryTimeWindow + subscription.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + } + + // Set property "EnableBatchedOperations": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableBatchedOperations != nil { + enableBatchedOperations := *typedInput.Properties.EnableBatchedOperations + subscription.EnableBatchedOperations = &enableBatchedOperations + } + } + + // Set property "ForwardDeadLetteredMessagesTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardDeadLetteredMessagesTo != nil { + forwardDeadLetteredMessagesTo := *typedInput.Properties.ForwardDeadLetteredMessagesTo + subscription.ForwardDeadLetteredMessagesTo = &forwardDeadLetteredMessagesTo + } + } + + // Set property "ForwardTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardTo != nil { + forwardTo := *typedInput.Properties.ForwardTo + subscription.ForwardTo = &forwardTo + } + } + + // Set property "IsClientAffine": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.IsClientAffine != nil { + isClientAffine := *typedInput.Properties.IsClientAffine + subscription.IsClientAffine = &isClientAffine + } + } + + // Set property "LockDuration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.LockDuration != nil { + lockDuration := *typedInput.Properties.LockDuration + subscription.LockDuration = &lockDuration + } + } + + // Set property "MaxDeliveryCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxDeliveryCount != nil { + maxDeliveryCount := *typedInput.Properties.MaxDeliveryCount + subscription.MaxDeliveryCount = &maxDeliveryCount + } + } + + // Set property "Owner": + subscription.Owner = &genruntime.KnownResourceReference{Name: owner.Name} + + // Set property "RequiresSession": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresSession != nil { + requiresSession := *typedInput.Properties.RequiresSession + subscription.RequiresSession = &requiresSession + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Topics_Subscription_Spec{} + +// ConvertSpecFrom populates our Namespaces_Topics_Subscription_Spec from the provided source +func (subscription *Namespaces_Topics_Subscription_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20211101s.Namespaces_Topics_Subscription_Spec) + if ok { + // Populate our instance from source + return subscription.AssignProperties_From_Namespaces_Topics_Subscription_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topics_Subscription_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = subscription.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_Spec +func (subscription *Namespaces_Topics_Subscription_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20211101s.Namespaces_Topics_Subscription_Spec) + if ok { + // Populate destination from our instance + return subscription.AssignProperties_To_Namespaces_Topics_Subscription_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topics_Subscription_Spec{} + err := subscription.AssignProperties_To_Namespaces_Topics_Subscription_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_Topics_Subscription_Spec populates our Namespaces_Topics_Subscription_Spec from the provided source Namespaces_Topics_Subscription_Spec +func (subscription *Namespaces_Topics_Subscription_Spec) AssignProperties_From_Namespaces_Topics_Subscription_Spec(source *v20211101s.Namespaces_Topics_Subscription_Spec) error { + + // AutoDeleteOnIdle + subscription.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // AzureName + subscription.AzureName = source.AzureName + + // ClientAffineProperties + if source.ClientAffineProperties != nil { + var clientAffineProperty SBClientAffineProperties + err := clientAffineProperty.AssignProperties_From_SBClientAffineProperties(source.ClientAffineProperties) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBClientAffineProperties() to populate field ClientAffineProperties") + } + subscription.ClientAffineProperties = &clientAffineProperty + } else { + subscription.ClientAffineProperties = nil + } + + // DeadLetteringOnFilterEvaluationExceptions + if source.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *source.DeadLetteringOnFilterEvaluationExceptions + subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + subscription.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + subscription.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + subscription.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + subscription.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + subscription.EnableBatchedOperations = &enableBatchedOperation + } else { + subscription.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + subscription.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + subscription.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // IsClientAffine + if source.IsClientAffine != nil { + isClientAffine := *source.IsClientAffine + subscription.IsClientAffine = &isClientAffine + } else { + subscription.IsClientAffine = nil + } + + // LockDuration + subscription.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + subscription.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + subscription.Owner = &owner + } else { + subscription.Owner = nil + } + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + subscription.RequiresSession = &requiresSession + } else { + subscription.RequiresSession = nil + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topics_Subscription_Spec populates the provided destination Namespaces_Topics_Subscription_Spec from our Namespaces_Topics_Subscription_Spec +func (subscription *Namespaces_Topics_Subscription_Spec) AssignProperties_To_Namespaces_Topics_Subscription_Spec(destination *v20211101s.Namespaces_Topics_Subscription_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(subscription.AutoDeleteOnIdle) + + // AzureName + destination.AzureName = subscription.AzureName + + // ClientAffineProperties + if subscription.ClientAffineProperties != nil { + var clientAffineProperty v20211101s.SBClientAffineProperties + err := subscription.ClientAffineProperties.AssignProperties_To_SBClientAffineProperties(&clientAffineProperty) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBClientAffineProperties() to populate field ClientAffineProperties") + } + destination.ClientAffineProperties = &clientAffineProperty + } else { + destination.ClientAffineProperties = nil + } + + // DeadLetteringOnFilterEvaluationExceptions + if subscription.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *subscription.DeadLetteringOnFilterEvaluationExceptions + destination.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + destination.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if subscription.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *subscription.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(subscription.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(subscription.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if subscription.EnableBatchedOperations != nil { + enableBatchedOperation := *subscription.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(subscription.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(subscription.ForwardTo) + + // IsClientAffine + if subscription.IsClientAffine != nil { + isClientAffine := *subscription.IsClientAffine + destination.IsClientAffine = &isClientAffine + } else { + destination.IsClientAffine = nil + } + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(subscription.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(subscription.MaxDeliveryCount) + + // OriginalVersion + destination.OriginalVersion = subscription.OriginalVersion() + + // Owner + if subscription.Owner != nil { + owner := subscription.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // RequiresSession + if subscription.RequiresSession != nil { + requiresSession := *subscription.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Namespaces_Topics_Subscription_STATUS populates our Namespaces_Topics_Subscription_Spec from the provided source Namespaces_Topics_Subscription_STATUS +func (subscription *Namespaces_Topics_Subscription_Spec) Initialize_From_Namespaces_Topics_Subscription_STATUS(source *Namespaces_Topics_Subscription_STATUS) error { + + // AutoDeleteOnIdle + subscription.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // ClientAffineProperties + if source.ClientAffineProperties != nil { + var clientAffineProperty SBClientAffineProperties + err := clientAffineProperty.Initialize_From_SBClientAffineProperties_STATUS(source.ClientAffineProperties) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_SBClientAffineProperties_STATUS() to populate field ClientAffineProperties") + } + subscription.ClientAffineProperties = &clientAffineProperty + } else { + subscription.ClientAffineProperties = nil + } + + // DeadLetteringOnFilterEvaluationExceptions + if source.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *source.DeadLetteringOnFilterEvaluationExceptions + subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + subscription.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + subscription.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + subscription.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + subscription.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + subscription.EnableBatchedOperations = &enableBatchedOperation + } else { + subscription.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + subscription.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + subscription.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // IsClientAffine + if source.IsClientAffine != nil { + isClientAffine := *source.IsClientAffine + subscription.IsClientAffine = &isClientAffine + } else { + subscription.IsClientAffine = nil + } + + // LockDuration + subscription.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + subscription.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + subscription.RequiresSession = &requiresSession + } else { + subscription.RequiresSession = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (subscription *Namespaces_Topics_Subscription_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (subscription *Namespaces_Topics_Subscription_Spec) SetAzureName(azureName string) { + subscription.AzureName = azureName +} + +type Namespaces_Topics_Subscription_STATUS struct { + // AccessedAt: Last time there was a receive request to this subscription. + AccessedAt *string `json:"accessedAt,omitempty"` + + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // ClientAffineProperties: Properties specific to client affine subscriptions. + ClientAffineProperties *SBClientAffineProperties_STATUS `json:"clientAffineProperties,omitempty"` + + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // CountDetails: Message count details + CountDetails *MessageCountDetails_STATUS `json:"countDetails,omitempty"` + + // CreatedAt: Exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DeadLetteringOnFilterEvaluationExceptions: Value that indicates whether a subscription has dead letter support on filter + // evaluation exceptions. + DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"` + + // DeadLetteringOnMessageExpiration: Value that indicates whether a subscription has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8061 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` + + // IsClientAffine: Value that indicates whether the subscription has an affinity to the client id. + IsClientAffine *bool `json:"isClientAffine,omitempty"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // LockDuration: ISO 8061 lock duration timespan for the subscription. The default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: Number of maximum deliveries. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // MessageCount: Number of messages. + MessageCount *int `json:"messageCount,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // RequiresSession: Value indicating if a subscription supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` + + // Status: Enumerates the possible values for the status of a messaging entity. + Status *EntityStatus_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_Topics_Subscription_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Topics_Subscription_STATUS from the provided source +func (subscription *Namespaces_Topics_Subscription_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20211101s.Namespaces_Topics_Subscription_STATUS) + if ok { + // Populate our instance from source + return subscription.AssignProperties_From_Namespaces_Topics_Subscription_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topics_Subscription_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = subscription.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS +func (subscription *Namespaces_Topics_Subscription_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20211101s.Namespaces_Topics_Subscription_STATUS) + if ok { + // Populate destination from our instance + return subscription.AssignProperties_To_Namespaces_Topics_Subscription_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topics_Subscription_STATUS{} + err := subscription.AssignProperties_To_Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (subscription *Namespaces_Topics_Subscription_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Topics_Subscription_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (subscription *Namespaces_Topics_Subscription_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Topics_Subscription_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Topics_Subscription_STATUS_ARM, got %T", armInput) + } + + // Set property "AccessedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AccessedAt != nil { + accessedAt := *typedInput.Properties.AccessedAt + subscription.AccessedAt = &accessedAt + } + } + + // Set property "AutoDeleteOnIdle": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *typedInput.Properties.AutoDeleteOnIdle + subscription.AutoDeleteOnIdle = &autoDeleteOnIdle + } + } + + // Set property "ClientAffineProperties": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ClientAffineProperties != nil { + var clientAffineProperties1 SBClientAffineProperties_STATUS + err := clientAffineProperties1.PopulateFromARM(owner, *typedInput.Properties.ClientAffineProperties) + if err != nil { + return err + } + clientAffineProperties := clientAffineProperties1 + subscription.ClientAffineProperties = &clientAffineProperties + } + } + + // no assignment for property "Conditions" + + // Set property "CountDetails": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CountDetails != nil { + var countDetails1 MessageCountDetails_STATUS + err := countDetails1.PopulateFromARM(owner, *typedInput.Properties.CountDetails) + if err != nil { + return err + } + countDetails := countDetails1 + subscription.CountDetails = &countDetails + } + } + + // Set property "CreatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CreatedAt != nil { + createdAt := *typedInput.Properties.CreatedAt + subscription.CreatedAt = &createdAt + } + } + + // Set property "DeadLetteringOnFilterEvaluationExceptions": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationExceptions := *typedInput.Properties.DeadLetteringOnFilterEvaluationExceptions + subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationExceptions + } + } + + // Set property "DeadLetteringOnMessageExpiration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *typedInput.Properties.DeadLetteringOnMessageExpiration + subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } + } + + // Set property "DefaultMessageTimeToLive": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *typedInput.Properties.DefaultMessageTimeToLive + subscription.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + } + + // Set property "DuplicateDetectionHistoryTimeWindow": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *typedInput.Properties.DuplicateDetectionHistoryTimeWindow + subscription.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + } + + // Set property "EnableBatchedOperations": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableBatchedOperations != nil { + enableBatchedOperations := *typedInput.Properties.EnableBatchedOperations + subscription.EnableBatchedOperations = &enableBatchedOperations + } + } + + // Set property "ForwardDeadLetteredMessagesTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardDeadLetteredMessagesTo != nil { + forwardDeadLetteredMessagesTo := *typedInput.Properties.ForwardDeadLetteredMessagesTo + subscription.ForwardDeadLetteredMessagesTo = &forwardDeadLetteredMessagesTo + } + } + + // Set property "ForwardTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardTo != nil { + forwardTo := *typedInput.Properties.ForwardTo + subscription.ForwardTo = &forwardTo + } + } + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + subscription.Id = &id + } + + // Set property "IsClientAffine": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.IsClientAffine != nil { + isClientAffine := *typedInput.Properties.IsClientAffine + subscription.IsClientAffine = &isClientAffine + } + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + subscription.Location = &location + } + + // Set property "LockDuration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.LockDuration != nil { + lockDuration := *typedInput.Properties.LockDuration + subscription.LockDuration = &lockDuration + } + } + + // Set property "MaxDeliveryCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxDeliveryCount != nil { + maxDeliveryCount := *typedInput.Properties.MaxDeliveryCount + subscription.MaxDeliveryCount = &maxDeliveryCount + } + } + + // Set property "MessageCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MessageCount != nil { + messageCount := *typedInput.Properties.MessageCount + subscription.MessageCount = &messageCount + } + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + subscription.Name = &name + } + + // Set property "RequiresSession": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresSession != nil { + requiresSession := *typedInput.Properties.RequiresSession + subscription.RequiresSession = &requiresSession + } + } + + // Set property "Status": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Status != nil { + status := *typedInput.Properties.Status + subscription.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 + subscription.SystemData = &systemData + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + subscription.Type = &typeVar + } + + // Set property "UpdatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.UpdatedAt != nil { + updatedAt := *typedInput.Properties.UpdatedAt + subscription.UpdatedAt = &updatedAt + } + } + + // No error + return nil +} + +// AssignProperties_From_Namespaces_Topics_Subscription_STATUS populates our Namespaces_Topics_Subscription_STATUS from the provided source Namespaces_Topics_Subscription_STATUS +func (subscription *Namespaces_Topics_Subscription_STATUS) AssignProperties_From_Namespaces_Topics_Subscription_STATUS(source *v20211101s.Namespaces_Topics_Subscription_STATUS) error { + + // AccessedAt + subscription.AccessedAt = genruntime.ClonePointerToString(source.AccessedAt) + + // AutoDeleteOnIdle + subscription.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // ClientAffineProperties + if source.ClientAffineProperties != nil { + var clientAffineProperty SBClientAffineProperties_STATUS + err := clientAffineProperty.AssignProperties_From_SBClientAffineProperties_STATUS(source.ClientAffineProperties) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBClientAffineProperties_STATUS() to populate field ClientAffineProperties") + } + subscription.ClientAffineProperties = &clientAffineProperty + } else { + subscription.ClientAffineProperties = nil + } + + // Conditions + subscription.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CountDetails + if source.CountDetails != nil { + var countDetail MessageCountDetails_STATUS + err := countDetail.AssignProperties_From_MessageCountDetails_STATUS(source.CountDetails) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_MessageCountDetails_STATUS() to populate field CountDetails") + } + subscription.CountDetails = &countDetail + } else { + subscription.CountDetails = nil + } + + // CreatedAt + subscription.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DeadLetteringOnFilterEvaluationExceptions + if source.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *source.DeadLetteringOnFilterEvaluationExceptions + subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + subscription.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + subscription.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + subscription.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + subscription.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + subscription.EnableBatchedOperations = &enableBatchedOperation + } else { + subscription.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + subscription.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + subscription.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // Id + subscription.Id = genruntime.ClonePointerToString(source.Id) + + // IsClientAffine + if source.IsClientAffine != nil { + isClientAffine := *source.IsClientAffine + subscription.IsClientAffine = &isClientAffine + } else { + subscription.IsClientAffine = nil + } + + // Location + subscription.Location = genruntime.ClonePointerToString(source.Location) + + // LockDuration + subscription.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + subscription.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // MessageCount + subscription.MessageCount = genruntime.ClonePointerToInt(source.MessageCount) + + // Name + subscription.Name = genruntime.ClonePointerToString(source.Name) + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + subscription.RequiresSession = &requiresSession + } else { + subscription.RequiresSession = nil + } + + // Status + if source.Status != nil { + status := EntityStatus_STATUS(*source.Status) + subscription.Status = &status + } else { + subscription.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") + } + subscription.SystemData = &systemDatum + } else { + subscription.SystemData = nil + } + + // Type + subscription.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + subscription.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topics_Subscription_STATUS populates the provided destination Namespaces_Topics_Subscription_STATUS from our Namespaces_Topics_Subscription_STATUS +func (subscription *Namespaces_Topics_Subscription_STATUS) AssignProperties_To_Namespaces_Topics_Subscription_STATUS(destination *v20211101s.Namespaces_Topics_Subscription_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AccessedAt + destination.AccessedAt = genruntime.ClonePointerToString(subscription.AccessedAt) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(subscription.AutoDeleteOnIdle) + + // ClientAffineProperties + if subscription.ClientAffineProperties != nil { + var clientAffineProperty v20211101s.SBClientAffineProperties_STATUS + err := subscription.ClientAffineProperties.AssignProperties_To_SBClientAffineProperties_STATUS(&clientAffineProperty) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBClientAffineProperties_STATUS() to populate field ClientAffineProperties") + } + destination.ClientAffineProperties = &clientAffineProperty + } else { + destination.ClientAffineProperties = nil + } + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(subscription.Conditions) + + // CountDetails + if subscription.CountDetails != nil { + var countDetail v20211101s.MessageCountDetails_STATUS + err := subscription.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_MessageCountDetails_STATUS() to populate field CountDetails") + } + destination.CountDetails = &countDetail + } else { + destination.CountDetails = nil + } + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(subscription.CreatedAt) + + // DeadLetteringOnFilterEvaluationExceptions + if subscription.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *subscription.DeadLetteringOnFilterEvaluationExceptions + destination.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + destination.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if subscription.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *subscription.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(subscription.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(subscription.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if subscription.EnableBatchedOperations != nil { + enableBatchedOperation := *subscription.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(subscription.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(subscription.ForwardTo) + + // Id + destination.Id = genruntime.ClonePointerToString(subscription.Id) + + // IsClientAffine + if subscription.IsClientAffine != nil { + isClientAffine := *subscription.IsClientAffine + destination.IsClientAffine = &isClientAffine + } else { + destination.IsClientAffine = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(subscription.Location) + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(subscription.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(subscription.MaxDeliveryCount) + + // MessageCount + destination.MessageCount = genruntime.ClonePointerToInt(subscription.MessageCount) + + // Name + destination.Name = genruntime.ClonePointerToString(subscription.Name) + + // RequiresSession + if subscription.RequiresSession != nil { + requiresSession := *subscription.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // Status + if subscription.Status != nil { + status := string(*subscription.Status) + destination.Status = &status + } else { + destination.Status = nil + } + + // SystemData + if subscription.SystemData != nil { + var systemDatum v20211101s.SystemData_STATUS + err := subscription.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(subscription.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(subscription.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Properties specific to client affine subscriptions. +type SBClientAffineProperties struct { + // ClientId: Indicates the Client ID of the application that created the client-affine subscription. + ClientId *string `json:"clientId,omitempty"` + + // IsDurable: For client-affine subscriptions, this value indicates whether the subscription is durable or not. + IsDurable *bool `json:"isDurable,omitempty"` + + // IsShared: For client-affine subscriptions, this value indicates whether the subscription is shared or not. + IsShared *bool `json:"isShared,omitempty"` +} + +var _ genruntime.ARMTransformer = &SBClientAffineProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *SBClientAffineProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &SBClientAffineProperties_ARM{} + + // Set property "ClientId": + if properties.ClientId != nil { + clientId := *properties.ClientId + result.ClientId = &clientId + } + + // Set property "IsDurable": + if properties.IsDurable != nil { + isDurable := *properties.IsDurable + result.IsDurable = &isDurable + } + + // Set property "IsShared": + if properties.IsShared != nil { + isShared := *properties.IsShared + result.IsShared = &isShared + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *SBClientAffineProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SBClientAffineProperties_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *SBClientAffineProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SBClientAffineProperties_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SBClientAffineProperties_ARM, got %T", armInput) + } + + // Set property "ClientId": + if typedInput.ClientId != nil { + clientId := *typedInput.ClientId + properties.ClientId = &clientId + } + + // Set property "IsDurable": + if typedInput.IsDurable != nil { + isDurable := *typedInput.IsDurable + properties.IsDurable = &isDurable + } + + // Set property "IsShared": + if typedInput.IsShared != nil { + isShared := *typedInput.IsShared + properties.IsShared = &isShared + } + + // No error + return nil +} + +// AssignProperties_From_SBClientAffineProperties populates our SBClientAffineProperties from the provided source SBClientAffineProperties +func (properties *SBClientAffineProperties) AssignProperties_From_SBClientAffineProperties(source *v20211101s.SBClientAffineProperties) error { + + // ClientId + properties.ClientId = genruntime.ClonePointerToString(source.ClientId) + + // IsDurable + if source.IsDurable != nil { + isDurable := *source.IsDurable + properties.IsDurable = &isDurable + } else { + properties.IsDurable = nil + } + + // IsShared + if source.IsShared != nil { + isShared := *source.IsShared + properties.IsShared = &isShared + } else { + properties.IsShared = nil + } + + // No error + return nil +} + +// AssignProperties_To_SBClientAffineProperties populates the provided destination SBClientAffineProperties from our SBClientAffineProperties +func (properties *SBClientAffineProperties) AssignProperties_To_SBClientAffineProperties(destination *v20211101s.SBClientAffineProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ClientId + destination.ClientId = genruntime.ClonePointerToString(properties.ClientId) + + // IsDurable + if properties.IsDurable != nil { + isDurable := *properties.IsDurable + destination.IsDurable = &isDurable + } else { + destination.IsDurable = nil + } + + // IsShared + if properties.IsShared != nil { + isShared := *properties.IsShared + destination.IsShared = &isShared + } else { + destination.IsShared = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_SBClientAffineProperties_STATUS populates our SBClientAffineProperties from the provided source SBClientAffineProperties_STATUS +func (properties *SBClientAffineProperties) Initialize_From_SBClientAffineProperties_STATUS(source *SBClientAffineProperties_STATUS) error { + + // ClientId + properties.ClientId = genruntime.ClonePointerToString(source.ClientId) + + // IsDurable + if source.IsDurable != nil { + isDurable := *source.IsDurable + properties.IsDurable = &isDurable + } else { + properties.IsDurable = nil + } + + // IsShared + if source.IsShared != nil { + isShared := *source.IsShared + properties.IsShared = &isShared + } else { + properties.IsShared = nil + } + + // No error + return nil +} + +// Properties specific to client affine subscriptions. +type SBClientAffineProperties_STATUS struct { + // ClientId: Indicates the Client ID of the application that created the client-affine subscription. + ClientId *string `json:"clientId,omitempty"` + + // IsDurable: For client-affine subscriptions, this value indicates whether the subscription is durable or not. + IsDurable *bool `json:"isDurable,omitempty"` + + // IsShared: For client-affine subscriptions, this value indicates whether the subscription is shared or not. + IsShared *bool `json:"isShared,omitempty"` +} + +var _ genruntime.FromARMConverter = &SBClientAffineProperties_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *SBClientAffineProperties_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SBClientAffineProperties_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *SBClientAffineProperties_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SBClientAffineProperties_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SBClientAffineProperties_STATUS_ARM, got %T", armInput) + } + + // Set property "ClientId": + if typedInput.ClientId != nil { + clientId := *typedInput.ClientId + properties.ClientId = &clientId + } + + // Set property "IsDurable": + if typedInput.IsDurable != nil { + isDurable := *typedInput.IsDurable + properties.IsDurable = &isDurable + } + + // Set property "IsShared": + if typedInput.IsShared != nil { + isShared := *typedInput.IsShared + properties.IsShared = &isShared + } + + // No error + return nil +} + +// AssignProperties_From_SBClientAffineProperties_STATUS populates our SBClientAffineProperties_STATUS from the provided source SBClientAffineProperties_STATUS +func (properties *SBClientAffineProperties_STATUS) AssignProperties_From_SBClientAffineProperties_STATUS(source *v20211101s.SBClientAffineProperties_STATUS) error { + + // ClientId + properties.ClientId = genruntime.ClonePointerToString(source.ClientId) + + // IsDurable + if source.IsDurable != nil { + isDurable := *source.IsDurable + properties.IsDurable = &isDurable + } else { + properties.IsDurable = nil + } + + // IsShared + if source.IsShared != nil { + isShared := *source.IsShared + properties.IsShared = &isShared + } else { + properties.IsShared = nil + } + + // No error + return nil +} + +// AssignProperties_To_SBClientAffineProperties_STATUS populates the provided destination SBClientAffineProperties_STATUS from our SBClientAffineProperties_STATUS +func (properties *SBClientAffineProperties_STATUS) AssignProperties_To_SBClientAffineProperties_STATUS(destination *v20211101s.SBClientAffineProperties_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ClientId + destination.ClientId = genruntime.ClonePointerToString(properties.ClientId) + + // IsDurable + if properties.IsDurable != nil { + isDurable := *properties.IsDurable + destination.IsDurable = &isDurable + } else { + destination.IsDurable = nil + } + + // IsShared + if properties.IsShared != nil { + isShared := *properties.IsShared + destination.IsShared = &isShared + } else { + destination.IsShared = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&NamespacesTopicsSubscription{}, &NamespacesTopicsSubscriptionList{}) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen_test.go new file mode 100644 index 00000000000..e3dfcbaa3a1 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen_test.go @@ -0,0 +1,653 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesTopicsSubscription, NamespacesTopicsSubscriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesTopicsSubscription tests if a specific instance of NamespacesTopicsSubscription round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesTopicsSubscription(subject NamespacesTopicsSubscription) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesTopicsSubscription + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesTopicsSubscription + 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_NamespacesTopicsSubscription_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscription to NamespacesTopicsSubscription via AssignProperties_To_NamespacesTopicsSubscription & AssignProperties_From_NamespacesTopicsSubscription returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscription, NamespacesTopicsSubscriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscription tests if a specific instance of NamespacesTopicsSubscription can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscription(subject NamespacesTopicsSubscription) 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.NamespacesTopicsSubscription + err := copied.AssignProperties_To_NamespacesTopicsSubscription(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscription + err = actual.AssignProperties_From_NamespacesTopicsSubscription(&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_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscription, NamespacesTopicsSubscriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscription runs a test to see if a specific instance of NamespacesTopicsSubscription round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscription(subject NamespacesTopicsSubscription) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscription + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicsSubscription instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionGenerator() +var namespacesTopicsSubscriptionGenerator gopter.Gen + +// NamespacesTopicsSubscriptionGenerator returns a generator of NamespacesTopicsSubscription instances for property testing. +func NamespacesTopicsSubscriptionGenerator() gopter.Gen { + if namespacesTopicsSubscriptionGenerator != nil { + return namespacesTopicsSubscriptionGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription(generators) + namespacesTopicsSubscriptionGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription{}), generators) + + return namespacesTopicsSubscriptionGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Topics_Subscription_SpecGenerator() + gens["Status"] = Namespaces_Topics_Subscription_STATUSGenerator() +} + +func Test_Namespaces_Topics_Subscription_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscription_Spec to Namespaces_Topics_Subscription_Spec via AssignProperties_To_Namespaces_Topics_Subscription_Spec & AssignProperties_From_Namespaces_Topics_Subscription_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscription_Spec, Namespaces_Topics_Subscription_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscription_Spec tests if a specific instance of Namespaces_Topics_Subscription_Spec can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscription_Spec(subject Namespaces_Topics_Subscription_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 v20211101s.Namespaces_Topics_Subscription_Spec + err := copied.AssignProperties_To_Namespaces_Topics_Subscription_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscription_Spec + err = actual.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_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_Topics_Subscription_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec, Namespaces_Topics_Subscription_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec runs a test to see if a specific instance of Namespaces_Topics_Subscription_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec(subject Namespaces_Topics_Subscription_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscription_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_Topics_Subscription_Spec instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscription_SpecGenerator() +var namespaces_Topics_Subscription_SpecGenerator gopter.Gen + +// Namespaces_Topics_Subscription_SpecGenerator returns a generator of Namespaces_Topics_Subscription_Spec instances for property testing. +// We first initialize namespaces_Topics_Subscription_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_Topics_Subscription_SpecGenerator() gopter.Gen { + if namespaces_Topics_Subscription_SpecGenerator != nil { + return namespaces_Topics_Subscription_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(generators) + namespaces_Topics_Subscription_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(generators) + namespaces_Topics_Subscription_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_Spec{}), generators) + + return namespaces_Topics_Subscription_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DeadLetteringOnFilterEvaluationExceptions"] = gen.PtrOf(gen.Bool()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["IsClientAffine"] = gen.PtrOf(gen.Bool()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffinePropertiesGenerator()) +} + +func Test_Namespaces_Topics_Subscription_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscription_STATUS to Namespaces_Topics_Subscription_STATUS via AssignProperties_To_Namespaces_Topics_Subscription_STATUS & AssignProperties_From_Namespaces_Topics_Subscription_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscription_STATUS, Namespaces_Topics_Subscription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscription_STATUS tests if a specific instance of Namespaces_Topics_Subscription_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscription_STATUS(subject Namespaces_Topics_Subscription_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 v20211101s.Namespaces_Topics_Subscription_STATUS + err := copied.AssignProperties_To_Namespaces_Topics_Subscription_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscription_STATUS + err = actual.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_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_Topics_Subscription_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS, Namespaces_Topics_Subscription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS runs a test to see if a specific instance of Namespaces_Topics_Subscription_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS(subject Namespaces_Topics_Subscription_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscription_STATUSGenerator() +var namespaces_Topics_Subscription_STATUSGenerator gopter.Gen + +// Namespaces_Topics_Subscription_STATUSGenerator returns a generator of Namespaces_Topics_Subscription_STATUS instances for property testing. +// We first initialize namespaces_Topics_Subscription_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_Topics_Subscription_STATUSGenerator() gopter.Gen { + if namespaces_Topics_Subscription_STATUSGenerator != nil { + return namespaces_Topics_Subscription_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(generators) + namespaces_Topics_Subscription_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(generators) + namespaces_Topics_Subscription_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_STATUS{}), generators) + + return namespaces_Topics_Subscription_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnFilterEvaluationExceptions"] = gen.PtrOf(gen.Bool()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["IsClientAffine"] = gen.PtrOf(gen.Bool()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MessageCount"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + EntityStatus_STATUS_Active, + EntityStatus_STATUS_Creating, + EntityStatus_STATUS_Deleting, + EntityStatus_STATUS_Disabled, + EntityStatus_STATUS_ReceiveDisabled, + EntityStatus_STATUS_Renaming, + EntityStatus_STATUS_Restoring, + EntityStatus_STATUS_SendDisabled, + EntityStatus_STATUS_Unknown)) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffineProperties_STATUSGenerator()) + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_SBClientAffineProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBClientAffineProperties to SBClientAffineProperties via AssignProperties_To_SBClientAffineProperties & AssignProperties_From_SBClientAffineProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForSBClientAffineProperties, SBClientAffinePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBClientAffineProperties tests if a specific instance of SBClientAffineProperties can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSBClientAffineProperties(subject SBClientAffineProperties) 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.SBClientAffineProperties + err := copied.AssignProperties_To_SBClientAffineProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBClientAffineProperties + err = actual.AssignProperties_From_SBClientAffineProperties(&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_SBClientAffineProperties_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 SBClientAffineProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBClientAffineProperties, SBClientAffinePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBClientAffineProperties runs a test to see if a specific instance of SBClientAffineProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForSBClientAffineProperties(subject SBClientAffineProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBClientAffineProperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SBClientAffineProperties instances for property testing - lazily instantiated by +// SBClientAffinePropertiesGenerator() +var sbClientAffinePropertiesGenerator gopter.Gen + +// SBClientAffinePropertiesGenerator returns a generator of SBClientAffineProperties instances for property testing. +func SBClientAffinePropertiesGenerator() gopter.Gen { + if sbClientAffinePropertiesGenerator != nil { + return sbClientAffinePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBClientAffineProperties(generators) + sbClientAffinePropertiesGenerator = gen.Struct(reflect.TypeOf(SBClientAffineProperties{}), generators) + + return sbClientAffinePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForSBClientAffineProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBClientAffineProperties(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["IsDurable"] = gen.PtrOf(gen.Bool()) + gens["IsShared"] = gen.PtrOf(gen.Bool()) +} + +func Test_SBClientAffineProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBClientAffineProperties_STATUS to SBClientAffineProperties_STATUS via AssignProperties_To_SBClientAffineProperties_STATUS & AssignProperties_From_SBClientAffineProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSBClientAffineProperties_STATUS, SBClientAffineProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBClientAffineProperties_STATUS tests if a specific instance of SBClientAffineProperties_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSBClientAffineProperties_STATUS(subject SBClientAffineProperties_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 v20211101s.SBClientAffineProperties_STATUS + err := copied.AssignProperties_To_SBClientAffineProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBClientAffineProperties_STATUS + err = actual.AssignProperties_From_SBClientAffineProperties_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_SBClientAffineProperties_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 SBClientAffineProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBClientAffineProperties_STATUS, SBClientAffineProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBClientAffineProperties_STATUS runs a test to see if a specific instance of SBClientAffineProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSBClientAffineProperties_STATUS(subject SBClientAffineProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBClientAffineProperties_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 SBClientAffineProperties_STATUS instances for property testing - lazily instantiated by +// SBClientAffineProperties_STATUSGenerator() +var sbClientAffineProperties_STATUSGenerator gopter.Gen + +// SBClientAffineProperties_STATUSGenerator returns a generator of SBClientAffineProperties_STATUS instances for property testing. +func SBClientAffineProperties_STATUSGenerator() gopter.Gen { + if sbClientAffineProperties_STATUSGenerator != nil { + return sbClientAffineProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS(generators) + sbClientAffineProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(SBClientAffineProperties_STATUS{}), generators) + + return sbClientAffineProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["IsDurable"] = gen.PtrOf(gen.Bool()) + gens["IsShared"] = gen.PtrOf(gen.Bool()) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_spec_arm_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_spec_arm_types_gen.go new file mode 100644 index 00000000000..4f41a92e2b4 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_spec_arm_types_gen.go @@ -0,0 +1,106 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_Topics_Subscriptions_Rule_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: Properties of Rule resource + Properties *Ruleproperties_ARM `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespaces_Topics_Subscriptions_Rule_Spec_ARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01" +func (rule Namespaces_Topics_Subscriptions_Rule_Spec_ARM) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetName returns the Name of the resource +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec_ARM) GetName() string { + return rule.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec_ARM) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +} + +// Description of Rule Resource. +type Ruleproperties_ARM struct { + // Action: Represents the filter actions which are allowed for the transformation of a message that have been matched by a + // filter expression. + Action *Action_ARM `json:"action,omitempty"` + + // CorrelationFilter: Properties of correlationFilter + CorrelationFilter *CorrelationFilter_ARM `json:"correlationFilter,omitempty"` + + // FilterType: Filter type that is evaluated against a BrokeredMessage. + FilterType *FilterType `json:"filterType,omitempty"` + + // SqlFilter: Properties of sqlFilter + SqlFilter *SqlFilter_ARM `json:"sqlFilter,omitempty"` +} + +// Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter +// expression. +type Action_ARM struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +// Represents the correlation filter expression. +type CorrelationFilter_ARM struct { + // ContentType: Content type of the message. + ContentType *string `json:"contentType,omitempty"` + + // CorrelationId: Identifier of the correlation. + CorrelationId *string `json:"correlationId,omitempty"` + + // Label: Application specific label. + Label *string `json:"label,omitempty"` + + // MessageId: Identifier of the message. + MessageId *string `json:"messageId,omitempty"` + + // Properties: dictionary object for custom filters + Properties map[string]string `json:"properties,omitempty"` + + // ReplyTo: Address of the queue to reply to. + ReplyTo *string `json:"replyTo,omitempty"` + + // ReplyToSessionId: Session identifier to reply to. + ReplyToSessionId *string `json:"replyToSessionId,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SessionId: Session identifier. + SessionId *string `json:"sessionId,omitempty"` + + // To: Address to send to. + To *string `json:"to,omitempty"` +} + +// Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. +type SqlFilter_ARM struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: The SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_spec_arm_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..521e01aa36b --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_spec_arm_types_gen_test.go @@ -0,0 +1,363 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec_ARM, Namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec_ARM runs a test to see if a specific instance of Namespaces_Topics_Subscriptions_Rule_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec_ARM(subject Namespaces_Topics_Subscriptions_Rule_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator() +var namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator gopter.Gen + +// Namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator returns a generator of Namespaces_Topics_Subscriptions_Rule_Spec_ARM instances for property testing. +// We first initialize namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec_ARMGenerator() gopter.Gen { + if namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator != nil { + return namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM(generators) + namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM(generators) + namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_Spec_ARM{}), generators) + + return namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Ruleproperties_ARMGenerator()) +} + +func Test_Ruleproperties_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 Ruleproperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRuleproperties_ARM, Ruleproperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRuleproperties_ARM runs a test to see if a specific instance of Ruleproperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForRuleproperties_ARM(subject Ruleproperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Ruleproperties_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 Ruleproperties_ARM instances for property testing - lazily instantiated by Ruleproperties_ARMGenerator() +var ruleproperties_ARMGenerator gopter.Gen + +// Ruleproperties_ARMGenerator returns a generator of Ruleproperties_ARM instances for property testing. +// We first initialize ruleproperties_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 Ruleproperties_ARMGenerator() gopter.Gen { + if ruleproperties_ARMGenerator != nil { + return ruleproperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleproperties_ARM(generators) + ruleproperties_ARMGenerator = gen.Struct(reflect.TypeOf(Ruleproperties_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleproperties_ARM(generators) + AddRelatedPropertyGeneratorsForRuleproperties_ARM(generators) + ruleproperties_ARMGenerator = gen.Struct(reflect.TypeOf(Ruleproperties_ARM{}), generators) + + return ruleproperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForRuleproperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRuleproperties_ARM(gens map[string]gopter.Gen) { + gens["FilterType"] = gen.PtrOf(gen.OneConstOf(FilterType_CorrelationFilter, FilterType_SqlFilter)) +} + +// AddRelatedPropertyGeneratorsForRuleproperties_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForRuleproperties_ARM(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(Action_ARMGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilter_ARMGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilter_ARMGenerator()) +} + +func Test_Action_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 Action_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAction_ARM, Action_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAction_ARM runs a test to see if a specific instance of Action_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForAction_ARM(subject Action_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Action_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 Action_ARM instances for property testing - lazily instantiated by Action_ARMGenerator() +var action_ARMGenerator gopter.Gen + +// Action_ARMGenerator returns a generator of Action_ARM instances for property testing. +func Action_ARMGenerator() gopter.Gen { + if action_ARMGenerator != nil { + return action_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAction_ARM(generators) + action_ARMGenerator = gen.Struct(reflect.TypeOf(Action_ARM{}), generators) + + return action_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForAction_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAction_ARM(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CorrelationFilter_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 CorrelationFilter_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCorrelationFilter_ARM, CorrelationFilter_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCorrelationFilter_ARM runs a test to see if a specific instance of CorrelationFilter_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForCorrelationFilter_ARM(subject CorrelationFilter_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CorrelationFilter_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 CorrelationFilter_ARM instances for property testing - lazily instantiated by +// CorrelationFilter_ARMGenerator() +var correlationFilter_ARMGenerator gopter.Gen + +// CorrelationFilter_ARMGenerator returns a generator of CorrelationFilter_ARM instances for property testing. +func CorrelationFilter_ARMGenerator() gopter.Gen { + if correlationFilter_ARMGenerator != nil { + return correlationFilter_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCorrelationFilter_ARM(generators) + correlationFilter_ARMGenerator = gen.Struct(reflect.TypeOf(CorrelationFilter_ARM{}), generators) + + return correlationFilter_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForCorrelationFilter_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCorrelationFilter_ARM(gens map[string]gopter.Gen) { + gens["ContentType"] = gen.PtrOf(gen.AlphaString()) + gens["CorrelationId"] = gen.PtrOf(gen.AlphaString()) + gens["Label"] = gen.PtrOf(gen.AlphaString()) + gens["MessageId"] = gen.PtrOf(gen.AlphaString()) + gens["Properties"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ReplyTo"] = gen.PtrOf(gen.AlphaString()) + gens["ReplyToSessionId"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SessionId"] = gen.PtrOf(gen.AlphaString()) + gens["To"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SqlFilter_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 SqlFilter_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSqlFilter_ARM, SqlFilter_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSqlFilter_ARM runs a test to see if a specific instance of SqlFilter_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSqlFilter_ARM(subject SqlFilter_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SqlFilter_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 SqlFilter_ARM instances for property testing - lazily instantiated by SqlFilter_ARMGenerator() +var sqlFilter_ARMGenerator gopter.Gen + +// SqlFilter_ARMGenerator returns a generator of SqlFilter_ARM instances for property testing. +func SqlFilter_ARMGenerator() gopter.Gen { + if sqlFilter_ARMGenerator != nil { + return sqlFilter_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSqlFilter_ARM(generators) + sqlFilter_ARMGenerator = gen.Struct(reflect.TypeOf(SqlFilter_ARM{}), generators) + + return sqlFilter_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSqlFilter_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSqlFilter_ARM(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_status_arm_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_status_arm_types_gen.go new file mode 100644 index 00000000000..94d1f266e82 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_status_arm_types_gen.go @@ -0,0 +1,101 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +type Namespaces_Topics_Subscriptions_Rule_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 of Rule resource + Properties *Ruleproperties_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"` +} + +// Description of Rule Resource. +type Ruleproperties_STATUS_ARM struct { + // Action: Represents the filter actions which are allowed for the transformation of a message that have been matched by a + // filter expression. + Action *Action_STATUS_ARM `json:"action,omitempty"` + + // CorrelationFilter: Properties of correlationFilter + CorrelationFilter *CorrelationFilter_STATUS_ARM `json:"correlationFilter,omitempty"` + + // FilterType: Filter type that is evaluated against a BrokeredMessage. + FilterType *FilterType_STATUS `json:"filterType,omitempty"` + + // SqlFilter: Properties of sqlFilter + SqlFilter *SqlFilter_STATUS_ARM `json:"sqlFilter,omitempty"` +} + +// Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter +// expression. +type Action_STATUS_ARM struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +// Represents the correlation filter expression. +type CorrelationFilter_STATUS_ARM struct { + // ContentType: Content type of the message. + ContentType *string `json:"contentType,omitempty"` + + // CorrelationId: Identifier of the correlation. + CorrelationId *string `json:"correlationId,omitempty"` + + // Label: Application specific label. + Label *string `json:"label,omitempty"` + + // MessageId: Identifier of the message. + MessageId *string `json:"messageId,omitempty"` + + // Properties: dictionary object for custom filters + Properties map[string]string `json:"properties,omitempty"` + + // ReplyTo: Address of the queue to reply to. + ReplyTo *string `json:"replyTo,omitempty"` + + // ReplyToSessionId: Session identifier to reply to. + ReplyToSessionId *string `json:"replyToSessionId,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SessionId: Session identifier. + SessionId *string `json:"sessionId,omitempty"` + + // To: Address to send to. + To *string `json:"to,omitempty"` +} + +// Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. +type SqlFilter_STATUS_ARM struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: The SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_status_arm_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_status_arm_types_gen_test.go new file mode 100644 index 00000000000..71ecaa631da --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_status_arm_types_gen_test.go @@ -0,0 +1,369 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM, Namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM runs a test to see if a specific instance of Namespaces_Topics_Subscriptions_Rule_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM(subject Namespaces_Topics_Subscriptions_Rule_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS_ARM instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator() +var namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator returns a generator of Namespaces_Topics_Subscriptions_Rule_STATUS_ARM instances for property testing. +// We first initialize namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator != nil { + return namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM(generators) + namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM(generators) + namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_STATUS_ARM{}), generators) + + return namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Ruleproperties_STATUS_ARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) +} + +func Test_Ruleproperties_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 Ruleproperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRuleproperties_STATUS_ARM, Ruleproperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRuleproperties_STATUS_ARM runs a test to see if a specific instance of Ruleproperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForRuleproperties_STATUS_ARM(subject Ruleproperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Ruleproperties_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 Ruleproperties_STATUS_ARM instances for property testing - lazily instantiated by +// Ruleproperties_STATUS_ARMGenerator() +var ruleproperties_STATUS_ARMGenerator gopter.Gen + +// Ruleproperties_STATUS_ARMGenerator returns a generator of Ruleproperties_STATUS_ARM instances for property testing. +// We first initialize ruleproperties_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 Ruleproperties_STATUS_ARMGenerator() gopter.Gen { + if ruleproperties_STATUS_ARMGenerator != nil { + return ruleproperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleproperties_STATUS_ARM(generators) + ruleproperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Ruleproperties_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleproperties_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForRuleproperties_STATUS_ARM(generators) + ruleproperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Ruleproperties_STATUS_ARM{}), generators) + + return ruleproperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForRuleproperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRuleproperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["FilterType"] = gen.PtrOf(gen.OneConstOf(FilterType_STATUS_CorrelationFilter, FilterType_STATUS_SqlFilter)) +} + +// AddRelatedPropertyGeneratorsForRuleproperties_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForRuleproperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(Action_STATUS_ARMGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilter_STATUS_ARMGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilter_STATUS_ARMGenerator()) +} + +func Test_Action_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 Action_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAction_STATUS_ARM, Action_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAction_STATUS_ARM runs a test to see if a specific instance of Action_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForAction_STATUS_ARM(subject Action_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Action_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 Action_STATUS_ARM instances for property testing - lazily instantiated by Action_STATUS_ARMGenerator() +var action_STATUS_ARMGenerator gopter.Gen + +// Action_STATUS_ARMGenerator returns a generator of Action_STATUS_ARM instances for property testing. +func Action_STATUS_ARMGenerator() gopter.Gen { + if action_STATUS_ARMGenerator != nil { + return action_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAction_STATUS_ARM(generators) + action_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Action_STATUS_ARM{}), generators) + + return action_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForAction_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAction_STATUS_ARM(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CorrelationFilter_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 CorrelationFilter_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCorrelationFilter_STATUS_ARM, CorrelationFilter_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCorrelationFilter_STATUS_ARM runs a test to see if a specific instance of CorrelationFilter_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForCorrelationFilter_STATUS_ARM(subject CorrelationFilter_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CorrelationFilter_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 CorrelationFilter_STATUS_ARM instances for property testing - lazily instantiated by +// CorrelationFilter_STATUS_ARMGenerator() +var correlationFilter_STATUS_ARMGenerator gopter.Gen + +// CorrelationFilter_STATUS_ARMGenerator returns a generator of CorrelationFilter_STATUS_ARM instances for property testing. +func CorrelationFilter_STATUS_ARMGenerator() gopter.Gen { + if correlationFilter_STATUS_ARMGenerator != nil { + return correlationFilter_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS_ARM(generators) + correlationFilter_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(CorrelationFilter_STATUS_ARM{}), generators) + + return correlationFilter_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS_ARM(gens map[string]gopter.Gen) { + gens["ContentType"] = gen.PtrOf(gen.AlphaString()) + gens["CorrelationId"] = gen.PtrOf(gen.AlphaString()) + gens["Label"] = gen.PtrOf(gen.AlphaString()) + gens["MessageId"] = gen.PtrOf(gen.AlphaString()) + gens["Properties"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ReplyTo"] = gen.PtrOf(gen.AlphaString()) + gens["ReplyToSessionId"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SessionId"] = gen.PtrOf(gen.AlphaString()) + gens["To"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SqlFilter_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 SqlFilter_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSqlFilter_STATUS_ARM, SqlFilter_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSqlFilter_STATUS_ARM runs a test to see if a specific instance of SqlFilter_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSqlFilter_STATUS_ARM(subject SqlFilter_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SqlFilter_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 SqlFilter_STATUS_ARM instances for property testing - lazily instantiated by +// SqlFilter_STATUS_ARMGenerator() +var sqlFilter_STATUS_ARMGenerator gopter.Gen + +// SqlFilter_STATUS_ARMGenerator returns a generator of SqlFilter_STATUS_ARM instances for property testing. +func SqlFilter_STATUS_ARMGenerator() gopter.Gen { + if sqlFilter_STATUS_ARMGenerator != nil { + return sqlFilter_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSqlFilter_STATUS_ARM(generators) + sqlFilter_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SqlFilter_STATUS_ARM{}), generators) + + return sqlFilter_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSqlFilter_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSqlFilter_STATUS_ARM(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_types_gen.go new file mode 100644 index 00000000000..ce632b4aba3 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_types_gen.go @@ -0,0 +1,2107 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/Rules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName} +type NamespacesTopicsSubscriptionsRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Topics_Subscriptions_Rule_Spec `json:"spec,omitempty"` + Status Namespaces_Topics_Subscriptions_Rule_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesTopicsSubscriptionsRule{} + +// GetConditions returns the conditions of the resource +func (rule *NamespacesTopicsSubscriptionsRule) GetConditions() conditions.Conditions { + return rule.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (rule *NamespacesTopicsSubscriptionsRule) SetConditions(conditions conditions.Conditions) { + rule.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesTopicsSubscriptionsRule{} + +// ConvertFrom populates our NamespacesTopicsSubscriptionsRule from the provided hub NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20211101s.NamespacesTopicsSubscriptionsRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + } + + return rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule(source) +} + +// ConvertTo populates the provided hub NamespacesTopicsSubscriptionsRule from our NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20211101s.NamespacesTopicsSubscriptionsRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(destination) +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20211101-namespacestopicssubscriptionsrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptionsrules,verbs=create;update,versions=v1api20211101,name=default.v1api20211101.namespacestopicssubscriptionsrules.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &NamespacesTopicsSubscriptionsRule{} + +// Default applies defaults to the NamespacesTopicsSubscriptionsRule resource +func (rule *NamespacesTopicsSubscriptionsRule) 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 *NamespacesTopicsSubscriptionsRule) defaultAzureName() { + if rule.Spec.AzureName == "" { + rule.Spec.AzureName = rule.Name + } +} + +// defaultImpl applies the code generated defaults to the NamespacesTopicsSubscriptionsRule resource +func (rule *NamespacesTopicsSubscriptionsRule) defaultImpl() { rule.defaultAzureName() } + +var _ genruntime.ImportableResource = &NamespacesTopicsSubscriptionsRule{} + +// InitializeSpec initializes the spec for this resource from the given status +func (rule *NamespacesTopicsSubscriptionsRule) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespaces_Topics_Subscriptions_Rule_STATUS); ok { + return rule.Spec.Initialize_From_Namespaces_Topics_Subscriptions_Rule_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespaces_Topics_Subscriptions_Rule_STATUS but received %T instead", status) +} + +var _ genruntime.KubernetesResource = &NamespacesTopicsSubscriptionsRule{} + +// AzureName returns the Azure name of the resource +func (rule *NamespacesTopicsSubscriptionsRule) AzureName() string { + return rule.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01" +func (rule NamespacesTopicsSubscriptionsRule) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (rule *NamespacesTopicsSubscriptionsRule) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (rule *NamespacesTopicsSubscriptionsRule) GetSpec() genruntime.ConvertibleSpec { + return &rule.Spec +} + +// GetStatus returns the status of this resource +func (rule *NamespacesTopicsSubscriptionsRule) GetStatus() genruntime.ConvertibleStatus { + return &rule.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +func (rule *NamespacesTopicsSubscriptionsRule) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +} + +// NewEmptyStatus returns a new empty (blank) status +func (rule *NamespacesTopicsSubscriptionsRule) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Topics_Subscriptions_Rule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *NamespacesTopicsSubscriptionsRule) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: rule.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (rule *NamespacesTopicsSubscriptionsRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Topics_Subscriptions_Rule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Topics_Subscriptions_Rule_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-servicebus-azure-com-v1api20211101-namespacestopicssubscriptionsrule,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptionsrules,verbs=create;update,versions=v1api20211101,name=validate.v1api20211101.namespacestopicssubscriptionsrules.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &NamespacesTopicsSubscriptionsRule{} + +// ValidateCreate validates the creation of the resource +func (rule *NamespacesTopicsSubscriptionsRule) 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 *NamespacesTopicsSubscriptionsRule) 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 *NamespacesTopicsSubscriptionsRule) 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 *NamespacesTopicsSubscriptionsRule) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){rule.validateResourceReferences} +} + +// deleteValidations validates the deletion of the resource +func (rule *NamespacesTopicsSubscriptionsRule) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (rule *NamespacesTopicsSubscriptionsRule) 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} +} + +// validateResourceReferences validates all resource references +func (rule *NamespacesTopicsSubscriptionsRule) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&rule.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (rule *NamespacesTopicsSubscriptionsRule) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*NamespacesTopicsSubscriptionsRule) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, rule) +} + +// AssignProperties_From_NamespacesTopicsSubscriptionsRule populates our NamespacesTopicsSubscriptionsRule from the provided source NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) AssignProperties_From_NamespacesTopicsSubscriptionsRule(source *v20211101s.NamespacesTopicsSubscriptionsRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Topics_Subscriptions_Rule_Spec + err := spec.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status Namespaces_Topics_Subscriptions_Rule_STATUS + err = status.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS() to populate field Status") + } + rule.Status = status + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscriptionsRule populates the provided destination NamespacesTopicsSubscriptionsRule from our NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) AssignProperties_To_NamespacesTopicsSubscriptionsRule(destination *v20211101s.NamespacesTopicsSubscriptionsRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec + err := rule.Spec.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS + err = rule.Status.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_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 *NamespacesTopicsSubscriptionsRule) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: rule.Spec.OriginalVersion(), + Kind: "NamespacesTopicsSubscriptionsRule", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/Rules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName} +type NamespacesTopicsSubscriptionsRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesTopicsSubscriptionsRule `json:"items"` +} + +type Namespaces_Topics_Subscriptions_Rule_Spec struct { + // Action: Represents the filter actions which are allowed for the transformation of a message that have been matched by a + // filter expression. + Action *Action `json:"action,omitempty"` + + // +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"` + + // CorrelationFilter: Properties of correlationFilter + CorrelationFilter *CorrelationFilter `json:"correlationFilter,omitempty"` + + // FilterType: Filter type that is evaluated against a BrokeredMessage. + FilterType *FilterType `json:"filterType,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 servicebus.azure.com/NamespacesTopicsSubscription resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"NamespacesTopicsSubscription"` + + // SqlFilter: Properties of sqlFilter + SqlFilter *SqlFilter `json:"sqlFilter,omitempty"` +} + +var _ genruntime.ARMTransformer = &Namespaces_Topics_Subscriptions_Rule_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if rule == nil { + return nil, nil + } + result := &Namespaces_Topics_Subscriptions_Rule_Spec_ARM{} + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if rule.Action != nil || + rule.CorrelationFilter != nil || + rule.FilterType != nil || + rule.SqlFilter != nil { + result.Properties = &Ruleproperties_ARM{} + } + if rule.Action != nil { + action_ARM, err := (*rule.Action).ConvertToARM(resolved) + if err != nil { + return nil, err + } + action := *action_ARM.(*Action_ARM) + result.Properties.Action = &action + } + if rule.CorrelationFilter != nil { + correlationFilter_ARM, err := (*rule.CorrelationFilter).ConvertToARM(resolved) + if err != nil { + return nil, err + } + correlationFilter := *correlationFilter_ARM.(*CorrelationFilter_ARM) + result.Properties.CorrelationFilter = &correlationFilter + } + if rule.FilterType != nil { + filterType := *rule.FilterType + result.Properties.FilterType = &filterType + } + if rule.SqlFilter != nil { + sqlFilter_ARM, err := (*rule.SqlFilter).ConvertToARM(resolved) + if err != nil { + return nil, err + } + sqlFilter := *sqlFilter_ARM.(*SqlFilter_ARM) + result.Properties.SqlFilter = &sqlFilter + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Topics_Subscriptions_Rule_Spec_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Topics_Subscriptions_Rule_Spec_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Topics_Subscriptions_Rule_Spec_ARM, got %T", armInput) + } + + // Set property "Action": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Action != nil { + var action1 Action + err := action1.PopulateFromARM(owner, *typedInput.Properties.Action) + if err != nil { + return err + } + action := action1 + rule.Action = &action + } + } + + // Set property "AzureName": + rule.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // Set property "CorrelationFilter": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CorrelationFilter != nil { + var correlationFilter1 CorrelationFilter + err := correlationFilter1.PopulateFromARM(owner, *typedInput.Properties.CorrelationFilter) + if err != nil { + return err + } + correlationFilter := correlationFilter1 + rule.CorrelationFilter = &correlationFilter + } + } + + // Set property "FilterType": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.FilterType != nil { + filterType := *typedInput.Properties.FilterType + rule.FilterType = &filterType + } + } + + // Set property "Owner": + rule.Owner = &genruntime.KnownResourceReference{Name: owner.Name} + + // Set property "SqlFilter": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SqlFilter != nil { + var sqlFilter1 SqlFilter + err := sqlFilter1.PopulateFromARM(owner, *typedInput.Properties.SqlFilter) + if err != nil { + return err + } + sqlFilter := sqlFilter1 + rule.SqlFilter = &sqlFilter + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Topics_Subscriptions_Rule_Spec{} + +// ConvertSpecFrom populates our Namespaces_Topics_Subscriptions_Rule_Spec from the provided source +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec{} + err := rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec populates our Namespaces_Topics_Subscriptions_Rule_Spec from the provided source Namespaces_Topics_Subscriptions_Rule_Spec +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec(source *v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) error { + + // Action + if source.Action != nil { + var action Action + err := action.AssignProperties_From_Action(source.Action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Action() to populate field Action") + } + rule.Action = &action + } else { + rule.Action = nil + } + + // AzureName + rule.AzureName = source.AzureName + + // CorrelationFilter + if source.CorrelationFilter != nil { + var correlationFilter CorrelationFilter + err := correlationFilter.AssignProperties_From_CorrelationFilter(source.CorrelationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CorrelationFilter() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil + } + + // FilterType + if source.FilterType != nil { + filterType := FilterType(*source.FilterType) + rule.FilterType = &filterType + } else { + rule.FilterType = nil + } + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + rule.Owner = &owner + } else { + rule.Owner = nil + } + + // SqlFilter + if source.SqlFilter != nil { + var sqlFilter SqlFilter + err := sqlFilter.AssignProperties_From_SqlFilter(source.SqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SqlFilter() to populate field SqlFilter") + } + rule.SqlFilter = &sqlFilter + } else { + rule.SqlFilter = nil + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec populates the provided destination Namespaces_Topics_Subscriptions_Rule_Spec from our Namespaces_Topics_Subscriptions_Rule_Spec +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(destination *v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Action + if rule.Action != nil { + var action v20211101s.Action + err := rule.Action.AssignProperties_To_Action(&action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Action() to populate field Action") + } + destination.Action = &action + } else { + destination.Action = nil + } + + // AzureName + destination.AzureName = rule.AzureName + + // CorrelationFilter + if rule.CorrelationFilter != nil { + var correlationFilter v20211101s.CorrelationFilter + err := rule.CorrelationFilter.AssignProperties_To_CorrelationFilter(&correlationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CorrelationFilter() to populate field CorrelationFilter") + } + destination.CorrelationFilter = &correlationFilter + } else { + destination.CorrelationFilter = nil + } + + // FilterType + if rule.FilterType != nil { + filterType := string(*rule.FilterType) + destination.FilterType = &filterType + } else { + destination.FilterType = nil + } + + // OriginalVersion + destination.OriginalVersion = rule.OriginalVersion() + + // Owner + if rule.Owner != nil { + owner := rule.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // SqlFilter + if rule.SqlFilter != nil { + var sqlFilter v20211101s.SqlFilter + err := rule.SqlFilter.AssignProperties_To_SqlFilter(&sqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SqlFilter() to populate field SqlFilter") + } + destination.SqlFilter = &sqlFilter + } else { + destination.SqlFilter = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Namespaces_Topics_Subscriptions_Rule_STATUS populates our Namespaces_Topics_Subscriptions_Rule_Spec from the provided source Namespaces_Topics_Subscriptions_Rule_STATUS +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) Initialize_From_Namespaces_Topics_Subscriptions_Rule_STATUS(source *Namespaces_Topics_Subscriptions_Rule_STATUS) error { + + // Action + if source.Action != nil { + var action Action + err := action.Initialize_From_Action_STATUS(source.Action) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_Action_STATUS() to populate field Action") + } + rule.Action = &action + } else { + rule.Action = nil + } + + // CorrelationFilter + if source.CorrelationFilter != nil { + var correlationFilter CorrelationFilter + err := correlationFilter.Initialize_From_CorrelationFilter_STATUS(source.CorrelationFilter) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_CorrelationFilter_STATUS() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil + } + + // FilterType + if source.FilterType != nil { + filterType := FilterType(*source.FilterType) + rule.FilterType = &filterType + } else { + rule.FilterType = nil + } + + // SqlFilter + if source.SqlFilter != nil { + var sqlFilter SqlFilter + err := sqlFilter.Initialize_From_SqlFilter_STATUS(source.SqlFilter) + if err != nil { + return errors.Wrap(err, "calling Initialize_From_SqlFilter_STATUS() to populate field SqlFilter") + } + rule.SqlFilter = &sqlFilter + } else { + rule.SqlFilter = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) SetAzureName(azureName string) { + rule.AzureName = azureName +} + +type Namespaces_Topics_Subscriptions_Rule_STATUS struct { + // Action: Represents the filter actions which are allowed for the transformation of a message that have been matched by a + // filter expression. + Action *Action_STATUS `json:"action,omitempty"` + + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // CorrelationFilter: Properties of correlationFilter + CorrelationFilter *CorrelationFilter_STATUS `json:"correlationFilter,omitempty"` + + // FilterType: Filter type that is evaluated against a BrokeredMessage. + FilterType *FilterType_STATUS `json:"filterType,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"` + + // SqlFilter: Properties of sqlFilter + SqlFilter *SqlFilter_STATUS `json:"sqlFilter,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_Topics_Subscriptions_Rule_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Topics_Subscriptions_Rule_STATUS from the provided source +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS{} + err := rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Topics_Subscriptions_Rule_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Topics_Subscriptions_Rule_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Topics_Subscriptions_Rule_STATUS_ARM, got %T", armInput) + } + + // Set property "Action": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Action != nil { + var action1 Action_STATUS + err := action1.PopulateFromARM(owner, *typedInput.Properties.Action) + if err != nil { + return err + } + action := action1 + rule.Action = &action + } + } + + // no assignment for property "Conditions" + + // Set property "CorrelationFilter": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CorrelationFilter != nil { + var correlationFilter1 CorrelationFilter_STATUS + err := correlationFilter1.PopulateFromARM(owner, *typedInput.Properties.CorrelationFilter) + if err != nil { + return err + } + correlationFilter := correlationFilter1 + rule.CorrelationFilter = &correlationFilter + } + } + + // Set property "FilterType": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.FilterType != nil { + filterType := *typedInput.Properties.FilterType + rule.FilterType = &filterType + } + } + + // 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 "SqlFilter": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SqlFilter != nil { + var sqlFilter1 SqlFilter_STATUS + err := sqlFilter1.PopulateFromARM(owner, *typedInput.Properties.SqlFilter) + if err != nil { + return err + } + sqlFilter := sqlFilter1 + rule.SqlFilter = &sqlFilter + } + } + + // 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_Topics_Subscriptions_Rule_STATUS populates our Namespaces_Topics_Subscriptions_Rule_STATUS from the provided source Namespaces_Topics_Subscriptions_Rule_STATUS +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS(source *v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) error { + + // Action + if source.Action != nil { + var action Action_STATUS + err := action.AssignProperties_From_Action_STATUS(source.Action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Action_STATUS() to populate field Action") + } + rule.Action = &action + } else { + rule.Action = nil + } + + // Conditions + rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CorrelationFilter + if source.CorrelationFilter != nil { + var correlationFilter CorrelationFilter_STATUS + err := correlationFilter.AssignProperties_From_CorrelationFilter_STATUS(source.CorrelationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CorrelationFilter_STATUS() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil + } + + // FilterType + if source.FilterType != nil { + filterType := FilterType_STATUS(*source.FilterType) + rule.FilterType = &filterType + } else { + rule.FilterType = nil + } + + // Id + rule.Id = genruntime.ClonePointerToString(source.Id) + + // Location + rule.Location = genruntime.ClonePointerToString(source.Location) + + // Name + rule.Name = genruntime.ClonePointerToString(source.Name) + + // SqlFilter + if source.SqlFilter != nil { + var sqlFilter SqlFilter_STATUS + err := sqlFilter.AssignProperties_From_SqlFilter_STATUS(source.SqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SqlFilter_STATUS() to populate field SqlFilter") + } + rule.SqlFilter = &sqlFilter + } else { + rule.SqlFilter = 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_Topics_Subscriptions_Rule_STATUS populates the provided destination Namespaces_Topics_Subscriptions_Rule_STATUS from our Namespaces_Topics_Subscriptions_Rule_STATUS +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(destination *v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Action + if rule.Action != nil { + var action v20211101s.Action_STATUS + err := rule.Action.AssignProperties_To_Action_STATUS(&action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Action_STATUS() to populate field Action") + } + destination.Action = &action + } else { + destination.Action = nil + } + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) + + // CorrelationFilter + if rule.CorrelationFilter != nil { + var correlationFilter v20211101s.CorrelationFilter_STATUS + err := rule.CorrelationFilter.AssignProperties_To_CorrelationFilter_STATUS(&correlationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CorrelationFilter_STATUS() to populate field CorrelationFilter") + } + destination.CorrelationFilter = &correlationFilter + } else { + destination.CorrelationFilter = nil + } + + // FilterType + if rule.FilterType != nil { + filterType := string(*rule.FilterType) + destination.FilterType = &filterType + } else { + destination.FilterType = nil + } + + // Id + destination.Id = genruntime.ClonePointerToString(rule.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(rule.Location) + + // Name + destination.Name = genruntime.ClonePointerToString(rule.Name) + + // SqlFilter + if rule.SqlFilter != nil { + var sqlFilter v20211101s.SqlFilter_STATUS + err := rule.SqlFilter.AssignProperties_To_SqlFilter_STATUS(&sqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SqlFilter_STATUS() to populate field SqlFilter") + } + destination.SqlFilter = &sqlFilter + } else { + destination.SqlFilter = nil + } + + // SystemData + if rule.SystemData != nil { + var systemDatum v20211101s.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 +} + +// Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter +// expression. +type Action struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +var _ genruntime.ARMTransformer = &Action{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (action *Action) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if action == nil { + return nil, nil + } + result := &Action_ARM{} + + // Set property "CompatibilityLevel": + if action.CompatibilityLevel != nil { + compatibilityLevel := *action.CompatibilityLevel + result.CompatibilityLevel = &compatibilityLevel + } + + // Set property "RequiresPreprocessing": + if action.RequiresPreprocessing != nil { + requiresPreprocessing := *action.RequiresPreprocessing + result.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SqlExpression": + if action.SqlExpression != nil { + sqlExpression := *action.SqlExpression + result.SqlExpression = &sqlExpression + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (action *Action) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Action_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (action *Action) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Action_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Action_ARM, got %T", armInput) + } + + // Set property "CompatibilityLevel": + if typedInput.CompatibilityLevel != nil { + compatibilityLevel := *typedInput.CompatibilityLevel + action.CompatibilityLevel = &compatibilityLevel + } + + // Set property "RequiresPreprocessing": + if typedInput.RequiresPreprocessing != nil { + requiresPreprocessing := *typedInput.RequiresPreprocessing + action.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SqlExpression": + if typedInput.SqlExpression != nil { + sqlExpression := *typedInput.SqlExpression + action.SqlExpression = &sqlExpression + } + + // No error + return nil +} + +// AssignProperties_From_Action populates our Action from the provided source Action +func (action *Action) AssignProperties_From_Action(source *v20211101s.Action) error { + + // CompatibilityLevel + action.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + action.RequiresPreprocessing = &requiresPreprocessing + } else { + action.RequiresPreprocessing = nil + } + + // SqlExpression + action.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // No error + return nil +} + +// AssignProperties_To_Action populates the provided destination Action from our Action +func (action *Action) AssignProperties_To_Action(destination *v20211101s.Action) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(action.CompatibilityLevel) + + // RequiresPreprocessing + if action.RequiresPreprocessing != nil { + requiresPreprocessing := *action.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(action.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Action_STATUS populates our Action from the provided source Action_STATUS +func (action *Action) Initialize_From_Action_STATUS(source *Action_STATUS) error { + + // CompatibilityLevel + action.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + action.RequiresPreprocessing = &requiresPreprocessing + } else { + action.RequiresPreprocessing = nil + } + + // SqlExpression + action.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // No error + return nil +} + +// Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter +// expression. +type Action_STATUS struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +var _ genruntime.FromARMConverter = &Action_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (action *Action_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Action_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (action *Action_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Action_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Action_STATUS_ARM, got %T", armInput) + } + + // Set property "CompatibilityLevel": + if typedInput.CompatibilityLevel != nil { + compatibilityLevel := *typedInput.CompatibilityLevel + action.CompatibilityLevel = &compatibilityLevel + } + + // Set property "RequiresPreprocessing": + if typedInput.RequiresPreprocessing != nil { + requiresPreprocessing := *typedInput.RequiresPreprocessing + action.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SqlExpression": + if typedInput.SqlExpression != nil { + sqlExpression := *typedInput.SqlExpression + action.SqlExpression = &sqlExpression + } + + // No error + return nil +} + +// AssignProperties_From_Action_STATUS populates our Action_STATUS from the provided source Action_STATUS +func (action *Action_STATUS) AssignProperties_From_Action_STATUS(source *v20211101s.Action_STATUS) error { + + // CompatibilityLevel + action.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + action.RequiresPreprocessing = &requiresPreprocessing + } else { + action.RequiresPreprocessing = nil + } + + // SqlExpression + action.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // No error + return nil +} + +// AssignProperties_To_Action_STATUS populates the provided destination Action_STATUS from our Action_STATUS +func (action *Action_STATUS) AssignProperties_To_Action_STATUS(destination *v20211101s.Action_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(action.CompatibilityLevel) + + // RequiresPreprocessing + if action.RequiresPreprocessing != nil { + requiresPreprocessing := *action.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(action.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Represents the correlation filter expression. +type CorrelationFilter struct { + // ContentType: Content type of the message. + ContentType *string `json:"contentType,omitempty"` + + // CorrelationId: Identifier of the correlation. + CorrelationId *string `json:"correlationId,omitempty"` + + // Label: Application specific label. + Label *string `json:"label,omitempty"` + + // MessageId: Identifier of the message. + MessageId *string `json:"messageId,omitempty"` + + // Properties: dictionary object for custom filters + Properties map[string]string `json:"properties,omitempty"` + + // ReplyTo: Address of the queue to reply to. + ReplyTo *string `json:"replyTo,omitempty"` + + // ReplyToSessionId: Session identifier to reply to. + ReplyToSessionId *string `json:"replyToSessionId,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SessionId: Session identifier. + SessionId *string `json:"sessionId,omitempty"` + + // To: Address to send to. + To *string `json:"to,omitempty"` +} + +var _ genruntime.ARMTransformer = &CorrelationFilter{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (filter *CorrelationFilter) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if filter == nil { + return nil, nil + } + result := &CorrelationFilter_ARM{} + + // Set property "ContentType": + if filter.ContentType != nil { + contentType := *filter.ContentType + result.ContentType = &contentType + } + + // Set property "CorrelationId": + if filter.CorrelationId != nil { + correlationId := *filter.CorrelationId + result.CorrelationId = &correlationId + } + + // Set property "Label": + if filter.Label != nil { + label := *filter.Label + result.Label = &label + } + + // Set property "MessageId": + if filter.MessageId != nil { + messageId := *filter.MessageId + result.MessageId = &messageId + } + + // Set property "Properties": + if filter.Properties != nil { + result.Properties = make(map[string]string, len(filter.Properties)) + for key, value := range filter.Properties { + result.Properties[key] = value + } + } + + // Set property "ReplyTo": + if filter.ReplyTo != nil { + replyTo := *filter.ReplyTo + result.ReplyTo = &replyTo + } + + // Set property "ReplyToSessionId": + if filter.ReplyToSessionId != nil { + replyToSessionId := *filter.ReplyToSessionId + result.ReplyToSessionId = &replyToSessionId + } + + // Set property "RequiresPreprocessing": + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + result.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SessionId": + if filter.SessionId != nil { + sessionId := *filter.SessionId + result.SessionId = &sessionId + } + + // Set property "To": + if filter.To != nil { + to := *filter.To + result.To = &to + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (filter *CorrelationFilter) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &CorrelationFilter_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (filter *CorrelationFilter) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(CorrelationFilter_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CorrelationFilter_ARM, got %T", armInput) + } + + // Set property "ContentType": + if typedInput.ContentType != nil { + contentType := *typedInput.ContentType + filter.ContentType = &contentType + } + + // Set property "CorrelationId": + if typedInput.CorrelationId != nil { + correlationId := *typedInput.CorrelationId + filter.CorrelationId = &correlationId + } + + // Set property "Label": + if typedInput.Label != nil { + label := *typedInput.Label + filter.Label = &label + } + + // Set property "MessageId": + if typedInput.MessageId != nil { + messageId := *typedInput.MessageId + filter.MessageId = &messageId + } + + // Set property "Properties": + if typedInput.Properties != nil { + filter.Properties = make(map[string]string, len(typedInput.Properties)) + for key, value := range typedInput.Properties { + filter.Properties[key] = value + } + } + + // Set property "ReplyTo": + if typedInput.ReplyTo != nil { + replyTo := *typedInput.ReplyTo + filter.ReplyTo = &replyTo + } + + // Set property "ReplyToSessionId": + if typedInput.ReplyToSessionId != nil { + replyToSessionId := *typedInput.ReplyToSessionId + filter.ReplyToSessionId = &replyToSessionId + } + + // Set property "RequiresPreprocessing": + if typedInput.RequiresPreprocessing != nil { + requiresPreprocessing := *typedInput.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SessionId": + if typedInput.SessionId != nil { + sessionId := *typedInput.SessionId + filter.SessionId = &sessionId + } + + // Set property "To": + if typedInput.To != nil { + to := *typedInput.To + filter.To = &to + } + + // No error + return nil +} + +// AssignProperties_From_CorrelationFilter populates our CorrelationFilter from the provided source CorrelationFilter +func (filter *CorrelationFilter) AssignProperties_From_CorrelationFilter(source *v20211101s.CorrelationFilter) error { + + // ContentType + filter.ContentType = genruntime.ClonePointerToString(source.ContentType) + + // CorrelationId + filter.CorrelationId = genruntime.ClonePointerToString(source.CorrelationId) + + // Label + filter.Label = genruntime.ClonePointerToString(source.Label) + + // MessageId + filter.MessageId = genruntime.ClonePointerToString(source.MessageId) + + // Properties + filter.Properties = genruntime.CloneMapOfStringToString(source.Properties) + + // ReplyTo + filter.ReplyTo = genruntime.ClonePointerToString(source.ReplyTo) + + // ReplyToSessionId + filter.ReplyToSessionId = genruntime.ClonePointerToString(source.ReplyToSessionId) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SessionId + filter.SessionId = genruntime.ClonePointerToString(source.SessionId) + + // To + filter.To = genruntime.ClonePointerToString(source.To) + + // No error + return nil +} + +// AssignProperties_To_CorrelationFilter populates the provided destination CorrelationFilter from our CorrelationFilter +func (filter *CorrelationFilter) AssignProperties_To_CorrelationFilter(destination *v20211101s.CorrelationFilter) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ContentType + destination.ContentType = genruntime.ClonePointerToString(filter.ContentType) + + // CorrelationId + destination.CorrelationId = genruntime.ClonePointerToString(filter.CorrelationId) + + // Label + destination.Label = genruntime.ClonePointerToString(filter.Label) + + // MessageId + destination.MessageId = genruntime.ClonePointerToString(filter.MessageId) + + // Properties + destination.Properties = genruntime.CloneMapOfStringToString(filter.Properties) + + // ReplyTo + destination.ReplyTo = genruntime.ClonePointerToString(filter.ReplyTo) + + // ReplyToSessionId + destination.ReplyToSessionId = genruntime.ClonePointerToString(filter.ReplyToSessionId) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SessionId + destination.SessionId = genruntime.ClonePointerToString(filter.SessionId) + + // To + destination.To = genruntime.ClonePointerToString(filter.To) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_CorrelationFilter_STATUS populates our CorrelationFilter from the provided source CorrelationFilter_STATUS +func (filter *CorrelationFilter) Initialize_From_CorrelationFilter_STATUS(source *CorrelationFilter_STATUS) error { + + // ContentType + filter.ContentType = genruntime.ClonePointerToString(source.ContentType) + + // CorrelationId + filter.CorrelationId = genruntime.ClonePointerToString(source.CorrelationId) + + // Label + filter.Label = genruntime.ClonePointerToString(source.Label) + + // MessageId + filter.MessageId = genruntime.ClonePointerToString(source.MessageId) + + // Properties + filter.Properties = genruntime.CloneMapOfStringToString(source.Properties) + + // ReplyTo + filter.ReplyTo = genruntime.ClonePointerToString(source.ReplyTo) + + // ReplyToSessionId + filter.ReplyToSessionId = genruntime.ClonePointerToString(source.ReplyToSessionId) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SessionId + filter.SessionId = genruntime.ClonePointerToString(source.SessionId) + + // To + filter.To = genruntime.ClonePointerToString(source.To) + + // No error + return nil +} + +// Represents the correlation filter expression. +type CorrelationFilter_STATUS struct { + // ContentType: Content type of the message. + ContentType *string `json:"contentType,omitempty"` + + // CorrelationId: Identifier of the correlation. + CorrelationId *string `json:"correlationId,omitempty"` + + // Label: Application specific label. + Label *string `json:"label,omitempty"` + + // MessageId: Identifier of the message. + MessageId *string `json:"messageId,omitempty"` + + // Properties: dictionary object for custom filters + Properties map[string]string `json:"properties,omitempty"` + + // ReplyTo: Address of the queue to reply to. + ReplyTo *string `json:"replyTo,omitempty"` + + // ReplyToSessionId: Session identifier to reply to. + ReplyToSessionId *string `json:"replyToSessionId,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SessionId: Session identifier. + SessionId *string `json:"sessionId,omitempty"` + + // To: Address to send to. + To *string `json:"to,omitempty"` +} + +var _ genruntime.FromARMConverter = &CorrelationFilter_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (filter *CorrelationFilter_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &CorrelationFilter_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (filter *CorrelationFilter_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(CorrelationFilter_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CorrelationFilter_STATUS_ARM, got %T", armInput) + } + + // Set property "ContentType": + if typedInput.ContentType != nil { + contentType := *typedInput.ContentType + filter.ContentType = &contentType + } + + // Set property "CorrelationId": + if typedInput.CorrelationId != nil { + correlationId := *typedInput.CorrelationId + filter.CorrelationId = &correlationId + } + + // Set property "Label": + if typedInput.Label != nil { + label := *typedInput.Label + filter.Label = &label + } + + // Set property "MessageId": + if typedInput.MessageId != nil { + messageId := *typedInput.MessageId + filter.MessageId = &messageId + } + + // Set property "Properties": + if typedInput.Properties != nil { + filter.Properties = make(map[string]string, len(typedInput.Properties)) + for key, value := range typedInput.Properties { + filter.Properties[key] = value + } + } + + // Set property "ReplyTo": + if typedInput.ReplyTo != nil { + replyTo := *typedInput.ReplyTo + filter.ReplyTo = &replyTo + } + + // Set property "ReplyToSessionId": + if typedInput.ReplyToSessionId != nil { + replyToSessionId := *typedInput.ReplyToSessionId + filter.ReplyToSessionId = &replyToSessionId + } + + // Set property "RequiresPreprocessing": + if typedInput.RequiresPreprocessing != nil { + requiresPreprocessing := *typedInput.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SessionId": + if typedInput.SessionId != nil { + sessionId := *typedInput.SessionId + filter.SessionId = &sessionId + } + + // Set property "To": + if typedInput.To != nil { + to := *typedInput.To + filter.To = &to + } + + // No error + return nil +} + +// AssignProperties_From_CorrelationFilter_STATUS populates our CorrelationFilter_STATUS from the provided source CorrelationFilter_STATUS +func (filter *CorrelationFilter_STATUS) AssignProperties_From_CorrelationFilter_STATUS(source *v20211101s.CorrelationFilter_STATUS) error { + + // ContentType + filter.ContentType = genruntime.ClonePointerToString(source.ContentType) + + // CorrelationId + filter.CorrelationId = genruntime.ClonePointerToString(source.CorrelationId) + + // Label + filter.Label = genruntime.ClonePointerToString(source.Label) + + // MessageId + filter.MessageId = genruntime.ClonePointerToString(source.MessageId) + + // Properties + filter.Properties = genruntime.CloneMapOfStringToString(source.Properties) + + // ReplyTo + filter.ReplyTo = genruntime.ClonePointerToString(source.ReplyTo) + + // ReplyToSessionId + filter.ReplyToSessionId = genruntime.ClonePointerToString(source.ReplyToSessionId) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SessionId + filter.SessionId = genruntime.ClonePointerToString(source.SessionId) + + // To + filter.To = genruntime.ClonePointerToString(source.To) + + // No error + return nil +} + +// AssignProperties_To_CorrelationFilter_STATUS populates the provided destination CorrelationFilter_STATUS from our CorrelationFilter_STATUS +func (filter *CorrelationFilter_STATUS) AssignProperties_To_CorrelationFilter_STATUS(destination *v20211101s.CorrelationFilter_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ContentType + destination.ContentType = genruntime.ClonePointerToString(filter.ContentType) + + // CorrelationId + destination.CorrelationId = genruntime.ClonePointerToString(filter.CorrelationId) + + // Label + destination.Label = genruntime.ClonePointerToString(filter.Label) + + // MessageId + destination.MessageId = genruntime.ClonePointerToString(filter.MessageId) + + // Properties + destination.Properties = genruntime.CloneMapOfStringToString(filter.Properties) + + // ReplyTo + destination.ReplyTo = genruntime.ClonePointerToString(filter.ReplyTo) + + // ReplyToSessionId + destination.ReplyToSessionId = genruntime.ClonePointerToString(filter.ReplyToSessionId) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SessionId + destination.SessionId = genruntime.ClonePointerToString(filter.SessionId) + + // To + destination.To = genruntime.ClonePointerToString(filter.To) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Rule filter types +// +kubebuilder:validation:Enum={"CorrelationFilter","SqlFilter"} +type FilterType string + +const ( + FilterType_CorrelationFilter = FilterType("CorrelationFilter") + FilterType_SqlFilter = FilterType("SqlFilter") +) + +// Rule filter types +type FilterType_STATUS string + +const ( + FilterType_STATUS_CorrelationFilter = FilterType_STATUS("CorrelationFilter") + FilterType_STATUS_SqlFilter = FilterType_STATUS("SqlFilter") +) + +// Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. +type SqlFilter struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: The SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +var _ genruntime.ARMTransformer = &SqlFilter{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (filter *SqlFilter) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if filter == nil { + return nil, nil + } + result := &SqlFilter_ARM{} + + // Set property "CompatibilityLevel": + if filter.CompatibilityLevel != nil { + compatibilityLevel := *filter.CompatibilityLevel + result.CompatibilityLevel = &compatibilityLevel + } + + // Set property "RequiresPreprocessing": + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + result.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SqlExpression": + if filter.SqlExpression != nil { + sqlExpression := *filter.SqlExpression + result.SqlExpression = &sqlExpression + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (filter *SqlFilter) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SqlFilter_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (filter *SqlFilter) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SqlFilter_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SqlFilter_ARM, got %T", armInput) + } + + // Set property "CompatibilityLevel": + if typedInput.CompatibilityLevel != nil { + compatibilityLevel := *typedInput.CompatibilityLevel + filter.CompatibilityLevel = &compatibilityLevel + } + + // Set property "RequiresPreprocessing": + if typedInput.RequiresPreprocessing != nil { + requiresPreprocessing := *typedInput.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SqlExpression": + if typedInput.SqlExpression != nil { + sqlExpression := *typedInput.SqlExpression + filter.SqlExpression = &sqlExpression + } + + // No error + return nil +} + +// AssignProperties_From_SqlFilter populates our SqlFilter from the provided source SqlFilter +func (filter *SqlFilter) AssignProperties_From_SqlFilter(source *v20211101s.SqlFilter) error { + + // CompatibilityLevel + filter.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SqlExpression + filter.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // No error + return nil +} + +// AssignProperties_To_SqlFilter populates the provided destination SqlFilter from our SqlFilter +func (filter *SqlFilter) AssignProperties_To_SqlFilter(destination *v20211101s.SqlFilter) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(filter.CompatibilityLevel) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(filter.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_SqlFilter_STATUS populates our SqlFilter from the provided source SqlFilter_STATUS +func (filter *SqlFilter) Initialize_From_SqlFilter_STATUS(source *SqlFilter_STATUS) error { + + // CompatibilityLevel + filter.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SqlExpression + filter.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // No error + return nil +} + +// Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. +type SqlFilter_STATUS struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: The SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +var _ genruntime.FromARMConverter = &SqlFilter_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (filter *SqlFilter_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SqlFilter_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (filter *SqlFilter_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SqlFilter_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SqlFilter_STATUS_ARM, got %T", armInput) + } + + // Set property "CompatibilityLevel": + if typedInput.CompatibilityLevel != nil { + compatibilityLevel := *typedInput.CompatibilityLevel + filter.CompatibilityLevel = &compatibilityLevel + } + + // Set property "RequiresPreprocessing": + if typedInput.RequiresPreprocessing != nil { + requiresPreprocessing := *typedInput.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SqlExpression": + if typedInput.SqlExpression != nil { + sqlExpression := *typedInput.SqlExpression + filter.SqlExpression = &sqlExpression + } + + // No error + return nil +} + +// AssignProperties_From_SqlFilter_STATUS populates our SqlFilter_STATUS from the provided source SqlFilter_STATUS +func (filter *SqlFilter_STATUS) AssignProperties_From_SqlFilter_STATUS(source *v20211101s.SqlFilter_STATUS) error { + + // CompatibilityLevel + filter.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SqlExpression + filter.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // No error + return nil +} + +// AssignProperties_To_SqlFilter_STATUS populates the provided destination SqlFilter_STATUS from our SqlFilter_STATUS +func (filter *SqlFilter_STATUS) AssignProperties_To_SqlFilter_STATUS(destination *v20211101s.SqlFilter_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(filter.CompatibilityLevel) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(filter.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&NamespacesTopicsSubscriptionsRule{}, &NamespacesTopicsSubscriptionsRuleList{}) +} diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_types_gen_test.go new file mode 100644 index 00000000000..50aa3554c13 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_types_gen_test.go @@ -0,0 +1,1049 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101 + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesTopicsSubscriptionsRule, NamespacesTopicsSubscriptionsRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesTopicsSubscriptionsRule tests if a specific instance of NamespacesTopicsSubscriptionsRule round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesTopicsSubscriptionsRule(subject NamespacesTopicsSubscriptionsRule) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesTopicsSubscriptionsRule + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesTopicsSubscriptionsRule + 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_NamespacesTopicsSubscriptionsRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscriptionsRule to NamespacesTopicsSubscriptionsRule via AssignProperties_To_NamespacesTopicsSubscriptionsRule & AssignProperties_From_NamespacesTopicsSubscriptionsRule returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule, NamespacesTopicsSubscriptionsRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule tests if a specific instance of NamespacesTopicsSubscriptionsRule can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule(subject NamespacesTopicsSubscriptionsRule) 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.NamespacesTopicsSubscriptionsRule + err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscriptionsRule + err = actual.AssignProperties_From_NamespacesTopicsSubscriptionsRule(&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_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule, NamespacesTopicsSubscriptionsRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule runs a test to see if a specific instance of NamespacesTopicsSubscriptionsRule round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule(subject NamespacesTopicsSubscriptionsRule) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionsRule + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicsSubscriptionsRule instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionsRuleGenerator() +var namespacesTopicsSubscriptionsRuleGenerator gopter.Gen + +// NamespacesTopicsSubscriptionsRuleGenerator returns a generator of NamespacesTopicsSubscriptionsRule instances for property testing. +func NamespacesTopicsSubscriptionsRuleGenerator() gopter.Gen { + if namespacesTopicsSubscriptionsRuleGenerator != nil { + return namespacesTopicsSubscriptionsRuleGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule(generators) + namespacesTopicsSubscriptionsRuleGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule{}), generators) + + return namespacesTopicsSubscriptionsRuleGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Topics_Subscriptions_Rule_SpecGenerator() + gens["Status"] = Namespaces_Topics_Subscriptions_Rule_STATUSGenerator() +} + +func Test_Namespaces_Topics_Subscriptions_Rule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscriptions_Rule_Spec to Namespaces_Topics_Subscriptions_Rule_Spec via AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec & AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_Spec, Namespaces_Topics_Subscriptions_Rule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_Spec tests if a specific instance of Namespaces_Topics_Subscriptions_Rule_Spec can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_Spec(subject Namespaces_Topics_Subscriptions_Rule_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 v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec + err := copied.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscriptions_Rule_Spec + err = actual.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec, Namespaces_Topics_Subscriptions_Rule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec runs a test to see if a specific instance of Namespaces_Topics_Subscriptions_Rule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec(subject Namespaces_Topics_Subscriptions_Rule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscriptions_Rule_SpecGenerator() +var namespaces_Topics_Subscriptions_Rule_SpecGenerator gopter.Gen + +// Namespaces_Topics_Subscriptions_Rule_SpecGenerator returns a generator of Namespaces_Topics_Subscriptions_Rule_Spec instances for property testing. +// We first initialize namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_SpecGenerator() gopter.Gen { + if namespaces_Topics_Subscriptions_Rule_SpecGenerator != nil { + return namespaces_Topics_Subscriptions_Rule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(generators) + namespaces_Topics_Subscriptions_Rule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(generators) + namespaces_Topics_Subscriptions_Rule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_Spec{}), generators) + + return namespaces_Topics_Subscriptions_Rule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["FilterType"] = gen.PtrOf(gen.OneConstOf(FilterType_CorrelationFilter, FilterType_SqlFilter)) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(ActionGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilterGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilterGenerator()) +} + +func Test_Namespaces_Topics_Subscriptions_Rule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscriptions_Rule_STATUS to Namespaces_Topics_Subscriptions_Rule_STATUS via AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS & AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_STATUS, Namespaces_Topics_Subscriptions_Rule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_STATUS tests if a specific instance of Namespaces_Topics_Subscriptions_Rule_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_STATUS(subject Namespaces_Topics_Subscriptions_Rule_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 v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS + err := copied.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscriptions_Rule_STATUS + err = actual.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS, Namespaces_Topics_Subscriptions_Rule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS runs a test to see if a specific instance of Namespaces_Topics_Subscriptions_Rule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS(subject Namespaces_Topics_Subscriptions_Rule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscriptions_Rule_STATUSGenerator() +var namespaces_Topics_Subscriptions_Rule_STATUSGenerator gopter.Gen + +// Namespaces_Topics_Subscriptions_Rule_STATUSGenerator returns a generator of Namespaces_Topics_Subscriptions_Rule_STATUS instances for property testing. +// We first initialize namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUSGenerator() gopter.Gen { + if namespaces_Topics_Subscriptions_Rule_STATUSGenerator != nil { + return namespaces_Topics_Subscriptions_Rule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(generators) + namespaces_Topics_Subscriptions_Rule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(generators) + namespaces_Topics_Subscriptions_Rule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_STATUS{}), generators) + + return namespaces_Topics_Subscriptions_Rule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(gens map[string]gopter.Gen) { + gens["FilterType"] = gen.PtrOf(gen.OneConstOf(FilterType_STATUS_CorrelationFilter, FilterType_STATUS_SqlFilter)) + 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_Topics_Subscriptions_Rule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(Action_STATUSGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilter_STATUSGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilter_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_Action_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Action to Action via AssignProperties_To_Action & AssignProperties_From_Action returns original", + prop.ForAll(RunPropertyAssignmentTestForAction, ActionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAction tests if a specific instance of Action can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForAction(subject Action) 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.Action + err := copied.AssignProperties_To_Action(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Action + err = actual.AssignProperties_From_Action(&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_Action_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 Action via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAction, ActionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAction runs a test to see if a specific instance of Action round trips to JSON and back losslessly +func RunJSONSerializationTestForAction(subject Action) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Action + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Action instances for property testing - lazily instantiated by ActionGenerator() +var actionGenerator gopter.Gen + +// ActionGenerator returns a generator of Action instances for property testing. +func ActionGenerator() gopter.Gen { + if actionGenerator != nil { + return actionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAction(generators) + actionGenerator = gen.Struct(reflect.TypeOf(Action{}), generators) + + return actionGenerator +} + +// AddIndependentPropertyGeneratorsForAction is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAction(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Action_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Action_STATUS to Action_STATUS via AssignProperties_To_Action_STATUS & AssignProperties_From_Action_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForAction_STATUS, Action_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAction_STATUS tests if a specific instance of Action_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForAction_STATUS(subject Action_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 v20211101s.Action_STATUS + err := copied.AssignProperties_To_Action_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Action_STATUS + err = actual.AssignProperties_From_Action_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_Action_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 Action_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAction_STATUS, Action_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAction_STATUS runs a test to see if a specific instance of Action_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForAction_STATUS(subject Action_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Action_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 Action_STATUS instances for property testing - lazily instantiated by Action_STATUSGenerator() +var action_STATUSGenerator gopter.Gen + +// Action_STATUSGenerator returns a generator of Action_STATUS instances for property testing. +func Action_STATUSGenerator() gopter.Gen { + if action_STATUSGenerator != nil { + return action_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAction_STATUS(generators) + action_STATUSGenerator = gen.Struct(reflect.TypeOf(Action_STATUS{}), generators) + + return action_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForAction_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAction_STATUS(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CorrelationFilter_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CorrelationFilter to CorrelationFilter via AssignProperties_To_CorrelationFilter & AssignProperties_From_CorrelationFilter returns original", + prop.ForAll(RunPropertyAssignmentTestForCorrelationFilter, CorrelationFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCorrelationFilter tests if a specific instance of CorrelationFilter can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForCorrelationFilter(subject CorrelationFilter) 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.CorrelationFilter + err := copied.AssignProperties_To_CorrelationFilter(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CorrelationFilter + err = actual.AssignProperties_From_CorrelationFilter(&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_CorrelationFilter_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 CorrelationFilter via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCorrelationFilter, CorrelationFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCorrelationFilter runs a test to see if a specific instance of CorrelationFilter round trips to JSON and back losslessly +func RunJSONSerializationTestForCorrelationFilter(subject CorrelationFilter) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CorrelationFilter + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of CorrelationFilter instances for property testing - lazily instantiated by CorrelationFilterGenerator() +var correlationFilterGenerator gopter.Gen + +// CorrelationFilterGenerator returns a generator of CorrelationFilter instances for property testing. +func CorrelationFilterGenerator() gopter.Gen { + if correlationFilterGenerator != nil { + return correlationFilterGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCorrelationFilter(generators) + correlationFilterGenerator = gen.Struct(reflect.TypeOf(CorrelationFilter{}), generators) + + return correlationFilterGenerator +} + +// AddIndependentPropertyGeneratorsForCorrelationFilter is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCorrelationFilter(gens map[string]gopter.Gen) { + gens["ContentType"] = gen.PtrOf(gen.AlphaString()) + gens["CorrelationId"] = gen.PtrOf(gen.AlphaString()) + gens["Label"] = gen.PtrOf(gen.AlphaString()) + gens["MessageId"] = gen.PtrOf(gen.AlphaString()) + gens["Properties"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ReplyTo"] = gen.PtrOf(gen.AlphaString()) + gens["ReplyToSessionId"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SessionId"] = gen.PtrOf(gen.AlphaString()) + gens["To"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CorrelationFilter_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CorrelationFilter_STATUS to CorrelationFilter_STATUS via AssignProperties_To_CorrelationFilter_STATUS & AssignProperties_From_CorrelationFilter_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForCorrelationFilter_STATUS, CorrelationFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCorrelationFilter_STATUS tests if a specific instance of CorrelationFilter_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForCorrelationFilter_STATUS(subject CorrelationFilter_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 v20211101s.CorrelationFilter_STATUS + err := copied.AssignProperties_To_CorrelationFilter_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CorrelationFilter_STATUS + err = actual.AssignProperties_From_CorrelationFilter_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_CorrelationFilter_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 CorrelationFilter_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCorrelationFilter_STATUS, CorrelationFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCorrelationFilter_STATUS runs a test to see if a specific instance of CorrelationFilter_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCorrelationFilter_STATUS(subject CorrelationFilter_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CorrelationFilter_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 CorrelationFilter_STATUS instances for property testing - lazily instantiated by +// CorrelationFilter_STATUSGenerator() +var correlationFilter_STATUSGenerator gopter.Gen + +// CorrelationFilter_STATUSGenerator returns a generator of CorrelationFilter_STATUS instances for property testing. +func CorrelationFilter_STATUSGenerator() gopter.Gen { + if correlationFilter_STATUSGenerator != nil { + return correlationFilter_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS(generators) + correlationFilter_STATUSGenerator = gen.Struct(reflect.TypeOf(CorrelationFilter_STATUS{}), generators) + + return correlationFilter_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS(gens map[string]gopter.Gen) { + gens["ContentType"] = gen.PtrOf(gen.AlphaString()) + gens["CorrelationId"] = gen.PtrOf(gen.AlphaString()) + gens["Label"] = gen.PtrOf(gen.AlphaString()) + gens["MessageId"] = gen.PtrOf(gen.AlphaString()) + gens["Properties"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ReplyTo"] = gen.PtrOf(gen.AlphaString()) + gens["ReplyToSessionId"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SessionId"] = gen.PtrOf(gen.AlphaString()) + gens["To"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SqlFilter_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SqlFilter to SqlFilter via AssignProperties_To_SqlFilter & AssignProperties_From_SqlFilter returns original", + prop.ForAll(RunPropertyAssignmentTestForSqlFilter, SqlFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSqlFilter tests if a specific instance of SqlFilter can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSqlFilter(subject SqlFilter) 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.SqlFilter + err := copied.AssignProperties_To_SqlFilter(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SqlFilter + err = actual.AssignProperties_From_SqlFilter(&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_SqlFilter_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 SqlFilter via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSqlFilter, SqlFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSqlFilter runs a test to see if a specific instance of SqlFilter round trips to JSON and back losslessly +func RunJSONSerializationTestForSqlFilter(subject SqlFilter) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SqlFilter + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SqlFilter instances for property testing - lazily instantiated by SqlFilterGenerator() +var sqlFilterGenerator gopter.Gen + +// SqlFilterGenerator returns a generator of SqlFilter instances for property testing. +func SqlFilterGenerator() gopter.Gen { + if sqlFilterGenerator != nil { + return sqlFilterGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSqlFilter(generators) + sqlFilterGenerator = gen.Struct(reflect.TypeOf(SqlFilter{}), generators) + + return sqlFilterGenerator +} + +// AddIndependentPropertyGeneratorsForSqlFilter is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSqlFilter(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SqlFilter_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SqlFilter_STATUS to SqlFilter_STATUS via AssignProperties_To_SqlFilter_STATUS & AssignProperties_From_SqlFilter_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSqlFilter_STATUS, SqlFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSqlFilter_STATUS tests if a specific instance of SqlFilter_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSqlFilter_STATUS(subject SqlFilter_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 v20211101s.SqlFilter_STATUS + err := copied.AssignProperties_To_SqlFilter_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SqlFilter_STATUS + err = actual.AssignProperties_From_SqlFilter_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_SqlFilter_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 SqlFilter_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSqlFilter_STATUS, SqlFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSqlFilter_STATUS runs a test to see if a specific instance of SqlFilter_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSqlFilter_STATUS(subject SqlFilter_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SqlFilter_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 SqlFilter_STATUS instances for property testing - lazily instantiated by SqlFilter_STATUSGenerator() +var sqlFilter_STATUSGenerator gopter.Gen + +// SqlFilter_STATUSGenerator returns a generator of SqlFilter_STATUS instances for property testing. +func SqlFilter_STATUSGenerator() gopter.Gen { + if sqlFilter_STATUSGenerator != nil { + return sqlFilter_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSqlFilter_STATUS(generators) + sqlFilter_STATUSGenerator = gen.Struct(reflect.TypeOf(SqlFilter_STATUS{}), generators) + + return sqlFilter_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSqlFilter_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSqlFilter_STATUS(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/servicebus/v1api20211101/structure.txt b/v2/api/servicebus/v1api20211101/structure.txt new file mode 100644 index 00000000000..4140b0bd7a8 --- /dev/null +++ b/v2/api/servicebus/v1api20211101/structure.txt @@ -0,0 +1,868 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101 +├── APIVersion: Enum (1 value) +│ └── "2021-11-01" +├── Namespace: Resource +│ ├── Owner: github.com/Azure/azure-service-operator/v2/api/resources/v1apiv20191001.ResourceGroup +│ ├── Spec: Object (11 properties) +│ │ ├── AlternateName: *string +│ │ ├── AzureName: string +│ │ ├── 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 +│ │ ├── Location: *string +│ │ ├── OperatorSpec: *Object (1 property) +│ │ │ └── Secrets: *Object (5 properties) +│ │ │ ├── Endpoint: *genruntime.SecretDestination +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── Sku: *Object (3 properties) +│ │ │ ├── Capacity: *int +│ │ │ ├── Name: *Enum (3 values) +│ │ │ │ ├── "Basic" +│ │ │ │ ├── "Premium" +│ │ │ │ └── "Standard" +│ │ │ └── Tier: *Enum (3 values) +│ │ │ ├── "Basic" +│ │ │ ├── "Premium" +│ │ │ └── "Standard" +│ │ ├── Tags: map[string]string +│ │ └── ZoneRedundant: *bool +│ └── Status: Object (20 properties) +│ ├── AlternateName: *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 +│ ├── Location: *string +│ ├── MetricId: *string +│ ├── Name: *string +│ ├── PrivateEndpointConnections: Object (1 property)[] +│ │ └── Id: *string +│ ├── ProvisioningState: *string +│ ├── 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 (11 properties) +│ │ ├── AlternateName: *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 +│ │ ├── MetricId: *string +│ │ ├── PrivateEndpointConnections: Object (1 property)[] +│ │ │ └── Id: *string +│ │ ├── ProvisioningState: *string +│ │ ├── 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 (4 properties) +│ │ ├── AlternateName: *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 +│ │ └── 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 (2 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ └── Rule 1: 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 +├── NamespacesQueue: Resource +│ ├── Owner: Namespace +│ ├── Spec: Object (17 properties) +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── AzureName: Validated (1 rule) +│ │ │ └── Rule 0: MinLength: 1 +│ │ ├── DeadLetteringOnMessageExpiration: *bool +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── EnableExpress: *bool +│ │ ├── EnablePartitioning: *bool +│ │ ├── ForwardDeadLetteredMessagesTo: *string +│ │ ├── ForwardTo: *string +│ │ ├── LockDuration: *string +│ │ ├── MaxDeliveryCount: *int +│ │ ├── MaxMessageSizeInKilobytes: *int +│ │ ├── MaxSizeInMegabytes: *int +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── RequiresDuplicateDetection: *bool +│ │ └── RequiresSession: *bool +│ └── Status: Object (28 properties) +│ ├── AccessedAt: *string +│ ├── AutoDeleteOnIdle: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CountDetails: *Object (5 properties) +│ │ ├── ActiveMessageCount: *int +│ │ ├── DeadLetterMessageCount: *int +│ │ ├── ScheduledMessageCount: *int +│ │ ├── TransferDeadLetterMessageCount: *int +│ │ └── TransferMessageCount: *int +│ ├── CreatedAt: *string +│ ├── DeadLetteringOnMessageExpiration: *bool +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── EnableExpress: *bool +│ ├── EnablePartitioning: *bool +│ ├── ForwardDeadLetteredMessagesTo: *string +│ ├── ForwardTo: *string +│ ├── Id: *string +│ ├── Location: *string +│ ├── LockDuration: *string +│ ├── MaxDeliveryCount: *int +│ ├── MaxMessageSizeInKilobytes: *int +│ ├── MaxSizeInMegabytes: *int +│ ├── MessageCount: *int +│ ├── Name: *string +│ ├── RequiresDuplicateDetection: *bool +│ ├── RequiresSession: *bool +│ ├── SizeInBytes: *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 +├── NamespacesTopic: Resource +│ ├── Owner: Namespace +│ ├── Spec: Object (12 properties) +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── AzureName: Validated (1 rule) +│ │ │ └── Rule 0: MinLength: 1 +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── EnableExpress: *bool +│ │ ├── EnablePartitioning: *bool +│ │ ├── MaxMessageSizeInKilobytes: *int +│ │ ├── MaxSizeInMegabytes: *int +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── RequiresDuplicateDetection: *bool +│ │ └── SupportOrdering: *bool +│ └── Status: Object (23 properties) +│ ├── AccessedAt: *string +│ ├── AutoDeleteOnIdle: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CountDetails: *Object (5 properties) +│ │ ├── ActiveMessageCount: *int +│ │ ├── DeadLetterMessageCount: *int +│ │ ├── ScheduledMessageCount: *int +│ │ ├── TransferDeadLetterMessageCount: *int +│ │ └── TransferMessageCount: *int +│ ├── CreatedAt: *string +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── EnableExpress: *bool +│ ├── EnablePartitioning: *bool +│ ├── Id: *string +│ ├── Location: *string +│ ├── MaxMessageSizeInKilobytes: *int +│ ├── MaxSizeInMegabytes: *int +│ ├── Name: *string +│ ├── RequiresDuplicateDetection: *bool +│ ├── SizeInBytes: *int +│ ├── Status: *Enum (9 values) +│ │ ├── "Active" +│ │ ├── "Creating" +│ │ ├── "Deleting" +│ │ ├── "Disabled" +│ │ ├── "ReceiveDisabled" +│ │ ├── "Renaming" +│ │ ├── "Restoring" +│ │ ├── "SendDisabled" +│ │ └── "Unknown" +│ ├── SubscriptionCount: *int +│ ├── SupportOrdering: *bool +│ ├── SystemData: *Object (6 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *Enum (4 values) +│ │ │ ├── "Application" +│ │ │ ├── "Key" +│ │ │ ├── "ManagedIdentity" +│ │ │ └── "User" +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ └── LastModifiedByType: *Enum (4 values) +│ │ ├── "Application" +│ │ ├── "Key" +│ │ ├── "ManagedIdentity" +│ │ └── "User" +│ ├── Type: *string +│ └── UpdatedAt: *string +├── NamespacesTopicsSubscription: Resource +│ ├── Owner: NamespacesTopic +│ ├── Spec: Object (15 properties) +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── AzureName: Validated (2 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ └── Rule 1: MinLength: 1 +│ │ ├── ClientAffineProperties: *Object (3 properties) +│ │ │ ├── ClientId: *string +│ │ │ ├── IsDurable: *bool +│ │ │ └── IsShared: *bool +│ │ ├── DeadLetteringOnFilterEvaluationExceptions: *bool +│ │ ├── DeadLetteringOnMessageExpiration: *bool +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── ForwardDeadLetteredMessagesTo: *string +│ │ ├── ForwardTo: *string +│ │ ├── IsClientAffine: *bool +│ │ ├── LockDuration: *string +│ │ ├── MaxDeliveryCount: *int +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ └── RequiresSession: *bool +│ └── Status: Object (25 properties) +│ ├── AccessedAt: *string +│ ├── AutoDeleteOnIdle: *string +│ ├── ClientAffineProperties: *Object (3 properties) +│ │ ├── ClientId: *string +│ │ ├── IsDurable: *bool +│ │ └── IsShared: *bool +│ ├── Conditions: conditions.Condition[] +│ ├── CountDetails: *Object (5 properties) +│ │ ├── ActiveMessageCount: *int +│ │ ├── DeadLetterMessageCount: *int +│ │ ├── ScheduledMessageCount: *int +│ │ ├── TransferDeadLetterMessageCount: *int +│ │ └── TransferMessageCount: *int +│ ├── CreatedAt: *string +│ ├── DeadLetteringOnFilterEvaluationExceptions: *bool +│ ├── DeadLetteringOnMessageExpiration: *bool +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── ForwardDeadLetteredMessagesTo: *string +│ ├── ForwardTo: *string +│ ├── Id: *string +│ ├── IsClientAffine: *bool +│ ├── Location: *string +│ ├── LockDuration: *string +│ ├── MaxDeliveryCount: *int +│ ├── MessageCount: *int +│ ├── Name: *string +│ ├── RequiresSession: *bool +│ ├── 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 +├── NamespacesTopicsSubscriptionsRule: Resource +│ ├── Owner: NamespacesTopicsSubscription +│ ├── Spec: Object (6 properties) +│ │ ├── Action: *Object (3 properties) +│ │ │ ├── CompatibilityLevel: *int +│ │ │ ├── RequiresPreprocessing: *bool +│ │ │ └── SqlExpression: *string +│ │ ├── AzureName: Validated (2 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ └── Rule 1: MinLength: 1 +│ │ ├── CorrelationFilter: *Object (10 properties) +│ │ │ ├── ContentType: *string +│ │ │ ├── CorrelationId: *string +│ │ │ ├── Label: *string +│ │ │ ├── MessageId: *string +│ │ │ ├── Properties: map[string]string +│ │ │ ├── ReplyTo: *string +│ │ │ ├── ReplyToSessionId: *string +│ │ │ ├── RequiresPreprocessing: *bool +│ │ │ ├── SessionId: *string +│ │ │ └── To: *string +│ │ ├── FilterType: *Enum (2 values) +│ │ │ ├── "CorrelationFilter" +│ │ │ └── "SqlFilter" +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ └── SqlFilter: *Object (3 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *string +│ └── Status: Object (10 properties) +│ ├── Action: *Object (3 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CorrelationFilter: *Object (10 properties) +│ │ ├── ContentType: *string +│ │ ├── CorrelationId: *string +│ │ ├── Label: *string +│ │ ├── MessageId: *string +│ │ ├── Properties: map[string]string +│ │ ├── ReplyTo: *string +│ │ ├── ReplyToSessionId: *string +│ │ ├── RequiresPreprocessing: *bool +│ │ ├── SessionId: *string +│ │ └── To: *string +│ ├── FilterType: *Enum (2 values) +│ │ ├── "CorrelationFilter" +│ │ └── "SqlFilter" +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── SqlFilter: *Object (3 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *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_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_Queue_STATUS_ARM: Object (6 properties) +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Properties: *Object (22 properties) +│ │ ├── AccessedAt: *string +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── CountDetails: *Object (5 properties) +│ │ │ ├── ActiveMessageCount: *int +│ │ │ ├── DeadLetterMessageCount: *int +│ │ │ ├── ScheduledMessageCount: *int +│ │ │ ├── TransferDeadLetterMessageCount: *int +│ │ │ └── TransferMessageCount: *int +│ │ ├── CreatedAt: *string +│ │ ├── DeadLetteringOnMessageExpiration: *bool +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── EnableExpress: *bool +│ │ ├── EnablePartitioning: *bool +│ │ ├── ForwardDeadLetteredMessagesTo: *string +│ │ ├── ForwardTo: *string +│ │ ├── LockDuration: *string +│ │ ├── MaxDeliveryCount: *int +│ │ ├── MaxMessageSizeInKilobytes: *int +│ │ ├── MaxSizeInMegabytes: *int +│ │ ├── MessageCount: *int +│ │ ├── RequiresDuplicateDetection: *bool +│ │ ├── RequiresSession: *bool +│ │ ├── SizeInBytes: *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_Queue_Spec_ARM: Object (2 properties) +│ ├── Name: string +│ └── Properties: *Object (15 properties) +│ ├── AutoDeleteOnIdle: *string +│ ├── DeadLetteringOnMessageExpiration: *bool +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── EnableExpress: *bool +│ ├── EnablePartitioning: *bool +│ ├── ForwardDeadLetteredMessagesTo: *string +│ ├── ForwardTo: *string +│ ├── LockDuration: *string +│ ├── MaxDeliveryCount: *int +│ ├── MaxMessageSizeInKilobytes: *int +│ ├── MaxSizeInMegabytes: *int +│ ├── RequiresDuplicateDetection: *bool +│ └── RequiresSession: *bool +├── Namespaces_Topic_STATUS_ARM: Object (6 properties) +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Properties: *Object (17 properties) +│ │ ├── AccessedAt: *string +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── CountDetails: *Object (5 properties) +│ │ │ ├── ActiveMessageCount: *int +│ │ │ ├── DeadLetterMessageCount: *int +│ │ │ ├── ScheduledMessageCount: *int +│ │ │ ├── TransferDeadLetterMessageCount: *int +│ │ │ └── TransferMessageCount: *int +│ │ ├── CreatedAt: *string +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── EnableExpress: *bool +│ │ ├── EnablePartitioning: *bool +│ │ ├── MaxMessageSizeInKilobytes: *int +│ │ ├── MaxSizeInMegabytes: *int +│ │ ├── RequiresDuplicateDetection: *bool +│ │ ├── SizeInBytes: *int +│ │ ├── Status: *Enum (9 values) +│ │ │ ├── "Active" +│ │ │ ├── "Creating" +│ │ │ ├── "Deleting" +│ │ │ ├── "Disabled" +│ │ │ ├── "ReceiveDisabled" +│ │ │ ├── "Renaming" +│ │ │ ├── "Restoring" +│ │ │ ├── "SendDisabled" +│ │ │ └── "Unknown" +│ │ ├── SubscriptionCount: *int +│ │ ├── SupportOrdering: *bool +│ │ └── 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_Topic_Spec_ARM: Object (2 properties) +│ ├── Name: string +│ └── Properties: *Object (10 properties) +│ ├── AutoDeleteOnIdle: *string +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── EnableExpress: *bool +│ ├── EnablePartitioning: *bool +│ ├── MaxMessageSizeInKilobytes: *int +│ ├── MaxSizeInMegabytes: *int +│ ├── RequiresDuplicateDetection: *bool +│ └── SupportOrdering: *bool +├── Namespaces_Topics_Subscription_STATUS_ARM: Object (6 properties) +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Properties: *Object (19 properties) +│ │ ├── AccessedAt: *string +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── ClientAffineProperties: *Object (3 properties) +│ │ │ ├── ClientId: *string +│ │ │ ├── IsDurable: *bool +│ │ │ └── IsShared: *bool +│ │ ├── CountDetails: *Object (5 properties) +│ │ │ ├── ActiveMessageCount: *int +│ │ │ ├── DeadLetterMessageCount: *int +│ │ │ ├── ScheduledMessageCount: *int +│ │ │ ├── TransferDeadLetterMessageCount: *int +│ │ │ └── TransferMessageCount: *int +│ │ ├── CreatedAt: *string +│ │ ├── DeadLetteringOnFilterEvaluationExceptions: *bool +│ │ ├── DeadLetteringOnMessageExpiration: *bool +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── ForwardDeadLetteredMessagesTo: *string +│ │ ├── ForwardTo: *string +│ │ ├── IsClientAffine: *bool +│ │ ├── LockDuration: *string +│ │ ├── MaxDeliveryCount: *int +│ │ ├── MessageCount: *int +│ │ ├── RequiresSession: *bool +│ │ ├── 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_Topics_Subscription_Spec_ARM: Object (2 properties) +│ ├── Name: string +│ └── Properties: *Object (13 properties) +│ ├── AutoDeleteOnIdle: *string +│ ├── ClientAffineProperties: *Object (3 properties) +│ │ ├── ClientId: *string +│ │ ├── IsDurable: *bool +│ │ └── IsShared: *bool +│ ├── DeadLetteringOnFilterEvaluationExceptions: *bool +│ ├── DeadLetteringOnMessageExpiration: *bool +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── ForwardDeadLetteredMessagesTo: *string +│ ├── ForwardTo: *string +│ ├── IsClientAffine: *bool +│ ├── LockDuration: *string +│ ├── MaxDeliveryCount: *int +│ └── RequiresSession: *bool +├── Namespaces_Topics_Subscriptions_Rule_STATUS_ARM: Object (6 properties) +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Properties: *Object (4 properties) +│ │ ├── Action: *Object (3 properties) +│ │ │ ├── CompatibilityLevel: *int +│ │ │ ├── RequiresPreprocessing: *bool +│ │ │ └── SqlExpression: *string +│ │ ├── CorrelationFilter: *Object (10 properties) +│ │ │ ├── ContentType: *string +│ │ │ ├── CorrelationId: *string +│ │ │ ├── Label: *string +│ │ │ ├── MessageId: *string +│ │ │ ├── Properties: map[string]string +│ │ │ ├── ReplyTo: *string +│ │ │ ├── ReplyToSessionId: *string +│ │ │ ├── RequiresPreprocessing: *bool +│ │ │ ├── SessionId: *string +│ │ │ └── To: *string +│ │ ├── FilterType: *Enum (2 values) +│ │ │ ├── "CorrelationFilter" +│ │ │ └── "SqlFilter" +│ │ └── SqlFilter: *Object (3 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *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_Topics_Subscriptions_Rule_Spec_ARM: Object (2 properties) + ├── Name: string + └── Properties: *Object (4 properties) + ├── Action: *Object (3 properties) + │ ├── CompatibilityLevel: *int + │ ├── RequiresPreprocessing: *bool + │ └── SqlExpression: *string + ├── CorrelationFilter: *Object (10 properties) + │ ├── ContentType: *string + │ ├── CorrelationId: *string + │ ├── Label: *string + │ ├── MessageId: *string + │ ├── Properties: map[string]string + │ ├── ReplyTo: *string + │ ├── ReplyToSessionId: *string + │ ├── RequiresPreprocessing: *bool + │ ├── SessionId: *string + │ └── To: *string + ├── FilterType: *Enum (2 values) + │ ├── "CorrelationFilter" + │ └── "SqlFilter" + └── SqlFilter: *Object (3 properties) + ├── CompatibilityLevel: *int + ├── RequiresPreprocessing: *bool + └── SqlExpression: *string diff --git a/v2/api/servicebus/v1api20211101/zz_generated.deepcopy.go b/v2/api/servicebus/v1api20211101/zz_generated.deepcopy.go new file mode 100644 index 00000000000..4502458b84b --- /dev/null +++ b/v2/api/servicebus/v1api20211101/zz_generated.deepcopy.go @@ -0,0 +1,4272 @@ +//go:build !ignore_autogenerated + +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1api20211101 + +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 *Action) DeepCopyInto(out *Action) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action. +func (in *Action) DeepCopy() *Action { + if in == nil { + return nil + } + out := new(Action) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Action_ARM) DeepCopyInto(out *Action_ARM) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action_ARM. +func (in *Action_ARM) DeepCopy() *Action_ARM { + if in == nil { + return nil + } + out := new(Action_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 *Action_STATUS) DeepCopyInto(out *Action_STATUS) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action_STATUS. +func (in *Action_STATUS) DeepCopy() *Action_STATUS { + if in == nil { + return nil + } + out := new(Action_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 *Action_STATUS_ARM) DeepCopyInto(out *Action_STATUS_ARM) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action_STATUS_ARM. +func (in *Action_STATUS_ARM) DeepCopy() *Action_STATUS_ARM { + if in == nil { + return nil + } + out := new(Action_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 *CorrelationFilter) DeepCopyInto(out *CorrelationFilter) { + *out = *in + if in.ContentType != nil { + in, out := &in.ContentType, &out.ContentType + *out = new(string) + **out = **in + } + if in.CorrelationId != nil { + in, out := &in.CorrelationId, &out.CorrelationId + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MessageId != nil { + in, out := &in.MessageId, &out.MessageId + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ReplyTo != nil { + in, out := &in.ReplyTo, &out.ReplyTo + *out = new(string) + **out = **in + } + if in.ReplyToSessionId != nil { + in, out := &in.ReplyToSessionId, &out.ReplyToSessionId + *out = new(string) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SessionId != nil { + in, out := &in.SessionId, &out.SessionId + *out = new(string) + **out = **in + } + if in.To != nil { + in, out := &in.To, &out.To + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelationFilter. +func (in *CorrelationFilter) DeepCopy() *CorrelationFilter { + if in == nil { + return nil + } + out := new(CorrelationFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CorrelationFilter_ARM) DeepCopyInto(out *CorrelationFilter_ARM) { + *out = *in + if in.ContentType != nil { + in, out := &in.ContentType, &out.ContentType + *out = new(string) + **out = **in + } + if in.CorrelationId != nil { + in, out := &in.CorrelationId, &out.CorrelationId + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MessageId != nil { + in, out := &in.MessageId, &out.MessageId + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ReplyTo != nil { + in, out := &in.ReplyTo, &out.ReplyTo + *out = new(string) + **out = **in + } + if in.ReplyToSessionId != nil { + in, out := &in.ReplyToSessionId, &out.ReplyToSessionId + *out = new(string) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SessionId != nil { + in, out := &in.SessionId, &out.SessionId + *out = new(string) + **out = **in + } + if in.To != nil { + in, out := &in.To, &out.To + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelationFilter_ARM. +func (in *CorrelationFilter_ARM) DeepCopy() *CorrelationFilter_ARM { + if in == nil { + return nil + } + out := new(CorrelationFilter_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 *CorrelationFilter_STATUS) DeepCopyInto(out *CorrelationFilter_STATUS) { + *out = *in + if in.ContentType != nil { + in, out := &in.ContentType, &out.ContentType + *out = new(string) + **out = **in + } + if in.CorrelationId != nil { + in, out := &in.CorrelationId, &out.CorrelationId + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MessageId != nil { + in, out := &in.MessageId, &out.MessageId + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ReplyTo != nil { + in, out := &in.ReplyTo, &out.ReplyTo + *out = new(string) + **out = **in + } + if in.ReplyToSessionId != nil { + in, out := &in.ReplyToSessionId, &out.ReplyToSessionId + *out = new(string) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SessionId != nil { + in, out := &in.SessionId, &out.SessionId + *out = new(string) + **out = **in + } + if in.To != nil { + in, out := &in.To, &out.To + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelationFilter_STATUS. +func (in *CorrelationFilter_STATUS) DeepCopy() *CorrelationFilter_STATUS { + if in == nil { + return nil + } + out := new(CorrelationFilter_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 *CorrelationFilter_STATUS_ARM) DeepCopyInto(out *CorrelationFilter_STATUS_ARM) { + *out = *in + if in.ContentType != nil { + in, out := &in.ContentType, &out.ContentType + *out = new(string) + **out = **in + } + if in.CorrelationId != nil { + in, out := &in.CorrelationId, &out.CorrelationId + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MessageId != nil { + in, out := &in.MessageId, &out.MessageId + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ReplyTo != nil { + in, out := &in.ReplyTo, &out.ReplyTo + *out = new(string) + **out = **in + } + if in.ReplyToSessionId != nil { + in, out := &in.ReplyToSessionId, &out.ReplyToSessionId + *out = new(string) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SessionId != nil { + in, out := &in.SessionId, &out.SessionId + *out = new(string) + **out = **in + } + if in.To != nil { + in, out := &in.To, &out.To + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelationFilter_STATUS_ARM. +func (in *CorrelationFilter_STATUS_ARM) DeepCopy() *CorrelationFilter_STATUS_ARM { + if in == nil { + return nil + } + out := new(CorrelationFilter_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 *MessageCountDetails_STATUS) DeepCopyInto(out *MessageCountDetails_STATUS) { + *out = *in + if in.ActiveMessageCount != nil { + in, out := &in.ActiveMessageCount, &out.ActiveMessageCount + *out = new(int) + **out = **in + } + if in.DeadLetterMessageCount != nil { + in, out := &in.DeadLetterMessageCount, &out.DeadLetterMessageCount + *out = new(int) + **out = **in + } + if in.ScheduledMessageCount != nil { + in, out := &in.ScheduledMessageCount, &out.ScheduledMessageCount + *out = new(int) + **out = **in + } + if in.TransferDeadLetterMessageCount != nil { + in, out := &in.TransferDeadLetterMessageCount, &out.TransferDeadLetterMessageCount + *out = new(int) + **out = **in + } + if in.TransferMessageCount != nil { + in, out := &in.TransferMessageCount, &out.TransferMessageCount + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageCountDetails_STATUS. +func (in *MessageCountDetails_STATUS) DeepCopy() *MessageCountDetails_STATUS { + if in == nil { + return nil + } + out := new(MessageCountDetails_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 *MessageCountDetails_STATUS_ARM) DeepCopyInto(out *MessageCountDetails_STATUS_ARM) { + *out = *in + if in.ActiveMessageCount != nil { + in, out := &in.ActiveMessageCount, &out.ActiveMessageCount + *out = new(int) + **out = **in + } + if in.DeadLetterMessageCount != nil { + in, out := &in.DeadLetterMessageCount, &out.DeadLetterMessageCount + *out = new(int) + **out = **in + } + if in.ScheduledMessageCount != nil { + in, out := &in.ScheduledMessageCount, &out.ScheduledMessageCount + *out = new(int) + **out = **in + } + if in.TransferDeadLetterMessageCount != nil { + in, out := &in.TransferDeadLetterMessageCount, &out.TransferDeadLetterMessageCount + *out = new(int) + **out = **in + } + if in.TransferMessageCount != nil { + in, out := &in.TransferMessageCount, &out.TransferMessageCount + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageCountDetails_STATUS_ARM. +func (in *MessageCountDetails_STATUS_ARM) DeepCopy() *MessageCountDetails_STATUS_ARM { + if in == nil { + return nil + } + out := new(MessageCountDetails_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.Endpoint != nil { + in, out := &in.Endpoint, &out.Endpoint + *out = new(genruntime.SecretDestination) + **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_STATUS) DeepCopyInto(out *Namespace_STATUS) { + *out = *in + if in.AlternateName != nil { + in, out := &in.AlternateName, &out.AlternateName + *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.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MetricId != nil { + in, out := &in.MetricId, &out.MetricId + *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.ProvisioningState != nil { + in, out := &in.ProvisioningState, &out.ProvisioningState + *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(SBSku_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(SBNamespaceProperties_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(SBSku_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.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.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespaceOperatorSpec) + (*in).DeepCopyInto(*out) + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(SBSku) + (*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(SBNamespaceProperties_ARM) + (*in).DeepCopyInto(*out) + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(SBSku_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 *NamespacesQueue) DeepCopyInto(out *NamespacesQueue) { + *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 NamespacesQueue. +func (in *NamespacesQueue) DeepCopy() *NamespacesQueue { + if in == nil { + return nil + } + out := new(NamespacesQueue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesQueue) 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 *NamespacesQueueList) DeepCopyInto(out *NamespacesQueueList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesQueue, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesQueueList. +func (in *NamespacesQueueList) DeepCopy() *NamespacesQueueList { + if in == nil { + return nil + } + out := new(NamespacesQueueList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesQueueList) 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 *NamespacesTopic) DeepCopyInto(out *NamespacesTopic) { + *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 NamespacesTopic. +func (in *NamespacesTopic) DeepCopy() *NamespacesTopic { + if in == nil { + return nil + } + out := new(NamespacesTopic) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopic) 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 *NamespacesTopicList) DeepCopyInto(out *NamespacesTopicList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesTopic, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicList. +func (in *NamespacesTopicList) DeepCopy() *NamespacesTopicList { + if in == nil { + return nil + } + out := new(NamespacesTopicList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicList) 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 *NamespacesTopicsSubscription) DeepCopyInto(out *NamespacesTopicsSubscription) { + *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 NamespacesTopicsSubscription. +func (in *NamespacesTopicsSubscription) DeepCopy() *NamespacesTopicsSubscription { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscription) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscription) 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 *NamespacesTopicsSubscriptionList) DeepCopyInto(out *NamespacesTopicsSubscriptionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesTopicsSubscription, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicsSubscriptionList. +func (in *NamespacesTopicsSubscriptionList) DeepCopy() *NamespacesTopicsSubscriptionList { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscriptionList) 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 *NamespacesTopicsSubscriptionsRule) DeepCopyInto(out *NamespacesTopicsSubscriptionsRule) { + *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 NamespacesTopicsSubscriptionsRule. +func (in *NamespacesTopicsSubscriptionsRule) DeepCopy() *NamespacesTopicsSubscriptionsRule { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscriptionsRule) 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 *NamespacesTopicsSubscriptionsRuleList) DeepCopyInto(out *NamespacesTopicsSubscriptionsRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesTopicsSubscriptionsRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicsSubscriptionsRuleList. +func (in *NamespacesTopicsSubscriptionsRuleList) DeepCopy() *NamespacesTopicsSubscriptionsRuleList { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscriptionsRuleList) 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_Queue_STATUS) DeepCopyInto(out *Namespaces_Queue_STATUS) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *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.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *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.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.MessageCount != nil { + in, out := &in.MessageCount, &out.MessageCount + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } + if in.SizeInBytes != nil { + in, out := &in.SizeInBytes, &out.SizeInBytes + *out = new(int) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EntityStatus_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_Queue_STATUS. +func (in *Namespaces_Queue_STATUS) DeepCopy() *Namespaces_Queue_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Queue_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_Queue_STATUS_ARM) DeepCopyInto(out *Namespaces_Queue_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(SBQueueProperties_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_Queue_STATUS_ARM. +func (in *Namespaces_Queue_STATUS_ARM) DeepCopy() *Namespaces_Queue_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Queue_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_Queue_Spec) DeepCopyInto(out *Namespaces_Queue_Spec) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Queue_Spec. +func (in *Namespaces_Queue_Spec) DeepCopy() *Namespaces_Queue_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Queue_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_Queue_Spec_ARM) DeepCopyInto(out *Namespaces_Queue_Spec_ARM) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(SBQueueProperties_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Queue_Spec_ARM. +func (in *Namespaces_Queue_Spec_ARM) DeepCopy() *Namespaces_Queue_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Queue_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_Topic_STATUS) DeepCopyInto(out *Namespaces_Topic_STATUS) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *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.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **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.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.SizeInBytes != nil { + in, out := &in.SizeInBytes, &out.SizeInBytes + *out = new(int) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EntityStatus_STATUS) + **out = **in + } + if in.SubscriptionCount != nil { + in, out := &in.SubscriptionCount, &out.SubscriptionCount + *out = new(int) + **out = **in + } + if in.SupportOrdering != nil { + in, out := &in.SupportOrdering, &out.SupportOrdering + *out = new(bool) + **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_Topic_STATUS. +func (in *Namespaces_Topic_STATUS) DeepCopy() *Namespaces_Topic_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Topic_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_Topic_STATUS_ARM) DeepCopyInto(out *Namespaces_Topic_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(SBTopicProperties_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_Topic_STATUS_ARM. +func (in *Namespaces_Topic_STATUS_ARM) DeepCopy() *Namespaces_Topic_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Topic_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_Topic_Spec) DeepCopyInto(out *Namespaces_Topic_Spec) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.SupportOrdering != nil { + in, out := &in.SupportOrdering, &out.SupportOrdering + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topic_Spec. +func (in *Namespaces_Topic_Spec) DeepCopy() *Namespaces_Topic_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Topic_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_Topic_Spec_ARM) DeepCopyInto(out *Namespaces_Topic_Spec_ARM) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(SBTopicProperties_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topic_Spec_ARM. +func (in *Namespaces_Topic_Spec_ARM) DeepCopy() *Namespaces_Topic_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Topic_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_Topics_Subscription_STATUS) DeepCopyInto(out *Namespaces_Topics_Subscription_STATUS) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.ClientAffineProperties != nil { + in, out := &in.ClientAffineProperties, &out.ClientAffineProperties + *out = new(SBClientAffineProperties_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.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DeadLetteringOnFilterEvaluationExceptions != nil { + in, out := &in.DeadLetteringOnFilterEvaluationExceptions, &out.DeadLetteringOnFilterEvaluationExceptions + *out = new(bool) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + if in.IsClientAffine != nil { + in, out := &in.IsClientAffine, &out.IsClientAffine + *out = new(bool) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MessageCount != nil { + in, out := &in.MessageCount, &out.MessageCount + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EntityStatus_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_Topics_Subscription_STATUS. +func (in *Namespaces_Topics_Subscription_STATUS) DeepCopy() *Namespaces_Topics_Subscription_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS_ARM) DeepCopyInto(out *Namespaces_Topics_Subscription_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(SBSubscriptionProperties_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_Topics_Subscription_STATUS_ARM. +func (in *Namespaces_Topics_Subscription_STATUS_ARM) DeepCopy() *Namespaces_Topics_Subscription_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscription_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_Topics_Subscription_Spec) DeepCopyInto(out *Namespaces_Topics_Subscription_Spec) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.ClientAffineProperties != nil { + in, out := &in.ClientAffineProperties, &out.ClientAffineProperties + *out = new(SBClientAffineProperties) + (*in).DeepCopyInto(*out) + } + if in.DeadLetteringOnFilterEvaluationExceptions != nil { + in, out := &in.DeadLetteringOnFilterEvaluationExceptions, &out.DeadLetteringOnFilterEvaluationExceptions + *out = new(bool) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.IsClientAffine != nil { + in, out := &in.IsClientAffine, &out.IsClientAffine + *out = new(bool) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topics_Subscription_Spec. +func (in *Namespaces_Topics_Subscription_Spec) DeepCopy() *Namespaces_Topics_Subscription_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscription_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_Topics_Subscription_Spec_ARM) DeepCopyInto(out *Namespaces_Topics_Subscription_Spec_ARM) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(SBSubscriptionProperties_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topics_Subscription_Spec_ARM. +func (in *Namespaces_Topics_Subscription_Spec_ARM) DeepCopy() *Namespaces_Topics_Subscription_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscription_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_Topics_Subscriptions_Rule_STATUS) DeepCopyInto(out *Namespaces_Topics_Subscriptions_Rule_STATUS) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(Action_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.CorrelationFilter != nil { + in, out := &in.CorrelationFilter, &out.CorrelationFilter + *out = new(CorrelationFilter_STATUS) + (*in).DeepCopyInto(*out) + } + if in.FilterType != nil { + in, out := &in.FilterType, &out.FilterType + *out = new(FilterType_STATUS) + **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.SqlFilter != nil { + in, out := &in.SqlFilter, &out.SqlFilter + *out = new(SqlFilter_STATUS) + (*in).DeepCopyInto(*out) + } + 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_Topics_Subscriptions_Rule_STATUS. +func (in *Namespaces_Topics_Subscriptions_Rule_STATUS) DeepCopy() *Namespaces_Topics_Subscriptions_Rule_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS_ARM) DeepCopyInto(out *Namespaces_Topics_Subscriptions_Rule_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(Ruleproperties_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_Topics_Subscriptions_Rule_STATUS_ARM. +func (in *Namespaces_Topics_Subscriptions_Rule_STATUS_ARM) DeepCopy() *Namespaces_Topics_Subscriptions_Rule_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec) DeepCopyInto(out *Namespaces_Topics_Subscriptions_Rule_Spec) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(Action) + (*in).DeepCopyInto(*out) + } + if in.CorrelationFilter != nil { + in, out := &in.CorrelationFilter, &out.CorrelationFilter + *out = new(CorrelationFilter) + (*in).DeepCopyInto(*out) + } + if in.FilterType != nil { + in, out := &in.FilterType, &out.FilterType + *out = new(FilterType) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.SqlFilter != nil { + in, out := &in.SqlFilter, &out.SqlFilter + *out = new(SqlFilter) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topics_Subscriptions_Rule_Spec. +func (in *Namespaces_Topics_Subscriptions_Rule_Spec) DeepCopy() *Namespaces_Topics_Subscriptions_Rule_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec_ARM) DeepCopyInto(out *Namespaces_Topics_Subscriptions_Rule_Spec_ARM) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(Ruleproperties_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topics_Subscriptions_Rule_Spec_ARM. +func (in *Namespaces_Topics_Subscriptions_Rule_Spec_ARM) DeepCopy() *Namespaces_Topics_Subscriptions_Rule_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscriptions_Rule_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 *Ruleproperties_ARM) DeepCopyInto(out *Ruleproperties_ARM) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(Action_ARM) + (*in).DeepCopyInto(*out) + } + if in.CorrelationFilter != nil { + in, out := &in.CorrelationFilter, &out.CorrelationFilter + *out = new(CorrelationFilter_ARM) + (*in).DeepCopyInto(*out) + } + if in.FilterType != nil { + in, out := &in.FilterType, &out.FilterType + *out = new(FilterType) + **out = **in + } + if in.SqlFilter != nil { + in, out := &in.SqlFilter, &out.SqlFilter + *out = new(SqlFilter_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ruleproperties_ARM. +func (in *Ruleproperties_ARM) DeepCopy() *Ruleproperties_ARM { + if in == nil { + return nil + } + out := new(Ruleproperties_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 *Ruleproperties_STATUS_ARM) DeepCopyInto(out *Ruleproperties_STATUS_ARM) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(Action_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.CorrelationFilter != nil { + in, out := &in.CorrelationFilter, &out.CorrelationFilter + *out = new(CorrelationFilter_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.FilterType != nil { + in, out := &in.FilterType, &out.FilterType + *out = new(FilterType_STATUS) + **out = **in + } + if in.SqlFilter != nil { + in, out := &in.SqlFilter, &out.SqlFilter + *out = new(SqlFilter_STATUS_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ruleproperties_STATUS_ARM. +func (in *Ruleproperties_STATUS_ARM) DeepCopy() *Ruleproperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(Ruleproperties_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 *SBClientAffineProperties) DeepCopyInto(out *SBClientAffineProperties) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.IsDurable != nil { + in, out := &in.IsDurable, &out.IsDurable + *out = new(bool) + **out = **in + } + if in.IsShared != nil { + in, out := &in.IsShared, &out.IsShared + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBClientAffineProperties. +func (in *SBClientAffineProperties) DeepCopy() *SBClientAffineProperties { + if in == nil { + return nil + } + out := new(SBClientAffineProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SBClientAffineProperties_ARM) DeepCopyInto(out *SBClientAffineProperties_ARM) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.IsDurable != nil { + in, out := &in.IsDurable, &out.IsDurable + *out = new(bool) + **out = **in + } + if in.IsShared != nil { + in, out := &in.IsShared, &out.IsShared + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBClientAffineProperties_ARM. +func (in *SBClientAffineProperties_ARM) DeepCopy() *SBClientAffineProperties_ARM { + if in == nil { + return nil + } + out := new(SBClientAffineProperties_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 *SBClientAffineProperties_STATUS) DeepCopyInto(out *SBClientAffineProperties_STATUS) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.IsDurable != nil { + in, out := &in.IsDurable, &out.IsDurable + *out = new(bool) + **out = **in + } + if in.IsShared != nil { + in, out := &in.IsShared, &out.IsShared + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBClientAffineProperties_STATUS. +func (in *SBClientAffineProperties_STATUS) DeepCopy() *SBClientAffineProperties_STATUS { + if in == nil { + return nil + } + out := new(SBClientAffineProperties_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 *SBClientAffineProperties_STATUS_ARM) DeepCopyInto(out *SBClientAffineProperties_STATUS_ARM) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.IsDurable != nil { + in, out := &in.IsDurable, &out.IsDurable + *out = new(bool) + **out = **in + } + if in.IsShared != nil { + in, out := &in.IsShared, &out.IsShared + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBClientAffineProperties_STATUS_ARM. +func (in *SBClientAffineProperties_STATUS_ARM) DeepCopy() *SBClientAffineProperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(SBClientAffineProperties_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 *SBNamespaceProperties_ARM) DeepCopyInto(out *SBNamespaceProperties_ARM) { + *out = *in + if in.AlternateName != nil { + in, out := &in.AlternateName, &out.AlternateName + *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.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 SBNamespaceProperties_ARM. +func (in *SBNamespaceProperties_ARM) DeepCopy() *SBNamespaceProperties_ARM { + if in == nil { + return nil + } + out := new(SBNamespaceProperties_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 *SBNamespaceProperties_STATUS_ARM) DeepCopyInto(out *SBNamespaceProperties_STATUS_ARM) { + *out = *in + if in.AlternateName != nil { + in, out := &in.AlternateName, &out.AlternateName + *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.MetricId != nil { + in, out := &in.MetricId, &out.MetricId + *out = new(string) + **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.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 SBNamespaceProperties_STATUS_ARM. +func (in *SBNamespaceProperties_STATUS_ARM) DeepCopy() *SBNamespaceProperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(SBNamespaceProperties_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 *SBQueueProperties_ARM) DeepCopyInto(out *SBQueueProperties_ARM) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBQueueProperties_ARM. +func (in *SBQueueProperties_ARM) DeepCopy() *SBQueueProperties_ARM { + if in == nil { + return nil + } + out := new(SBQueueProperties_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 *SBQueueProperties_STATUS_ARM) DeepCopyInto(out *SBQueueProperties_STATUS_ARM) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.MessageCount != nil { + in, out := &in.MessageCount, &out.MessageCount + *out = new(int) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } + if in.SizeInBytes != nil { + in, out := &in.SizeInBytes, &out.SizeInBytes + *out = new(int) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EntityStatus_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 SBQueueProperties_STATUS_ARM. +func (in *SBQueueProperties_STATUS_ARM) DeepCopy() *SBQueueProperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(SBQueueProperties_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 *SBSku) DeepCopyInto(out *SBSku) { + *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(SBSku_Name) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(SBSku_Tier) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBSku. +func (in *SBSku) DeepCopy() *SBSku { + if in == nil { + return nil + } + out := new(SBSku) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SBSku_ARM) DeepCopyInto(out *SBSku_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(SBSku_Name) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(SBSku_Tier) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBSku_ARM. +func (in *SBSku_ARM) DeepCopy() *SBSku_ARM { + if in == nil { + return nil + } + out := new(SBSku_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 *SBSku_STATUS) DeepCopyInto(out *SBSku_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(SBSku_Name_STATUS) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(SBSku_Tier_STATUS) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBSku_STATUS. +func (in *SBSku_STATUS) DeepCopy() *SBSku_STATUS { + if in == nil { + return nil + } + out := new(SBSku_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 *SBSku_STATUS_ARM) DeepCopyInto(out *SBSku_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(SBSku_Name_STATUS) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(SBSku_Tier_STATUS) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBSku_STATUS_ARM. +func (in *SBSku_STATUS_ARM) DeepCopy() *SBSku_STATUS_ARM { + if in == nil { + return nil + } + out := new(SBSku_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 *SBSubscriptionProperties_ARM) DeepCopyInto(out *SBSubscriptionProperties_ARM) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.ClientAffineProperties != nil { + in, out := &in.ClientAffineProperties, &out.ClientAffineProperties + *out = new(SBClientAffineProperties_ARM) + (*in).DeepCopyInto(*out) + } + if in.DeadLetteringOnFilterEvaluationExceptions != nil { + in, out := &in.DeadLetteringOnFilterEvaluationExceptions, &out.DeadLetteringOnFilterEvaluationExceptions + *out = new(bool) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.IsClientAffine != nil { + in, out := &in.IsClientAffine, &out.IsClientAffine + *out = new(bool) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBSubscriptionProperties_ARM. +func (in *SBSubscriptionProperties_ARM) DeepCopy() *SBSubscriptionProperties_ARM { + if in == nil { + return nil + } + out := new(SBSubscriptionProperties_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 *SBSubscriptionProperties_STATUS_ARM) DeepCopyInto(out *SBSubscriptionProperties_STATUS_ARM) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.ClientAffineProperties != nil { + in, out := &in.ClientAffineProperties, &out.ClientAffineProperties + *out = new(SBClientAffineProperties_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DeadLetteringOnFilterEvaluationExceptions != nil { + in, out := &in.DeadLetteringOnFilterEvaluationExceptions, &out.DeadLetteringOnFilterEvaluationExceptions + *out = new(bool) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.IsClientAffine != nil { + in, out := &in.IsClientAffine, &out.IsClientAffine + *out = new(bool) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MessageCount != nil { + in, out := &in.MessageCount, &out.MessageCount + *out = new(int) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EntityStatus_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 SBSubscriptionProperties_STATUS_ARM. +func (in *SBSubscriptionProperties_STATUS_ARM) DeepCopy() *SBSubscriptionProperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(SBSubscriptionProperties_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 *SBTopicProperties_ARM) DeepCopyInto(out *SBTopicProperties_ARM) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.SupportOrdering != nil { + in, out := &in.SupportOrdering, &out.SupportOrdering + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBTopicProperties_ARM. +func (in *SBTopicProperties_ARM) DeepCopy() *SBTopicProperties_ARM { + if in == nil { + return nil + } + out := new(SBTopicProperties_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 *SBTopicProperties_STATUS_ARM) DeepCopyInto(out *SBTopicProperties_STATUS_ARM) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.SizeInBytes != nil { + in, out := &in.SizeInBytes, &out.SizeInBytes + *out = new(int) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EntityStatus_STATUS) + **out = **in + } + if in.SubscriptionCount != nil { + in, out := &in.SubscriptionCount, &out.SubscriptionCount + *out = new(int) + **out = **in + } + if in.SupportOrdering != nil { + in, out := &in.SupportOrdering, &out.SupportOrdering + *out = new(bool) + **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 SBTopicProperties_STATUS_ARM. +func (in *SBTopicProperties_STATUS_ARM) DeepCopy() *SBTopicProperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(SBTopicProperties_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 *SqlFilter) DeepCopyInto(out *SqlFilter) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SqlFilter. +func (in *SqlFilter) DeepCopy() *SqlFilter { + if in == nil { + return nil + } + out := new(SqlFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SqlFilter_ARM) DeepCopyInto(out *SqlFilter_ARM) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SqlFilter_ARM. +func (in *SqlFilter_ARM) DeepCopy() *SqlFilter_ARM { + if in == nil { + return nil + } + out := new(SqlFilter_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 *SqlFilter_STATUS) DeepCopyInto(out *SqlFilter_STATUS) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SqlFilter_STATUS. +func (in *SqlFilter_STATUS) DeepCopy() *SqlFilter_STATUS { + if in == nil { + return nil + } + out := new(SqlFilter_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 *SqlFilter_STATUS_ARM) DeepCopyInto(out *SqlFilter_STATUS_ARM) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SqlFilter_STATUS_ARM. +func (in *SqlFilter_STATUS_ARM) DeepCopy() *SqlFilter_STATUS_ARM { + if in == nil { + return nil + } + out := new(SqlFilter_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/servicebus/v1api20211101storage/groupversion_info_gen.go b/v2/api/servicebus/v1api20211101storage/groupversion_info_gen.go new file mode 100644 index 00000000000..22d3ae2293f --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/groupversion_info_gen.go @@ -0,0 +1,31 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package v1api20211101storage contains API Schema definitions for the servicebus v1api20211101storage API group +// +kubebuilder:object:generate=true +// All object properties are optional by default, this will be overridden when needed: +// +kubebuilder:validation:Optional +// +groupName=servicebus.azure.com +package v1api20211101storage + +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: "servicebus.azure.com", Version: "v1api20211101storage"} + + // 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/servicebus/v1api20211101storage/namespace_types_gen.go b/v2/api/servicebus/v1api20211101storage/namespace_types_gen.go new file mode 100644 index 00000000000..74d711ddeec --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/namespace_types_gen.go @@ -0,0 +1,373 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101storage + +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=servicebus.azure.com,resources=namespaces,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=servicebus.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 v1api20211101.Namespace +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/namespace-preview.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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 "2021-11-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 +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces" +func (namespace *Namespace) GetType() string { + return "Microsoft.ServiceBus/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 &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: namespace.Spec.Owner.Name, + } +} + +// 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 v1api20211101.Namespace +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/namespace-preview.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName} +type NamespaceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Namespace `json:"items"` +} + +// Storage version of v1api20211101.APIVersion +// +kubebuilder:validation:Enum={"2021-11-01"} +type APIVersion string + +const APIVersion_Value = APIVersion("2021-11-01") + +// Storage version of v1api20211101.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"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Encryption *Encryption `json:"encryption,omitempty"` + Identity *Identity `json:"identity,omitempty"` + Location *string `json:"location,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"` + Sku *SBSku `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 v1api20211101.Namespace_STATUS +type Namespace_STATUS struct { + AlternateName *string `json:"alternateName,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"` + Location *string `json:"location,omitempty"` + MetricId *string `json:"metricId,omitempty"` + Name *string `json:"name,omitempty"` + PrivateEndpointConnections []PrivateEndpointConnection_STATUS `json:"privateEndpointConnections,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"` + Sku *SBSku_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 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"` +} + +// 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"` +} + +// Storage version of v1api20211101.Identity +// Properties to configure User Assigned Identities 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 v1api20211101.Identity_STATUS +// Properties to configure User Assigned Identities 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 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"` +} + +// 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"` +} + +// Storage version of v1api20211101.SBSku +// SKU of the namespace. +type SBSku 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 v1api20211101.SBSku_STATUS +// SKU of the namespace. +type SBSku_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 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"` +} + +// 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"` +} + +// 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"` +} + +// Storage version of v1api20211101.NamespaceOperatorSecrets +type NamespaceOperatorSecrets struct { + Endpoint *genruntime.SecretDestination `json:"endpoint,omitempty"` + 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 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"` +} + +// 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 { + 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 v1api20211101.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/servicebus/v1api20211101storage/namespace_types_gen_test.go b/v2/api/servicebus/v1api20211101storage/namespace_types_gen_test.go new file mode 100644 index 00000000000..3c09d3a6a14 --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/namespace_types_gen_test.go @@ -0,0 +1,1305 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101storage + +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["Location"] = gen.PtrOf(gen.AlphaString()) + gens["OriginalVersion"] = 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(SBSkuGenerator()) +} + +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["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MetricId"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["ProvisioningState"] = 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(SBSku_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_SBSku_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 SBSku via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSku, SBSkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSku runs a test to see if a specific instance of SBSku round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSku(subject SBSku) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSku + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SBSku instances for property testing - lazily instantiated by SBSkuGenerator() +var sbSkuGenerator gopter.Gen + +// SBSkuGenerator returns a generator of SBSku instances for property testing. +func SBSkuGenerator() gopter.Gen { + if sbSkuGenerator != nil { + return sbSkuGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSku(generators) + sbSkuGenerator = gen.Struct(reflect.TypeOf(SBSku{}), generators) + + return sbSkuGenerator +} + +// AddIndependentPropertyGeneratorsForSBSku is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSku(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_SBSku_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 SBSku_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSku_STATUS, SBSku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSku_STATUS runs a test to see if a specific instance of SBSku_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSku_STATUS(subject SBSku_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSku_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 SBSku_STATUS instances for property testing - lazily instantiated by SBSku_STATUSGenerator() +var sbSku_STATUSGenerator gopter.Gen + +// SBSku_STATUSGenerator returns a generator of SBSku_STATUS instances for property testing. +func SBSku_STATUSGenerator() gopter.Gen { + if sbSku_STATUSGenerator != nil { + return sbSku_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSku_STATUS(generators) + sbSku_STATUSGenerator = gen.Struct(reflect.TypeOf(SBSku_STATUS{}), generators) + + return sbSku_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSBSku_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSku_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/servicebus/v1api20211101storage/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20211101storage/namespaces_authorization_rule_types_gen.go new file mode 100644 index 00000000000..4b0398cb5b0 --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/namespaces_authorization_rule_types_gen.go @@ -0,0 +1,225 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101storage + +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=servicebus.azure.com,resources=namespacesauthorizationrules,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=servicebus.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 v1api20211101.NamespacesAuthorizationRule +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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 "2021-11-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 +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/AuthorizationRules" +func (rule *NamespacesAuthorizationRule) GetType() string { + return "Microsoft.ServiceBus/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 &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: rule.Spec.Owner.Name, + } +} + +// 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 v1api20211101.NamespacesAuthorizationRule +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName} +type NamespacesAuthorizationRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesAuthorizationRule `json:"items"` +} + +// Storage version of v1api20211101.Namespaces_AuthorizationRule_Spec +type Namespaces_AuthorizationRule_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"` + 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 servicebus.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"servicebus.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 v1api20211101.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 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"` +} + +// 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"` +} + +func init() { + SchemeBuilder.Register(&NamespacesAuthorizationRule{}, &NamespacesAuthorizationRuleList{}) +} diff --git a/v2/api/servicebus/v1api20211101storage/namespaces_authorization_rule_types_gen_test.go b/v2/api/servicebus/v1api20211101storage/namespaces_authorization_rule_types_gen_test.go new file mode 100644 index 00000000000..c2ebfc4a8b8 --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/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 v1api20211101storage + +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/servicebus/v1api20211101storage/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20211101storage/namespaces_queue_types_gen.go new file mode 100644 index 00000000000..ef4e63012c5 --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/namespaces_queue_types_gen.go @@ -0,0 +1,254 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101storage + +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=servicebus.azure.com,resources=namespacesqueues,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=servicebus.azure.com,resources={namespacesqueues/status,namespacesqueues/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 v1api20211101.NamespacesQueue +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/Queue.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName} +type NamespacesQueue struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Queue_Spec `json:"spec,omitempty"` + Status Namespaces_Queue_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesQueue{} + +// GetConditions returns the conditions of the resource +func (queue *NamespacesQueue) GetConditions() conditions.Conditions { + return queue.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (queue *NamespacesQueue) SetConditions(conditions conditions.Conditions) { + queue.Status.Conditions = conditions +} + +var _ genruntime.KubernetesResource = &NamespacesQueue{} + +// AzureName returns the Azure name of the resource +func (queue *NamespacesQueue) AzureName() string { + return queue.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01" +func (queue NamespacesQueue) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (queue *NamespacesQueue) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (queue *NamespacesQueue) GetSpec() genruntime.ConvertibleSpec { + return &queue.Spec +} + +// GetStatus returns the status of this resource +func (queue *NamespacesQueue) GetStatus() genruntime.ConvertibleStatus { + return &queue.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/queues" +func (queue *NamespacesQueue) GetType() string { + return "Microsoft.ServiceBus/namespaces/queues" +} + +// NewEmptyStatus returns a new empty (blank) status +func (queue *NamespacesQueue) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Queue_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (queue *NamespacesQueue) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: queue.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (queue *NamespacesQueue) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Queue_STATUS); ok { + queue.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Queue_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + queue.Status = st + return nil +} + +// Hub marks that this NamespacesQueue is the hub type for conversion +func (queue *NamespacesQueue) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (queue *NamespacesQueue) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: queue.Spec.OriginalVersion, + Kind: "NamespacesQueue", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20211101.NamespacesQueue +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/Queue.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName} +type NamespacesQueueList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesQueue `json:"items"` +} + +// Storage version of v1api20211101.Namespaces_Queue_Spec +type Namespaces_Queue_Spec struct { + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // +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"` + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + EnableExpress *bool `json:"enableExpress,omitempty"` + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + ForwardTo *string `json:"forwardTo,omitempty"` + LockDuration *string `json:"lockDuration,omitempty"` + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,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 servicebus.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"Namespace"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + RequiresSession *bool `json:"requiresSession,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Queue_Spec{} + +// ConvertSpecFrom populates our Namespaces_Queue_Spec from the provided source +func (queue *Namespaces_Queue_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == queue { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return source.ConvertSpecTo(queue) +} + +// ConvertSpecTo populates the provided destination from our Namespaces_Queue_Spec +func (queue *Namespaces_Queue_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == queue { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(queue) +} + +// Storage version of v1api20211101.Namespaces_Queue_STATUS +type Namespaces_Queue_STATUS struct { + AccessedAt *string `json:"accessedAt,omitempty"` + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + Conditions []conditions.Condition `json:"conditions,omitempty"` + CountDetails *MessageCountDetails_STATUS `json:"countDetails,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + EnableExpress *bool `json:"enableExpress,omitempty"` + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + ForwardTo *string `json:"forwardTo,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + LockDuration *string `json:"lockDuration,omitempty"` + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + MessageCount *int `json:"messageCount,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + RequiresSession *bool `json:"requiresSession,omitempty"` + SizeInBytes *int `json:"sizeInBytes,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_Queue_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Queue_STATUS from the provided source +func (queue *Namespaces_Queue_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == queue { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return source.ConvertStatusTo(queue) +} + +// ConvertStatusTo populates the provided destination from our Namespaces_Queue_STATUS +func (queue *Namespaces_Queue_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == queue { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(queue) +} + +// Storage version of v1api20211101.MessageCountDetails_STATUS +// Message Count Details. +type MessageCountDetails_STATUS struct { + ActiveMessageCount *int `json:"activeMessageCount,omitempty"` + DeadLetterMessageCount *int `json:"deadLetterMessageCount,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ScheduledMessageCount *int `json:"scheduledMessageCount,omitempty"` + TransferDeadLetterMessageCount *int `json:"transferDeadLetterMessageCount,omitempty"` + TransferMessageCount *int `json:"transferMessageCount,omitempty"` +} + +func init() { + SchemeBuilder.Register(&NamespacesQueue{}, &NamespacesQueueList{}) +} diff --git a/v2/api/servicebus/v1api20211101storage/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1api20211101storage/namespaces_queue_types_gen_test.go new file mode 100644 index 00000000000..ed98452986b --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/namespaces_queue_types_gen_test.go @@ -0,0 +1,321 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101storage + +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_NamespacesQueue_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 NamespacesQueue via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesQueue, NamespacesQueueGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesQueue runs a test to see if a specific instance of NamespacesQueue round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesQueue(subject NamespacesQueue) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesQueue + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesQueue instances for property testing - lazily instantiated by NamespacesQueueGenerator() +var namespacesQueueGenerator gopter.Gen + +// NamespacesQueueGenerator returns a generator of NamespacesQueue instances for property testing. +func NamespacesQueueGenerator() gopter.Gen { + if namespacesQueueGenerator != nil { + return namespacesQueueGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesQueue(generators) + namespacesQueueGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue{}), generators) + + return namespacesQueueGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesQueue is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesQueue(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Queue_SpecGenerator() + gens["Status"] = Namespaces_Queue_STATUSGenerator() +} + +func Test_Namespaces_Queue_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_Queue_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Queue_Spec, Namespaces_Queue_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Queue_Spec runs a test to see if a specific instance of Namespaces_Queue_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Queue_Spec(subject Namespaces_Queue_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Queue_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_Queue_Spec instances for property testing - lazily instantiated by +// Namespaces_Queue_SpecGenerator() +var namespaces_Queue_SpecGenerator gopter.Gen + +// Namespaces_Queue_SpecGenerator returns a generator of Namespaces_Queue_Spec instances for property testing. +func Namespaces_Queue_SpecGenerator() gopter.Gen { + if namespaces_Queue_SpecGenerator != nil { + return namespaces_Queue_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec(generators) + namespaces_Queue_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_Spec{}), generators) + + return namespaces_Queue_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["OriginalVersion"] = gen.AlphaString() + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) +} + +func Test_Namespaces_Queue_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_Queue_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Queue_STATUS, Namespaces_Queue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Queue_STATUS runs a test to see if a specific instance of Namespaces_Queue_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Queue_STATUS(subject Namespaces_Queue_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Queue_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_Queue_STATUS instances for property testing - lazily instantiated by +// Namespaces_Queue_STATUSGenerator() +var namespaces_Queue_STATUSGenerator gopter.Gen + +// Namespaces_Queue_STATUSGenerator returns a generator of Namespaces_Queue_STATUS instances for property testing. +// We first initialize namespaces_Queue_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_Queue_STATUSGenerator() gopter.Gen { + if namespaces_Queue_STATUSGenerator != nil { + return namespaces_Queue_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS(generators) + namespaces_Queue_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS(generators) + namespaces_Queue_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_STATUS{}), generators) + + return namespaces_Queue_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["MessageCount"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) + gens["SizeInBytes"] = gen.PtrOf(gen.Int()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_MessageCountDetails_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 MessageCountDetails_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForMessageCountDetails_STATUS, MessageCountDetails_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForMessageCountDetails_STATUS runs a test to see if a specific instance of MessageCountDetails_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForMessageCountDetails_STATUS(subject MessageCountDetails_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual MessageCountDetails_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 MessageCountDetails_STATUS instances for property testing - lazily instantiated by +// MessageCountDetails_STATUSGenerator() +var messageCountDetails_STATUSGenerator gopter.Gen + +// MessageCountDetails_STATUSGenerator returns a generator of MessageCountDetails_STATUS instances for property testing. +func MessageCountDetails_STATUSGenerator() gopter.Gen { + if messageCountDetails_STATUSGenerator != nil { + return messageCountDetails_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS(generators) + messageCountDetails_STATUSGenerator = gen.Struct(reflect.TypeOf(MessageCountDetails_STATUS{}), generators) + + return messageCountDetails_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS(gens map[string]gopter.Gen) { + gens["ActiveMessageCount"] = gen.PtrOf(gen.Int()) + gens["DeadLetterMessageCount"] = gen.PtrOf(gen.Int()) + gens["ScheduledMessageCount"] = gen.PtrOf(gen.Int()) + gens["TransferDeadLetterMessageCount"] = gen.PtrOf(gen.Int()) + gens["TransferMessageCount"] = gen.PtrOf(gen.Int()) +} diff --git a/v2/api/servicebus/v1api20211101storage/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20211101storage/namespaces_topic_types_gen.go new file mode 100644 index 00000000000..dd040f3b8cc --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/namespaces_topic_types_gen.go @@ -0,0 +1,233 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101storage + +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=servicebus.azure.com,resources=namespacestopics,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=servicebus.azure.com,resources={namespacestopics/status,namespacestopics/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 v1api20211101.NamespacesTopic +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/topics.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName} +type NamespacesTopic struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Topic_Spec `json:"spec,omitempty"` + Status Namespaces_Topic_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesTopic{} + +// GetConditions returns the conditions of the resource +func (topic *NamespacesTopic) GetConditions() conditions.Conditions { + return topic.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (topic *NamespacesTopic) SetConditions(conditions conditions.Conditions) { + topic.Status.Conditions = conditions +} + +var _ genruntime.KubernetesResource = &NamespacesTopic{} + +// AzureName returns the Azure name of the resource +func (topic *NamespacesTopic) AzureName() string { + return topic.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01" +func (topic NamespacesTopic) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (topic *NamespacesTopic) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (topic *NamespacesTopic) GetSpec() genruntime.ConvertibleSpec { + return &topic.Spec +} + +// GetStatus returns the status of this resource +func (topic *NamespacesTopic) GetStatus() genruntime.ConvertibleStatus { + return &topic.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics" +func (topic *NamespacesTopic) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics" +} + +// NewEmptyStatus returns a new empty (blank) status +func (topic *NamespacesTopic) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Topic_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (topic *NamespacesTopic) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: topic.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (topic *NamespacesTopic) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Topic_STATUS); ok { + topic.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Topic_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + topic.Status = st + return nil +} + +// Hub marks that this NamespacesTopic is the hub type for conversion +func (topic *NamespacesTopic) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (topic *NamespacesTopic) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: topic.Spec.OriginalVersion, + Kind: "NamespacesTopic", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20211101.NamespacesTopic +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/topics.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName} +type NamespacesTopicList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesTopic `json:"items"` +} + +// Storage version of v1api20211101.Namespaces_Topic_Spec +type Namespaces_Topic_Spec struct { + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // +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"` + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + EnableExpress *bool `json:"enableExpress,omitempty"` + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,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 servicebus.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"Namespace"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + SupportOrdering *bool `json:"supportOrdering,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Topic_Spec{} + +// ConvertSpecFrom populates our Namespaces_Topic_Spec from the provided source +func (topic *Namespaces_Topic_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == topic { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return source.ConvertSpecTo(topic) +} + +// ConvertSpecTo populates the provided destination from our Namespaces_Topic_Spec +func (topic *Namespaces_Topic_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == topic { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(topic) +} + +// Storage version of v1api20211101.Namespaces_Topic_STATUS +type Namespaces_Topic_STATUS struct { + AccessedAt *string `json:"accessedAt,omitempty"` + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + Conditions []conditions.Condition `json:"conditions,omitempty"` + CountDetails *MessageCountDetails_STATUS `json:"countDetails,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + EnableExpress *bool `json:"enableExpress,omitempty"` + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + SizeInBytes *int `json:"sizeInBytes,omitempty"` + Status *string `json:"status,omitempty"` + SubscriptionCount *int `json:"subscriptionCount,omitempty"` + SupportOrdering *bool `json:"supportOrdering,omitempty"` + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespaces_Topic_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Topic_STATUS from the provided source +func (topic *Namespaces_Topic_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == topic { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return source.ConvertStatusTo(topic) +} + +// ConvertStatusTo populates the provided destination from our Namespaces_Topic_STATUS +func (topic *Namespaces_Topic_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == topic { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(topic) +} + +func init() { + SchemeBuilder.Register(&NamespacesTopic{}, &NamespacesTopicList{}) +} diff --git a/v2/api/servicebus/v1api20211101storage/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1api20211101storage/namespaces_topic_types_gen_test.go new file mode 100644 index 00000000000..e4b3f728958 --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/namespaces_topic_types_gen_test.go @@ -0,0 +1,246 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101storage + +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_NamespacesTopic_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 NamespacesTopic via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopic, NamespacesTopicGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopic runs a test to see if a specific instance of NamespacesTopic round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopic(subject NamespacesTopic) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopic + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopic instances for property testing - lazily instantiated by NamespacesTopicGenerator() +var namespacesTopicGenerator gopter.Gen + +// NamespacesTopicGenerator returns a generator of NamespacesTopic instances for property testing. +func NamespacesTopicGenerator() gopter.Gen { + if namespacesTopicGenerator != nil { + return namespacesTopicGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesTopic(generators) + namespacesTopicGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic{}), generators) + + return namespacesTopicGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesTopic is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopic(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Topic_SpecGenerator() + gens["Status"] = Namespaces_Topic_STATUSGenerator() +} + +func Test_Namespaces_Topic_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_Topic_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topic_Spec, Namespaces_Topic_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topic_Spec runs a test to see if a specific instance of Namespaces_Topic_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topic_Spec(subject Namespaces_Topic_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topic_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_Topic_Spec instances for property testing - lazily instantiated by +// Namespaces_Topic_SpecGenerator() +var namespaces_Topic_SpecGenerator gopter.Gen + +// Namespaces_Topic_SpecGenerator returns a generator of Namespaces_Topic_Spec instances for property testing. +func Namespaces_Topic_SpecGenerator() gopter.Gen { + if namespaces_Topic_SpecGenerator != nil { + return namespaces_Topic_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec(generators) + namespaces_Topic_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_Spec{}), generators) + + return namespaces_Topic_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["OriginalVersion"] = gen.AlphaString() + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["SupportOrdering"] = gen.PtrOf(gen.Bool()) +} + +func Test_Namespaces_Topic_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_Topic_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topic_STATUS, Namespaces_Topic_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topic_STATUS runs a test to see if a specific instance of Namespaces_Topic_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topic_STATUS(subject Namespaces_Topic_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topic_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_Topic_STATUS instances for property testing - lazily instantiated by +// Namespaces_Topic_STATUSGenerator() +var namespaces_Topic_STATUSGenerator gopter.Gen + +// Namespaces_Topic_STATUSGenerator returns a generator of Namespaces_Topic_STATUS instances for property testing. +// We first initialize namespaces_Topic_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_Topic_STATUSGenerator() gopter.Gen { + if namespaces_Topic_STATUSGenerator != nil { + return namespaces_Topic_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS(generators) + namespaces_Topic_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS(generators) + namespaces_Topic_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_STATUS{}), generators) + + return namespaces_Topic_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["SizeInBytes"] = gen.PtrOf(gen.Int()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) + gens["SubscriptionCount"] = gen.PtrOf(gen.Int()) + gens["SupportOrdering"] = gen.PtrOf(gen.Bool()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} diff --git a/v2/api/servicebus/v1api20211101storage/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20211101storage/namespaces_topics_subscription_types_gen.go new file mode 100644 index 00000000000..3e909e7f052 --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/namespaces_topics_subscription_types_gen.go @@ -0,0 +1,257 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101storage + +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=servicebus.azure.com,resources=namespacestopicssubscriptions,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=servicebus.azure.com,resources={namespacestopicssubscriptions/status,namespacestopicssubscriptions/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 v1api20211101.NamespacesTopicsSubscription +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/subscriptions.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName} +type NamespacesTopicsSubscription struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Topics_Subscription_Spec `json:"spec,omitempty"` + Status Namespaces_Topics_Subscription_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesTopicsSubscription{} + +// GetConditions returns the conditions of the resource +func (subscription *NamespacesTopicsSubscription) GetConditions() conditions.Conditions { + return subscription.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (subscription *NamespacesTopicsSubscription) SetConditions(conditions conditions.Conditions) { + subscription.Status.Conditions = conditions +} + +var _ genruntime.KubernetesResource = &NamespacesTopicsSubscription{} + +// AzureName returns the Azure name of the resource +func (subscription *NamespacesTopicsSubscription) AzureName() string { + return subscription.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01" +func (subscription NamespacesTopicsSubscription) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (subscription *NamespacesTopicsSubscription) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (subscription *NamespacesTopicsSubscription) GetSpec() genruntime.ConvertibleSpec { + return &subscription.Spec +} + +// GetStatus returns the status of this resource +func (subscription *NamespacesTopicsSubscription) GetStatus() genruntime.ConvertibleStatus { + return &subscription.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions" +func (subscription *NamespacesTopicsSubscription) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions" +} + +// NewEmptyStatus returns a new empty (blank) status +func (subscription *NamespacesTopicsSubscription) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Topics_Subscription_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (subscription *NamespacesTopicsSubscription) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: subscription.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (subscription *NamespacesTopicsSubscription) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Topics_Subscription_STATUS); ok { + subscription.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Topics_Subscription_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + subscription.Status = st + return nil +} + +// Hub marks that this NamespacesTopicsSubscription is the hub type for conversion +func (subscription *NamespacesTopicsSubscription) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (subscription *NamespacesTopicsSubscription) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: subscription.Spec.OriginalVersion, + Kind: "NamespacesTopicsSubscription", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20211101.NamespacesTopicsSubscription +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/subscriptions.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName} +type NamespacesTopicsSubscriptionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesTopicsSubscription `json:"items"` +} + +// Storage version of v1api20211101.Namespaces_Topics_Subscription_Spec +type Namespaces_Topics_Subscription_Spec struct { + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // +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"` + ClientAffineProperties *SBClientAffineProperties `json:"clientAffineProperties,omitempty"` + DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"` + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + ForwardTo *string `json:"forwardTo,omitempty"` + IsClientAffine *bool `json:"isClientAffine,omitempty"` + LockDuration *string `json:"lockDuration,omitempty"` + MaxDeliveryCount *int `json:"maxDeliveryCount,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 servicebus.azure.com/NamespacesTopic resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"NamespacesTopic"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresSession *bool `json:"requiresSession,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Topics_Subscription_Spec{} + +// ConvertSpecFrom populates our Namespaces_Topics_Subscription_Spec from the provided source +func (subscription *Namespaces_Topics_Subscription_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == subscription { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return source.ConvertSpecTo(subscription) +} + +// ConvertSpecTo populates the provided destination from our Namespaces_Topics_Subscription_Spec +func (subscription *Namespaces_Topics_Subscription_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == subscription { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(subscription) +} + +// Storage version of v1api20211101.Namespaces_Topics_Subscription_STATUS +type Namespaces_Topics_Subscription_STATUS struct { + AccessedAt *string `json:"accessedAt,omitempty"` + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + ClientAffineProperties *SBClientAffineProperties_STATUS `json:"clientAffineProperties,omitempty"` + Conditions []conditions.Condition `json:"conditions,omitempty"` + CountDetails *MessageCountDetails_STATUS `json:"countDetails,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"` + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + ForwardTo *string `json:"forwardTo,omitempty"` + Id *string `json:"id,omitempty"` + IsClientAffine *bool `json:"isClientAffine,omitempty"` + Location *string `json:"location,omitempty"` + LockDuration *string `json:"lockDuration,omitempty"` + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + MessageCount *int `json:"messageCount,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresSession *bool `json:"requiresSession,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_Topics_Subscription_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Topics_Subscription_STATUS from the provided source +func (subscription *Namespaces_Topics_Subscription_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == subscription { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return source.ConvertStatusTo(subscription) +} + +// ConvertStatusTo populates the provided destination from our Namespaces_Topics_Subscription_STATUS +func (subscription *Namespaces_Topics_Subscription_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == subscription { + return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(subscription) +} + +// Storage version of v1api20211101.SBClientAffineProperties +// Properties specific to client affine subscriptions. +type SBClientAffineProperties struct { + ClientId *string `json:"clientId,omitempty"` + IsDurable *bool `json:"isDurable,omitempty"` + IsShared *bool `json:"isShared,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20211101.SBClientAffineProperties_STATUS +// Properties specific to client affine subscriptions. +type SBClientAffineProperties_STATUS struct { + ClientId *string `json:"clientId,omitempty"` + IsDurable *bool `json:"isDurable,omitempty"` + IsShared *bool `json:"isShared,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +func init() { + SchemeBuilder.Register(&NamespacesTopicsSubscription{}, &NamespacesTopicsSubscriptionList{}) +} diff --git a/v2/api/servicebus/v1api20211101storage/namespaces_topics_subscription_types_gen_test.go b/v2/api/servicebus/v1api20211101storage/namespaces_topics_subscription_types_gen_test.go new file mode 100644 index 00000000000..31dd2fb8d9d --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/namespaces_topics_subscription_types_gen_test.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 v1api20211101storage + +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_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscription, NamespacesTopicsSubscriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscription runs a test to see if a specific instance of NamespacesTopicsSubscription round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscription(subject NamespacesTopicsSubscription) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscription + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicsSubscription instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionGenerator() +var namespacesTopicsSubscriptionGenerator gopter.Gen + +// NamespacesTopicsSubscriptionGenerator returns a generator of NamespacesTopicsSubscription instances for property testing. +func NamespacesTopicsSubscriptionGenerator() gopter.Gen { + if namespacesTopicsSubscriptionGenerator != nil { + return namespacesTopicsSubscriptionGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription(generators) + namespacesTopicsSubscriptionGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription{}), generators) + + return namespacesTopicsSubscriptionGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Topics_Subscription_SpecGenerator() + gens["Status"] = Namespaces_Topics_Subscription_STATUSGenerator() +} + +func Test_Namespaces_Topics_Subscription_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_Topics_Subscription_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec, Namespaces_Topics_Subscription_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec runs a test to see if a specific instance of Namespaces_Topics_Subscription_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec(subject Namespaces_Topics_Subscription_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscription_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_Topics_Subscription_Spec instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscription_SpecGenerator() +var namespaces_Topics_Subscription_SpecGenerator gopter.Gen + +// Namespaces_Topics_Subscription_SpecGenerator returns a generator of Namespaces_Topics_Subscription_Spec instances for property testing. +// We first initialize namespaces_Topics_Subscription_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_Topics_Subscription_SpecGenerator() gopter.Gen { + if namespaces_Topics_Subscription_SpecGenerator != nil { + return namespaces_Topics_Subscription_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(generators) + namespaces_Topics_Subscription_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(generators) + namespaces_Topics_Subscription_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_Spec{}), generators) + + return namespaces_Topics_Subscription_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DeadLetteringOnFilterEvaluationExceptions"] = gen.PtrOf(gen.Bool()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["IsClientAffine"] = gen.PtrOf(gen.Bool()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["OriginalVersion"] = gen.AlphaString() + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffinePropertiesGenerator()) +} + +func Test_Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS, Namespaces_Topics_Subscription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS runs a test to see if a specific instance of Namespaces_Topics_Subscription_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS(subject Namespaces_Topics_Subscription_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscription_STATUSGenerator() +var namespaces_Topics_Subscription_STATUSGenerator gopter.Gen + +// Namespaces_Topics_Subscription_STATUSGenerator returns a generator of Namespaces_Topics_Subscription_STATUS instances for property testing. +// We first initialize namespaces_Topics_Subscription_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_Topics_Subscription_STATUSGenerator() gopter.Gen { + if namespaces_Topics_Subscription_STATUSGenerator != nil { + return namespaces_Topics_Subscription_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(generators) + namespaces_Topics_Subscription_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(generators) + namespaces_Topics_Subscription_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_STATUS{}), generators) + + return namespaces_Topics_Subscription_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnFilterEvaluationExceptions"] = gen.PtrOf(gen.Bool()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["IsClientAffine"] = gen.PtrOf(gen.Bool()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MessageCount"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffineProperties_STATUSGenerator()) + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_SBClientAffineProperties_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 SBClientAffineProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBClientAffineProperties, SBClientAffinePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBClientAffineProperties runs a test to see if a specific instance of SBClientAffineProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForSBClientAffineProperties(subject SBClientAffineProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBClientAffineProperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SBClientAffineProperties instances for property testing - lazily instantiated by +// SBClientAffinePropertiesGenerator() +var sbClientAffinePropertiesGenerator gopter.Gen + +// SBClientAffinePropertiesGenerator returns a generator of SBClientAffineProperties instances for property testing. +func SBClientAffinePropertiesGenerator() gopter.Gen { + if sbClientAffinePropertiesGenerator != nil { + return sbClientAffinePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBClientAffineProperties(generators) + sbClientAffinePropertiesGenerator = gen.Struct(reflect.TypeOf(SBClientAffineProperties{}), generators) + + return sbClientAffinePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForSBClientAffineProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBClientAffineProperties(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["IsDurable"] = gen.PtrOf(gen.Bool()) + gens["IsShared"] = gen.PtrOf(gen.Bool()) +} + +func Test_SBClientAffineProperties_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 SBClientAffineProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBClientAffineProperties_STATUS, SBClientAffineProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBClientAffineProperties_STATUS runs a test to see if a specific instance of SBClientAffineProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSBClientAffineProperties_STATUS(subject SBClientAffineProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBClientAffineProperties_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 SBClientAffineProperties_STATUS instances for property testing - lazily instantiated by +// SBClientAffineProperties_STATUSGenerator() +var sbClientAffineProperties_STATUSGenerator gopter.Gen + +// SBClientAffineProperties_STATUSGenerator returns a generator of SBClientAffineProperties_STATUS instances for property testing. +func SBClientAffineProperties_STATUSGenerator() gopter.Gen { + if sbClientAffineProperties_STATUSGenerator != nil { + return sbClientAffineProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS(generators) + sbClientAffineProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(SBClientAffineProperties_STATUS{}), generators) + + return sbClientAffineProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["IsDurable"] = gen.PtrOf(gen.Bool()) + gens["IsShared"] = gen.PtrOf(gen.Bool()) +} diff --git a/v2/api/servicebus/v1api20211101storage/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20211101storage/namespaces_topics_subscriptions_rule_types_gen.go new file mode 100644 index 00000000000..f0f3c235099 --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/namespaces_topics_subscriptions_rule_types_gen.go @@ -0,0 +1,285 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101storage + +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=servicebus.azure.com,resources=namespacestopicssubscriptionsrules,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=servicebus.azure.com,resources={namespacestopicssubscriptionsrules/status,namespacestopicssubscriptionsrules/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 v1api20211101.NamespacesTopicsSubscriptionsRule +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/Rules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName} +type NamespacesTopicsSubscriptionsRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Topics_Subscriptions_Rule_Spec `json:"spec,omitempty"` + Status Namespaces_Topics_Subscriptions_Rule_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesTopicsSubscriptionsRule{} + +// GetConditions returns the conditions of the resource +func (rule *NamespacesTopicsSubscriptionsRule) GetConditions() conditions.Conditions { + return rule.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (rule *NamespacesTopicsSubscriptionsRule) SetConditions(conditions conditions.Conditions) { + rule.Status.Conditions = conditions +} + +var _ genruntime.KubernetesResource = &NamespacesTopicsSubscriptionsRule{} + +// AzureName returns the Azure name of the resource +func (rule *NamespacesTopicsSubscriptionsRule) AzureName() string { + return rule.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01" +func (rule NamespacesTopicsSubscriptionsRule) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (rule *NamespacesTopicsSubscriptionsRule) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (rule *NamespacesTopicsSubscriptionsRule) GetSpec() genruntime.ConvertibleSpec { + return &rule.Spec +} + +// GetStatus returns the status of this resource +func (rule *NamespacesTopicsSubscriptionsRule) GetStatus() genruntime.ConvertibleStatus { + return &rule.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +func (rule *NamespacesTopicsSubscriptionsRule) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +} + +// NewEmptyStatus returns a new empty (blank) status +func (rule *NamespacesTopicsSubscriptionsRule) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Topics_Subscriptions_Rule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *NamespacesTopicsSubscriptionsRule) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: rule.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (rule *NamespacesTopicsSubscriptionsRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Topics_Subscriptions_Rule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Topics_Subscriptions_Rule_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 NamespacesTopicsSubscriptionsRule is the hub type for conversion +func (rule *NamespacesTopicsSubscriptionsRule) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (rule *NamespacesTopicsSubscriptionsRule) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: rule.Spec.OriginalVersion, + Kind: "NamespacesTopicsSubscriptionsRule", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20211101.NamespacesTopicsSubscriptionsRule +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/Rules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName} +type NamespacesTopicsSubscriptionsRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesTopicsSubscriptionsRule `json:"items"` +} + +// Storage version of v1api20211101.Namespaces_Topics_Subscriptions_Rule_Spec +type Namespaces_Topics_Subscriptions_Rule_Spec struct { + Action *Action `json:"action,omitempty"` + + // +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"` + CorrelationFilter *CorrelationFilter `json:"correlationFilter,omitempty"` + FilterType *string `json:"filterType,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 servicebus.azure.com/NamespacesTopicsSubscription resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"NamespacesTopicsSubscription"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SqlFilter *SqlFilter `json:"sqlFilter,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Topics_Subscriptions_Rule_Spec{} + +// ConvertSpecFrom populates our Namespaces_Topics_Subscriptions_Rule_Spec from the provided source +func (rule *Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec +func (rule *Namespaces_Topics_Subscriptions_Rule_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 v1api20211101.Namespaces_Topics_Subscriptions_Rule_STATUS +type Namespaces_Topics_Subscriptions_Rule_STATUS struct { + Action *Action_STATUS `json:"action,omitempty"` + Conditions []conditions.Condition `json:"conditions,omitempty"` + CorrelationFilter *CorrelationFilter_STATUS `json:"correlationFilter,omitempty"` + FilterType *string `json:"filterType,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SqlFilter *SqlFilter_STATUS `json:"sqlFilter,omitempty"` + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespaces_Topics_Subscriptions_Rule_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Topics_Subscriptions_Rule_STATUS from the provided source +func (rule *Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS +func (rule *Namespaces_Topics_Subscriptions_Rule_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 v1api20211101.Action +// Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter +// expression. +type Action struct { + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +// Storage version of v1api20211101.Action_STATUS +// Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter +// expression. +type Action_STATUS struct { + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +// Storage version of v1api20211101.CorrelationFilter +// Represents the correlation filter expression. +type CorrelationFilter struct { + ContentType *string `json:"contentType,omitempty"` + CorrelationId *string `json:"correlationId,omitempty"` + Label *string `json:"label,omitempty"` + MessageId *string `json:"messageId,omitempty"` + Properties map[string]string `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ReplyTo *string `json:"replyTo,omitempty"` + ReplyToSessionId *string `json:"replyToSessionId,omitempty"` + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + SessionId *string `json:"sessionId,omitempty"` + To *string `json:"to,omitempty"` +} + +// Storage version of v1api20211101.CorrelationFilter_STATUS +// Represents the correlation filter expression. +type CorrelationFilter_STATUS struct { + ContentType *string `json:"contentType,omitempty"` + CorrelationId *string `json:"correlationId,omitempty"` + Label *string `json:"label,omitempty"` + MessageId *string `json:"messageId,omitempty"` + Properties map[string]string `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ReplyTo *string `json:"replyTo,omitempty"` + ReplyToSessionId *string `json:"replyToSessionId,omitempty"` + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + SessionId *string `json:"sessionId,omitempty"` + To *string `json:"to,omitempty"` +} + +// Storage version of v1api20211101.SqlFilter +// Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. +type SqlFilter struct { + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +// Storage version of v1api20211101.SqlFilter_STATUS +// Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. +type SqlFilter_STATUS struct { + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +func init() { + SchemeBuilder.Register(&NamespacesTopicsSubscriptionsRule{}, &NamespacesTopicsSubscriptionsRuleList{}) +} diff --git a/v2/api/servicebus/v1api20211101storage/namespaces_topics_subscriptions_rule_types_gen_test.go b/v2/api/servicebus/v1api20211101storage/namespaces_topics_subscriptions_rule_types_gen_test.go new file mode 100644 index 00000000000..f9f14ab3b41 --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/namespaces_topics_subscriptions_rule_types_gen_test.go @@ -0,0 +1,628 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20211101storage + +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_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule, NamespacesTopicsSubscriptionsRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule runs a test to see if a specific instance of NamespacesTopicsSubscriptionsRule round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule(subject NamespacesTopicsSubscriptionsRule) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionsRule + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicsSubscriptionsRule instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionsRuleGenerator() +var namespacesTopicsSubscriptionsRuleGenerator gopter.Gen + +// NamespacesTopicsSubscriptionsRuleGenerator returns a generator of NamespacesTopicsSubscriptionsRule instances for property testing. +func NamespacesTopicsSubscriptionsRuleGenerator() gopter.Gen { + if namespacesTopicsSubscriptionsRuleGenerator != nil { + return namespacesTopicsSubscriptionsRuleGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule(generators) + namespacesTopicsSubscriptionsRuleGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule{}), generators) + + return namespacesTopicsSubscriptionsRuleGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Topics_Subscriptions_Rule_SpecGenerator() + gens["Status"] = Namespaces_Topics_Subscriptions_Rule_STATUSGenerator() +} + +func Test_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec, Namespaces_Topics_Subscriptions_Rule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec runs a test to see if a specific instance of Namespaces_Topics_Subscriptions_Rule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec(subject Namespaces_Topics_Subscriptions_Rule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscriptions_Rule_SpecGenerator() +var namespaces_Topics_Subscriptions_Rule_SpecGenerator gopter.Gen + +// Namespaces_Topics_Subscriptions_Rule_SpecGenerator returns a generator of Namespaces_Topics_Subscriptions_Rule_Spec instances for property testing. +// We first initialize namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_SpecGenerator() gopter.Gen { + if namespaces_Topics_Subscriptions_Rule_SpecGenerator != nil { + return namespaces_Topics_Subscriptions_Rule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(generators) + namespaces_Topics_Subscriptions_Rule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(generators) + namespaces_Topics_Subscriptions_Rule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_Spec{}), generators) + + return namespaces_Topics_Subscriptions_Rule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["FilterType"] = gen.PtrOf(gen.AlphaString()) + gens["OriginalVersion"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(ActionGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilterGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilterGenerator()) +} + +func Test_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS, Namespaces_Topics_Subscriptions_Rule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS runs a test to see if a specific instance of Namespaces_Topics_Subscriptions_Rule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS(subject Namespaces_Topics_Subscriptions_Rule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscriptions_Rule_STATUSGenerator() +var namespaces_Topics_Subscriptions_Rule_STATUSGenerator gopter.Gen + +// Namespaces_Topics_Subscriptions_Rule_STATUSGenerator returns a generator of Namespaces_Topics_Subscriptions_Rule_STATUS instances for property testing. +// We first initialize namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUSGenerator() gopter.Gen { + if namespaces_Topics_Subscriptions_Rule_STATUSGenerator != nil { + return namespaces_Topics_Subscriptions_Rule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(generators) + namespaces_Topics_Subscriptions_Rule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(generators) + namespaces_Topics_Subscriptions_Rule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_STATUS{}), generators) + + return namespaces_Topics_Subscriptions_Rule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(gens map[string]gopter.Gen) { + gens["FilterType"] = 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()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(Action_STATUSGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilter_STATUSGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilter_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_Action_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 Action via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAction, ActionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAction runs a test to see if a specific instance of Action round trips to JSON and back losslessly +func RunJSONSerializationTestForAction(subject Action) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Action + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Action instances for property testing - lazily instantiated by ActionGenerator() +var actionGenerator gopter.Gen + +// ActionGenerator returns a generator of Action instances for property testing. +func ActionGenerator() gopter.Gen { + if actionGenerator != nil { + return actionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAction(generators) + actionGenerator = gen.Struct(reflect.TypeOf(Action{}), generators) + + return actionGenerator +} + +// AddIndependentPropertyGeneratorsForAction is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAction(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Action_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 Action_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAction_STATUS, Action_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAction_STATUS runs a test to see if a specific instance of Action_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForAction_STATUS(subject Action_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Action_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 Action_STATUS instances for property testing - lazily instantiated by Action_STATUSGenerator() +var action_STATUSGenerator gopter.Gen + +// Action_STATUSGenerator returns a generator of Action_STATUS instances for property testing. +func Action_STATUSGenerator() gopter.Gen { + if action_STATUSGenerator != nil { + return action_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAction_STATUS(generators) + action_STATUSGenerator = gen.Struct(reflect.TypeOf(Action_STATUS{}), generators) + + return action_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForAction_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAction_STATUS(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CorrelationFilter_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 CorrelationFilter via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCorrelationFilter, CorrelationFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCorrelationFilter runs a test to see if a specific instance of CorrelationFilter round trips to JSON and back losslessly +func RunJSONSerializationTestForCorrelationFilter(subject CorrelationFilter) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CorrelationFilter + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of CorrelationFilter instances for property testing - lazily instantiated by CorrelationFilterGenerator() +var correlationFilterGenerator gopter.Gen + +// CorrelationFilterGenerator returns a generator of CorrelationFilter instances for property testing. +func CorrelationFilterGenerator() gopter.Gen { + if correlationFilterGenerator != nil { + return correlationFilterGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCorrelationFilter(generators) + correlationFilterGenerator = gen.Struct(reflect.TypeOf(CorrelationFilter{}), generators) + + return correlationFilterGenerator +} + +// AddIndependentPropertyGeneratorsForCorrelationFilter is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCorrelationFilter(gens map[string]gopter.Gen) { + gens["ContentType"] = gen.PtrOf(gen.AlphaString()) + gens["CorrelationId"] = gen.PtrOf(gen.AlphaString()) + gens["Label"] = gen.PtrOf(gen.AlphaString()) + gens["MessageId"] = gen.PtrOf(gen.AlphaString()) + gens["Properties"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ReplyTo"] = gen.PtrOf(gen.AlphaString()) + gens["ReplyToSessionId"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SessionId"] = gen.PtrOf(gen.AlphaString()) + gens["To"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CorrelationFilter_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 CorrelationFilter_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCorrelationFilter_STATUS, CorrelationFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCorrelationFilter_STATUS runs a test to see if a specific instance of CorrelationFilter_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCorrelationFilter_STATUS(subject CorrelationFilter_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CorrelationFilter_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 CorrelationFilter_STATUS instances for property testing - lazily instantiated by +// CorrelationFilter_STATUSGenerator() +var correlationFilter_STATUSGenerator gopter.Gen + +// CorrelationFilter_STATUSGenerator returns a generator of CorrelationFilter_STATUS instances for property testing. +func CorrelationFilter_STATUSGenerator() gopter.Gen { + if correlationFilter_STATUSGenerator != nil { + return correlationFilter_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS(generators) + correlationFilter_STATUSGenerator = gen.Struct(reflect.TypeOf(CorrelationFilter_STATUS{}), generators) + + return correlationFilter_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS(gens map[string]gopter.Gen) { + gens["ContentType"] = gen.PtrOf(gen.AlphaString()) + gens["CorrelationId"] = gen.PtrOf(gen.AlphaString()) + gens["Label"] = gen.PtrOf(gen.AlphaString()) + gens["MessageId"] = gen.PtrOf(gen.AlphaString()) + gens["Properties"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ReplyTo"] = gen.PtrOf(gen.AlphaString()) + gens["ReplyToSessionId"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SessionId"] = gen.PtrOf(gen.AlphaString()) + gens["To"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SqlFilter_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 SqlFilter via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSqlFilter, SqlFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSqlFilter runs a test to see if a specific instance of SqlFilter round trips to JSON and back losslessly +func RunJSONSerializationTestForSqlFilter(subject SqlFilter) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SqlFilter + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SqlFilter instances for property testing - lazily instantiated by SqlFilterGenerator() +var sqlFilterGenerator gopter.Gen + +// SqlFilterGenerator returns a generator of SqlFilter instances for property testing. +func SqlFilterGenerator() gopter.Gen { + if sqlFilterGenerator != nil { + return sqlFilterGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSqlFilter(generators) + sqlFilterGenerator = gen.Struct(reflect.TypeOf(SqlFilter{}), generators) + + return sqlFilterGenerator +} + +// AddIndependentPropertyGeneratorsForSqlFilter is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSqlFilter(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SqlFilter_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 SqlFilter_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSqlFilter_STATUS, SqlFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSqlFilter_STATUS runs a test to see if a specific instance of SqlFilter_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSqlFilter_STATUS(subject SqlFilter_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SqlFilter_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 SqlFilter_STATUS instances for property testing - lazily instantiated by SqlFilter_STATUSGenerator() +var sqlFilter_STATUSGenerator gopter.Gen + +// SqlFilter_STATUSGenerator returns a generator of SqlFilter_STATUS instances for property testing. +func SqlFilter_STATUSGenerator() gopter.Gen { + if sqlFilter_STATUSGenerator != nil { + return sqlFilter_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSqlFilter_STATUS(generators) + sqlFilter_STATUSGenerator = gen.Struct(reflect.TypeOf(SqlFilter_STATUS{}), generators) + + return sqlFilter_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSqlFilter_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSqlFilter_STATUS(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/servicebus/v1api20211101storage/structure.txt b/v2/api/servicebus/v1api20211101storage/structure.txt new file mode 100644 index 00000000000..34b10803b19 --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/structure.txt @@ -0,0 +1,398 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage +├── APIVersion: Enum (1 value) +│ └── "2021-11-01" +├── Namespace: Resource +│ ├── Owner: github.com/Azure/azure-service-operator/v2/api/resources/v1apiv20191001.ResourceGroup +│ ├── Spec: Object (13 properties) +│ │ ├── AlternateName: *string +│ │ ├── AzureName: string +│ │ ├── 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 +│ │ ├── Location: *string +│ │ ├── OperatorSpec: *Object (2 properties) +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ └── Secrets: *Object (6 properties) +│ │ │ ├── Endpoint: *genruntime.SecretDestination +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── Sku: *Object (4 properties) +│ │ │ ├── Capacity: *int +│ │ │ ├── Name: *string +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ └── Tier: *string +│ │ ├── Tags: map[string]string +│ │ └── ZoneRedundant: *bool +│ └── Status: Object (21 properties) +│ ├── AlternateName: *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 +│ ├── Location: *string +│ ├── MetricId: *string +│ ├── Name: *string +│ ├── PrivateEndpointConnections: Object (2 properties)[] +│ │ ├── Id: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── ProvisioningState: *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: github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101.Namespace +│ ├── Spec: Object (6 properties) +│ │ ├── AzureName: Validated (2 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ └── Rule 1: MinLength: 1 +│ │ ├── 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 +├── NamespacesQueue: Resource +│ ├── Owner: github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101.Namespace +│ ├── Spec: Object (19 properties) +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── AzureName: Validated (1 rule) +│ │ │ └── Rule 0: MinLength: 1 +│ │ ├── DeadLetteringOnMessageExpiration: *bool +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── EnableExpress: *bool +│ │ ├── EnablePartitioning: *bool +│ │ ├── ForwardDeadLetteredMessagesTo: *string +│ │ ├── ForwardTo: *string +│ │ ├── LockDuration: *string +│ │ ├── MaxDeliveryCount: *int +│ │ ├── MaxMessageSizeInKilobytes: *int +│ │ ├── MaxSizeInMegabytes: *int +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── RequiresDuplicateDetection: *bool +│ │ └── RequiresSession: *bool +│ └── Status: Object (29 properties) +│ ├── AccessedAt: *string +│ ├── AutoDeleteOnIdle: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CountDetails: *Object (6 properties) +│ │ ├── ActiveMessageCount: *int +│ │ ├── DeadLetterMessageCount: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── ScheduledMessageCount: *int +│ │ ├── TransferDeadLetterMessageCount: *int +│ │ └── TransferMessageCount: *int +│ ├── CreatedAt: *string +│ ├── DeadLetteringOnMessageExpiration: *bool +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── EnableExpress: *bool +│ ├── EnablePartitioning: *bool +│ ├── ForwardDeadLetteredMessagesTo: *string +│ ├── ForwardTo: *string +│ ├── Id: *string +│ ├── Location: *string +│ ├── LockDuration: *string +│ ├── MaxDeliveryCount: *int +│ ├── MaxMessageSizeInKilobytes: *int +│ ├── MaxSizeInMegabytes: *int +│ ├── MessageCount: *int +│ ├── Name: *string +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── RequiresDuplicateDetection: *bool +│ ├── RequiresSession: *bool +│ ├── SizeInBytes: *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 +├── NamespacesTopic: Resource +│ ├── Owner: github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101.Namespace +│ ├── Spec: Object (14 properties) +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── AzureName: Validated (1 rule) +│ │ │ └── Rule 0: MinLength: 1 +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── EnableExpress: *bool +│ │ ├── EnablePartitioning: *bool +│ │ ├── MaxMessageSizeInKilobytes: *int +│ │ ├── MaxSizeInMegabytes: *int +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── RequiresDuplicateDetection: *bool +│ │ └── SupportOrdering: *bool +│ └── Status: Object (24 properties) +│ ├── AccessedAt: *string +│ ├── AutoDeleteOnIdle: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CountDetails: *Object (6 properties) +│ │ ├── ActiveMessageCount: *int +│ │ ├── DeadLetterMessageCount: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── ScheduledMessageCount: *int +│ │ ├── TransferDeadLetterMessageCount: *int +│ │ └── TransferMessageCount: *int +│ ├── CreatedAt: *string +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── EnableExpress: *bool +│ ├── EnablePartitioning: *bool +│ ├── Id: *string +│ ├── Location: *string +│ ├── MaxMessageSizeInKilobytes: *int +│ ├── MaxSizeInMegabytes: *int +│ ├── Name: *string +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── RequiresDuplicateDetection: *bool +│ ├── SizeInBytes: *int +│ ├── Status: *string +│ ├── SubscriptionCount: *int +│ ├── SupportOrdering: *bool +│ ├── SystemData: *Object (7 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *string +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ ├── LastModifiedByType: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── Type: *string +│ └── UpdatedAt: *string +├── NamespacesTopicsSubscription: Resource +│ ├── Owner: github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101.NamespacesTopic +│ ├── Spec: Object (17 properties) +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── AzureName: Validated (2 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ └── Rule 1: MinLength: 1 +│ │ ├── ClientAffineProperties: *Object (4 properties) +│ │ │ ├── ClientId: *string +│ │ │ ├── IsDurable: *bool +│ │ │ ├── IsShared: *bool +│ │ │ └── PropertyBag: genruntime.PropertyBag +│ │ ├── DeadLetteringOnFilterEvaluationExceptions: *bool +│ │ ├── DeadLetteringOnMessageExpiration: *bool +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── ForwardDeadLetteredMessagesTo: *string +│ │ ├── ForwardTo: *string +│ │ ├── IsClientAffine: *bool +│ │ ├── LockDuration: *string +│ │ ├── MaxDeliveryCount: *int +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── RequiresSession: *bool +│ └── Status: Object (26 properties) +│ ├── AccessedAt: *string +│ ├── AutoDeleteOnIdle: *string +│ ├── ClientAffineProperties: *Object (4 properties) +│ │ ├── ClientId: *string +│ │ ├── IsDurable: *bool +│ │ ├── IsShared: *bool +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── Conditions: conditions.Condition[] +│ ├── CountDetails: *Object (6 properties) +│ │ ├── ActiveMessageCount: *int +│ │ ├── DeadLetterMessageCount: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── ScheduledMessageCount: *int +│ │ ├── TransferDeadLetterMessageCount: *int +│ │ └── TransferMessageCount: *int +│ ├── CreatedAt: *string +│ ├── DeadLetteringOnFilterEvaluationExceptions: *bool +│ ├── DeadLetteringOnMessageExpiration: *bool +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── ForwardDeadLetteredMessagesTo: *string +│ ├── ForwardTo: *string +│ ├── Id: *string +│ ├── IsClientAffine: *bool +│ ├── Location: *string +│ ├── LockDuration: *string +│ ├── MaxDeliveryCount: *int +│ ├── MessageCount: *int +│ ├── Name: *string +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── RequiresSession: *bool +│ ├── 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 +└── NamespacesTopicsSubscriptionsRule: Resource + ├── Owner: github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101.NamespacesTopicsSubscription + ├── Spec: Object (8 properties) + │ ├── Action: *Object (4 properties) + │ │ ├── CompatibilityLevel: *int + │ │ ├── PropertyBag: genruntime.PropertyBag + │ │ ├── RequiresPreprocessing: *bool + │ │ └── SqlExpression: *string + │ ├── AzureName: Validated (2 rules) + │ │ ├── Rule 0: MaxLength: 50 + │ │ └── Rule 1: MinLength: 1 + │ ├── CorrelationFilter: *Object (11 properties) + │ │ ├── ContentType: *string + │ │ ├── CorrelationId: *string + │ │ ├── Label: *string + │ │ ├── MessageId: *string + │ │ ├── Properties: map[string]string + │ │ ├── PropertyBag: genruntime.PropertyBag + │ │ ├── ReplyTo: *string + │ │ ├── ReplyToSessionId: *string + │ │ ├── RequiresPreprocessing: *bool + │ │ ├── SessionId: *string + │ │ └── To: *string + │ ├── FilterType: *string + │ ├── OriginalVersion: string + │ ├── Owner: *genruntime.KnownResourceReference + │ ├── PropertyBag: genruntime.PropertyBag + │ └── SqlFilter: *Object (4 properties) + │ ├── CompatibilityLevel: *int + │ ├── PropertyBag: genruntime.PropertyBag + │ ├── RequiresPreprocessing: *bool + │ └── SqlExpression: *string + └── Status: Object (11 properties) + ├── Action: *Object (4 properties) + │ ├── CompatibilityLevel: *int + │ ├── PropertyBag: genruntime.PropertyBag + │ ├── RequiresPreprocessing: *bool + │ └── SqlExpression: *string + ├── Conditions: conditions.Condition[] + ├── CorrelationFilter: *Object (11 properties) + │ ├── ContentType: *string + │ ├── CorrelationId: *string + │ ├── Label: *string + │ ├── MessageId: *string + │ ├── Properties: map[string]string + │ ├── PropertyBag: genruntime.PropertyBag + │ ├── ReplyTo: *string + │ ├── ReplyToSessionId: *string + │ ├── RequiresPreprocessing: *bool + │ ├── SessionId: *string + │ └── To: *string + ├── FilterType: *string + ├── Id: *string + ├── Location: *string + ├── Name: *string + ├── PropertyBag: genruntime.PropertyBag + ├── SqlFilter: *Object (4 properties) + │ ├── CompatibilityLevel: *int + │ ├── PropertyBag: genruntime.PropertyBag + │ ├── RequiresPreprocessing: *bool + │ └── SqlExpression: *string + ├── SystemData: *Object (7 properties) + │ ├── CreatedAt: *string + │ ├── CreatedBy: *string + │ ├── CreatedByType: *string + │ ├── LastModifiedAt: *string + │ ├── LastModifiedBy: *string + │ ├── LastModifiedByType: *string + │ └── PropertyBag: genruntime.PropertyBag + └── Type: *string diff --git a/v2/api/servicebus/v1api20211101storage/zz_generated.deepcopy.go b/v2/api/servicebus/v1api20211101storage/zz_generated.deepcopy.go new file mode 100644 index 00000000000..aed0a593a13 --- /dev/null +++ b/v2/api/servicebus/v1api20211101storage/zz_generated.deepcopy.go @@ -0,0 +1,2574 @@ +//go:build !ignore_autogenerated + +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1api20211101storage + +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 *Action) DeepCopyInto(out *Action) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *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.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action. +func (in *Action) DeepCopy() *Action { + if in == nil { + return nil + } + out := new(Action) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Action_STATUS) DeepCopyInto(out *Action_STATUS) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *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.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action_STATUS. +func (in *Action_STATUS) DeepCopy() *Action_STATUS { + if in == nil { + return nil + } + out := new(Action_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 *CorrelationFilter) DeepCopyInto(out *CorrelationFilter) { + *out = *in + if in.ContentType != nil { + in, out := &in.ContentType, &out.ContentType + *out = new(string) + **out = **in + } + if in.CorrelationId != nil { + in, out := &in.CorrelationId, &out.CorrelationId + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MessageId != nil { + in, out := &in.MessageId, &out.MessageId + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ReplyTo != nil { + in, out := &in.ReplyTo, &out.ReplyTo + *out = new(string) + **out = **in + } + if in.ReplyToSessionId != nil { + in, out := &in.ReplyToSessionId, &out.ReplyToSessionId + *out = new(string) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SessionId != nil { + in, out := &in.SessionId, &out.SessionId + *out = new(string) + **out = **in + } + if in.To != nil { + in, out := &in.To, &out.To + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelationFilter. +func (in *CorrelationFilter) DeepCopy() *CorrelationFilter { + if in == nil { + return nil + } + out := new(CorrelationFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CorrelationFilter_STATUS) DeepCopyInto(out *CorrelationFilter_STATUS) { + *out = *in + if in.ContentType != nil { + in, out := &in.ContentType, &out.ContentType + *out = new(string) + **out = **in + } + if in.CorrelationId != nil { + in, out := &in.CorrelationId, &out.CorrelationId + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MessageId != nil { + in, out := &in.MessageId, &out.MessageId + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ReplyTo != nil { + in, out := &in.ReplyTo, &out.ReplyTo + *out = new(string) + **out = **in + } + if in.ReplyToSessionId != nil { + in, out := &in.ReplyToSessionId, &out.ReplyToSessionId + *out = new(string) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SessionId != nil { + in, out := &in.SessionId, &out.SessionId + *out = new(string) + **out = **in + } + if in.To != nil { + in, out := &in.To, &out.To + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelationFilter_STATUS. +func (in *CorrelationFilter_STATUS) DeepCopy() *CorrelationFilter_STATUS { + if in == nil { + return nil + } + out := new(CorrelationFilter_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 *MessageCountDetails_STATUS) DeepCopyInto(out *MessageCountDetails_STATUS) { + *out = *in + if in.ActiveMessageCount != nil { + in, out := &in.ActiveMessageCount, &out.ActiveMessageCount + *out = new(int) + **out = **in + } + if in.DeadLetterMessageCount != nil { + in, out := &in.DeadLetterMessageCount, &out.DeadLetterMessageCount + *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.ScheduledMessageCount != nil { + in, out := &in.ScheduledMessageCount, &out.ScheduledMessageCount + *out = new(int) + **out = **in + } + if in.TransferDeadLetterMessageCount != nil { + in, out := &in.TransferDeadLetterMessageCount, &out.TransferDeadLetterMessageCount + *out = new(int) + **out = **in + } + if in.TransferMessageCount != nil { + in, out := &in.TransferMessageCount, &out.TransferMessageCount + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageCountDetails_STATUS. +func (in *MessageCountDetails_STATUS) DeepCopy() *MessageCountDetails_STATUS { + if in == nil { + return nil + } + out := new(MessageCountDetails_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.Endpoint != nil { + in, out := &in.Endpoint, &out.Endpoint + *out = new(genruntime.SecretDestination) + **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.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.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MetricId != nil { + in, out := &in.MetricId, &out.MetricId + *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.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(SBSku_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.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.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(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.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(SBSku) + (*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 *NamespacesQueue) DeepCopyInto(out *NamespacesQueue) { + *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 NamespacesQueue. +func (in *NamespacesQueue) DeepCopy() *NamespacesQueue { + if in == nil { + return nil + } + out := new(NamespacesQueue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesQueue) 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 *NamespacesQueueList) DeepCopyInto(out *NamespacesQueueList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesQueue, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesQueueList. +func (in *NamespacesQueueList) DeepCopy() *NamespacesQueueList { + if in == nil { + return nil + } + out := new(NamespacesQueueList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesQueueList) 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 *NamespacesTopic) DeepCopyInto(out *NamespacesTopic) { + *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 NamespacesTopic. +func (in *NamespacesTopic) DeepCopy() *NamespacesTopic { + if in == nil { + return nil + } + out := new(NamespacesTopic) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopic) 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 *NamespacesTopicList) DeepCopyInto(out *NamespacesTopicList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesTopic, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicList. +func (in *NamespacesTopicList) DeepCopy() *NamespacesTopicList { + if in == nil { + return nil + } + out := new(NamespacesTopicList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicList) 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 *NamespacesTopicsSubscription) DeepCopyInto(out *NamespacesTopicsSubscription) { + *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 NamespacesTopicsSubscription. +func (in *NamespacesTopicsSubscription) DeepCopy() *NamespacesTopicsSubscription { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscription) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscription) 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 *NamespacesTopicsSubscriptionList) DeepCopyInto(out *NamespacesTopicsSubscriptionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesTopicsSubscription, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicsSubscriptionList. +func (in *NamespacesTopicsSubscriptionList) DeepCopy() *NamespacesTopicsSubscriptionList { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscriptionList) 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 *NamespacesTopicsSubscriptionsRule) DeepCopyInto(out *NamespacesTopicsSubscriptionsRule) { + *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 NamespacesTopicsSubscriptionsRule. +func (in *NamespacesTopicsSubscriptionsRule) DeepCopy() *NamespacesTopicsSubscriptionsRule { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscriptionsRule) 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 *NamespacesTopicsSubscriptionsRuleList) DeepCopyInto(out *NamespacesTopicsSubscriptionsRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesTopicsSubscriptionsRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicsSubscriptionsRuleList. +func (in *NamespacesTopicsSubscriptionsRuleList) DeepCopy() *NamespacesTopicsSubscriptionsRuleList { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscriptionsRuleList) 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_Queue_STATUS) DeepCopyInto(out *Namespaces_Queue_STATUS) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *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.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *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.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.MessageCount != nil { + in, out := &in.MessageCount, &out.MessageCount + *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.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } + if in.SizeInBytes != nil { + in, out := &in.SizeInBytes, &out.SizeInBytes + *out = new(int) + **out = **in + } + 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_Queue_STATUS. +func (in *Namespaces_Queue_STATUS) DeepCopy() *Namespaces_Queue_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Queue_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_Queue_Spec) DeepCopyInto(out *Namespaces_Queue_Spec) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **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.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Queue_Spec. +func (in *Namespaces_Queue_Spec) DeepCopy() *Namespaces_Queue_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Queue_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_Topic_STATUS) DeepCopyInto(out *Namespaces_Topic_STATUS) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *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.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **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.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *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.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.SizeInBytes != nil { + in, out := &in.SizeInBytes, &out.SizeInBytes + *out = new(int) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.SubscriptionCount != nil { + in, out := &in.SubscriptionCount, &out.SubscriptionCount + *out = new(int) + **out = **in + } + if in.SupportOrdering != nil { + in, out := &in.SupportOrdering, &out.SupportOrdering + *out = new(bool) + **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_Topic_STATUS. +func (in *Namespaces_Topic_STATUS) DeepCopy() *Namespaces_Topic_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Topic_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_Topic_Spec) DeepCopyInto(out *Namespaces_Topic_Spec) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **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.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.SupportOrdering != nil { + in, out := &in.SupportOrdering, &out.SupportOrdering + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topic_Spec. +func (in *Namespaces_Topic_Spec) DeepCopy() *Namespaces_Topic_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Topic_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_Topics_Subscription_STATUS) DeepCopyInto(out *Namespaces_Topics_Subscription_STATUS) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.ClientAffineProperties != nil { + in, out := &in.ClientAffineProperties, &out.ClientAffineProperties + *out = new(SBClientAffineProperties_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.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DeadLetteringOnFilterEvaluationExceptions != nil { + in, out := &in.DeadLetteringOnFilterEvaluationExceptions, &out.DeadLetteringOnFilterEvaluationExceptions + *out = new(bool) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + if in.IsClientAffine != nil { + in, out := &in.IsClientAffine, &out.IsClientAffine + *out = new(bool) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MessageCount != nil { + in, out := &in.MessageCount, &out.MessageCount + *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.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } + 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_Topics_Subscription_STATUS. +func (in *Namespaces_Topics_Subscription_STATUS) DeepCopy() *Namespaces_Topics_Subscription_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscription_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_Topics_Subscription_Spec) DeepCopyInto(out *Namespaces_Topics_Subscription_Spec) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.ClientAffineProperties != nil { + in, out := &in.ClientAffineProperties, &out.ClientAffineProperties + *out = new(SBClientAffineProperties) + (*in).DeepCopyInto(*out) + } + if in.DeadLetteringOnFilterEvaluationExceptions != nil { + in, out := &in.DeadLetteringOnFilterEvaluationExceptions, &out.DeadLetteringOnFilterEvaluationExceptions + *out = new(bool) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.IsClientAffine != nil { + in, out := &in.IsClientAffine, &out.IsClientAffine + *out = new(bool) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **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.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topics_Subscription_Spec. +func (in *Namespaces_Topics_Subscription_Spec) DeepCopy() *Namespaces_Topics_Subscription_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscription_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_Topics_Subscriptions_Rule_STATUS) DeepCopyInto(out *Namespaces_Topics_Subscriptions_Rule_STATUS) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(Action_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.CorrelationFilter != nil { + in, out := &in.CorrelationFilter, &out.CorrelationFilter + *out = new(CorrelationFilter_STATUS) + (*in).DeepCopyInto(*out) + } + if in.FilterType != nil { + in, out := &in.FilterType, &out.FilterType + *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.SqlFilter != nil { + in, out := &in.SqlFilter, &out.SqlFilter + *out = new(SqlFilter_STATUS) + (*in).DeepCopyInto(*out) + } + 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_Topics_Subscriptions_Rule_STATUS. +func (in *Namespaces_Topics_Subscriptions_Rule_STATUS) DeepCopy() *Namespaces_Topics_Subscriptions_Rule_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec) DeepCopyInto(out *Namespaces_Topics_Subscriptions_Rule_Spec) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(Action) + (*in).DeepCopyInto(*out) + } + if in.CorrelationFilter != nil { + in, out := &in.CorrelationFilter, &out.CorrelationFilter + *out = new(CorrelationFilter) + (*in).DeepCopyInto(*out) + } + if in.FilterType != nil { + in, out := &in.FilterType, &out.FilterType + *out = new(string) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SqlFilter != nil { + in, out := &in.SqlFilter, &out.SqlFilter + *out = new(SqlFilter) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topics_Subscriptions_Rule_Spec. +func (in *Namespaces_Topics_Subscriptions_Rule_Spec) DeepCopy() *Namespaces_Topics_Subscriptions_Rule_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscriptions_Rule_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 *SBClientAffineProperties) DeepCopyInto(out *SBClientAffineProperties) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.IsDurable != nil { + in, out := &in.IsDurable, &out.IsDurable + *out = new(bool) + **out = **in + } + if in.IsShared != nil { + in, out := &in.IsShared, &out.IsShared + *out = new(bool) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBClientAffineProperties. +func (in *SBClientAffineProperties) DeepCopy() *SBClientAffineProperties { + if in == nil { + return nil + } + out := new(SBClientAffineProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SBClientAffineProperties_STATUS) DeepCopyInto(out *SBClientAffineProperties_STATUS) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.IsDurable != nil { + in, out := &in.IsDurable, &out.IsDurable + *out = new(bool) + **out = **in + } + if in.IsShared != nil { + in, out := &in.IsShared, &out.IsShared + *out = new(bool) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBClientAffineProperties_STATUS. +func (in *SBClientAffineProperties_STATUS) DeepCopy() *SBClientAffineProperties_STATUS { + if in == nil { + return nil + } + out := new(SBClientAffineProperties_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 *SBSku) DeepCopyInto(out *SBSku) { + *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 SBSku. +func (in *SBSku) DeepCopy() *SBSku { + if in == nil { + return nil + } + out := new(SBSku) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SBSku_STATUS) DeepCopyInto(out *SBSku_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 SBSku_STATUS. +func (in *SBSku_STATUS) DeepCopy() *SBSku_STATUS { + if in == nil { + return nil + } + out := new(SBSku_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 *SqlFilter) DeepCopyInto(out *SqlFilter) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *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.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SqlFilter. +func (in *SqlFilter) DeepCopy() *SqlFilter { + if in == nil { + return nil + } + out := new(SqlFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SqlFilter_STATUS) DeepCopyInto(out *SqlFilter_STATUS) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *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.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SqlFilter_STATUS. +func (in *SqlFilter_STATUS) DeepCopy() *SqlFilter_STATUS { + if in == nil { + return nil + } + out := new(SqlFilter_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/servicebus/v1api20221001preview/doc.go b/v2/api/servicebus/v1api20221001preview/doc.go new file mode 100644 index 00000000000..be3c2b929b8 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/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 v1api20221001preview contains API Schema definitions for the servicebus v1api20221001preview API group +// +groupName=servicebus.azure.com +package v1api20221001preview diff --git a/v2/api/servicebus/v1api20221001preview/groupversion_info_gen.go b/v2/api/servicebus/v1api20221001preview/groupversion_info_gen.go new file mode 100644 index 00000000000..93efeacebc5 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/groupversion_info_gen.go @@ -0,0 +1,31 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package v1api20221001preview contains API Schema definitions for the servicebus v1api20221001preview API group +// +kubebuilder:object:generate=true +// All object properties are optional by default, this will be overridden when needed: +// +kubebuilder:validation:Optional +// +groupName=servicebus.azure.com +package v1api20221001preview + +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: "servicebus.azure.com", Version: "v1api20221001preview"} + + // 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/servicebus/v1api20221001preview/namespace_spec_arm_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespace_spec_arm_types_gen.go new file mode 100644 index 00000000000..fd1fc3c3634 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespace_spec_arm_types_gen.go @@ -0,0 +1,150 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +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: The Geo-location where the resource lives + Location *string `json:"location,omitempty"` + Name string `json:"name,omitempty"` + + // Properties: Properties of the namespace. + Properties *SBNamespaceProperties_ARM `json:"properties,omitempty"` + + // Sku: Properties of SKU + Sku *SBSku_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 "2022-10-01-preview" +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.ServiceBus/namespaces" +func (namespace *Namespace_Spec_ARM) GetType() string { + return "Microsoft.ServiceBus/namespaces" +} + +// Properties to configure User Assigned Identities 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"` +} + +// Properties of the namespace. +type SBNamespaceProperties_ARM struct { + // AlternateName: Alternate name for namespace + AlternateName *string `json:"alternateName,omitempty"` + + // DisableLocalAuth: This property disables SAS authentication for the Service Bus namespace. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Encryption: Properties of BYOK Encryption description + Encryption *Encryption_ARM `json:"encryption,omitempty"` + + // MinimumTlsVersion: The minimum TLS version for the cluster to support, e.g. '1.2' + MinimumTlsVersion *SBNamespaceProperties_MinimumTlsVersion `json:"minimumTlsVersion,omitempty"` + + // PremiumMessagingPartitions: The number of partitions of a Service Bus namespace. This property is only applicable to + // Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4 + PremiumMessagingPartitions *int `json:"premiumMessagingPartitions,omitempty"` + + // PublicNetworkAccess: This determines if traffic is allowed over public network. By default it is enabled. + PublicNetworkAccess *SBNamespaceProperties_PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + + // ZoneRedundant: Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// SKU of the namespace. +type SBSku_ARM struct { + // Capacity: Messaging units for your service bus premium namespace. Valid capacities are {1, 2, 4, 8, 16} multiples of + // your properties.premiumMessagingPartitions setting. For example, If properties.premiumMessagingPartitions is 1 then + // possible capacity values are 1, 2, 4, 8, and 16. If properties.premiumMessagingPartitions is 4 then possible capacity + // values are 4, 8, 16, 32 and 64 + Capacity *int `json:"capacity,omitempty"` + + // Name: Name of this SKU. + Name *SBSku_Name `json:"name,omitempty"` + + // Tier: The billing tier of this particular SKU. + Tier *SBSku_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 SBSku_Name string + +const ( + SBSku_Name_Basic = SBSku_Name("Basic") + SBSku_Name_Premium = SBSku_Name("Premium") + SBSku_Name_Standard = SBSku_Name("Standard") +) + +// +kubebuilder:validation:Enum={"Basic","Premium","Standard"} +type SBSku_Tier string + +const ( + SBSku_Tier_Basic = SBSku_Tier("Basic") + SBSku_Tier_Premium = SBSku_Tier("Premium") + SBSku_Tier_Standard = SBSku_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: Version of KeyVault + KeyVersion *string `json:"keyVersion,omitempty"` +} + +type UserAssignedIdentityProperties_ARM struct { + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} diff --git a/v2/api/servicebus/v1api20221001preview/namespace_spec_arm_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespace_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..e4ea4621237 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespace_spec_arm_types_gen_test.go @@ -0,0 +1,584 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +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(SBNamespaceProperties_ARMGenerator()) + gens["Sku"] = gen.PtrOf(SBSku_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_SBNamespaceProperties_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 SBNamespaceProperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBNamespaceProperties_ARM, SBNamespaceProperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBNamespaceProperties_ARM runs a test to see if a specific instance of SBNamespaceProperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBNamespaceProperties_ARM(subject SBNamespaceProperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBNamespaceProperties_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 SBNamespaceProperties_ARM instances for property testing - lazily instantiated by +// SBNamespaceProperties_ARMGenerator() +var sbNamespaceProperties_ARMGenerator gopter.Gen + +// SBNamespaceProperties_ARMGenerator returns a generator of SBNamespaceProperties_ARM instances for property testing. +// We first initialize sbNamespaceProperties_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 SBNamespaceProperties_ARMGenerator() gopter.Gen { + if sbNamespaceProperties_ARMGenerator != nil { + return sbNamespaceProperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBNamespaceProperties_ARM(generators) + sbNamespaceProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBNamespaceProperties_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBNamespaceProperties_ARM(generators) + AddRelatedPropertyGeneratorsForSBNamespaceProperties_ARM(generators) + sbNamespaceProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBNamespaceProperties_ARM{}), generators) + + return sbNamespaceProperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBNamespaceProperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBNamespaceProperties_ARM(gens map[string]gopter.Gen) { + gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["MinimumTlsVersion"] = gen.PtrOf(gen.OneConstOf(SBNamespaceProperties_MinimumTlsVersion_10, SBNamespaceProperties_MinimumTlsVersion_11, SBNamespaceProperties_MinimumTlsVersion_12)) + gens["PremiumMessagingPartitions"] = gen.PtrOf(gen.Int()) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(SBNamespaceProperties_PublicNetworkAccess_Disabled, SBNamespaceProperties_PublicNetworkAccess_Enabled, SBNamespaceProperties_PublicNetworkAccess_SecuredByPerimeter)) + gens["ZoneRedundant"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForSBNamespaceProperties_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBNamespaceProperties_ARM(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(Encryption_ARMGenerator()) +} + +func Test_SBSku_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 SBSku_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSku_ARM, SBSku_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSku_ARM runs a test to see if a specific instance of SBSku_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSku_ARM(subject SBSku_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSku_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 SBSku_ARM instances for property testing - lazily instantiated by SBSku_ARMGenerator() +var sbSku_ARMGenerator gopter.Gen + +// SBSku_ARMGenerator returns a generator of SBSku_ARM instances for property testing. +func SBSku_ARMGenerator() gopter.Gen { + if sbSku_ARMGenerator != nil { + return sbSku_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSku_ARM(generators) + sbSku_ARMGenerator = gen.Struct(reflect.TypeOf(SBSku_ARM{}), generators) + + return sbSku_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBSku_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSku_ARM(gens map[string]gopter.Gen) { + gens["Capacity"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf(SBSku_Name_Basic, SBSku_Name_Premium, SBSku_Name_Standard)) + gens["Tier"] = gen.PtrOf(gen.OneConstOf(SBSku_Tier_Basic, SBSku_Tier_Premium, SBSku_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/servicebus/v1api20221001preview/namespace_status_arm_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespace_status_arm_types_gen.go new file mode 100644 index 00000000000..9ea70821a2e --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespace_status_arm_types_gen.go @@ -0,0 +1,220 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +type Namespace_STATUS_ARM struct { + // Id: Resource Id + Id *string `json:"id,omitempty"` + + // Identity: Properties of BYOK Identity description + Identity *Identity_STATUS_ARM `json:"identity,omitempty"` + + // Location: The Geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Name: Resource name + Name *string `json:"name,omitempty"` + + // Properties: Properties of the namespace. + Properties *SBNamespaceProperties_STATUS_ARM `json:"properties,omitempty"` + + // Sku: Properties of SKU + Sku *SBSku_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: Resource type + Type *string `json:"type,omitempty"` +} + +// Properties to configure User Assigned Identities 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"` +} + +// Properties of the namespace. +type SBNamespaceProperties_STATUS_ARM struct { + // AlternateName: Alternate name for namespace + AlternateName *string `json:"alternateName,omitempty"` + + // CreatedAt: The time the namespace was created + CreatedAt *string `json:"createdAt,omitempty"` + + // DisableLocalAuth: This property disables SAS authentication for the Service Bus namespace. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Encryption: Properties of BYOK Encryption description + Encryption *Encryption_STATUS_ARM `json:"encryption,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 *SBNamespaceProperties_MinimumTlsVersion_STATUS `json:"minimumTlsVersion,omitempty"` + + // PremiumMessagingPartitions: The number of partitions of a Service Bus namespace. This property is only applicable to + // Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4 + PremiumMessagingPartitions *int `json:"premiumMessagingPartitions,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 *SBNamespaceProperties_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 Premium Service Bus Namespace in regions supported availability zones. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// SKU of the namespace. +type SBSku_STATUS_ARM struct { + // Capacity: Messaging units for your service bus premium namespace. Valid capacities are {1, 2, 4, 8, 16} multiples of + // your properties.premiumMessagingPartitions setting. For example, If properties.premiumMessagingPartitions is 1 then + // possible capacity values are 1, 2, 4, 8, and 16. If properties.premiumMessagingPartitions is 4 then possible capacity + // values are 4, 8, 16, 32 and 64 + Capacity *int `json:"capacity,omitempty"` + + // Name: Name of this SKU. + Name *SBSku_Name_STATUS `json:"name,omitempty"` + + // Tier: The billing tier of this particular SKU. + Tier *SBSku_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 SBSku_Name_STATUS string + +const ( + SBSku_Name_STATUS_Basic = SBSku_Name_STATUS("Basic") + SBSku_Name_STATUS_Premium = SBSku_Name_STATUS("Premium") + SBSku_Name_STATUS_Standard = SBSku_Name_STATUS("Standard") +) + +type SBSku_Tier_STATUS string + +const ( + SBSku_Tier_STATUS_Basic = SBSku_Tier_STATUS("Basic") + SBSku_Tier_STATUS_Premium = SBSku_Tier_STATUS("Premium") + SBSku_Tier_STATUS_Standard = SBSku_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: Version of KeyVault + 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/servicebus/v1api20221001preview/namespace_status_arm_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespace_status_arm_types_gen_test.go new file mode 100644 index 00000000000..de1d91df027 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespace_status_arm_types_gen_test.go @@ -0,0 +1,741 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +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(SBNamespaceProperties_STATUS_ARMGenerator()) + gens["Sku"] = gen.PtrOf(SBSku_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_SBNamespaceProperties_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 SBNamespaceProperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBNamespaceProperties_STATUS_ARM, SBNamespaceProperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBNamespaceProperties_STATUS_ARM runs a test to see if a specific instance of SBNamespaceProperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBNamespaceProperties_STATUS_ARM(subject SBNamespaceProperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBNamespaceProperties_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 SBNamespaceProperties_STATUS_ARM instances for property testing - lazily instantiated by +// SBNamespaceProperties_STATUS_ARMGenerator() +var sbNamespaceProperties_STATUS_ARMGenerator gopter.Gen + +// SBNamespaceProperties_STATUS_ARMGenerator returns a generator of SBNamespaceProperties_STATUS_ARM instances for property testing. +// We first initialize sbNamespaceProperties_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 SBNamespaceProperties_STATUS_ARMGenerator() gopter.Gen { + if sbNamespaceProperties_STATUS_ARMGenerator != nil { + return sbNamespaceProperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM(generators) + sbNamespaceProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBNamespaceProperties_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM(generators) + sbNamespaceProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBNamespaceProperties_STATUS_ARM{}), generators) + + return sbNamespaceProperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["AlternateName"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["MetricId"] = gen.PtrOf(gen.AlphaString()) + gens["MinimumTlsVersion"] = gen.PtrOf(gen.OneConstOf(SBNamespaceProperties_MinimumTlsVersion_STATUS_10, SBNamespaceProperties_MinimumTlsVersion_STATUS_11, SBNamespaceProperties_MinimumTlsVersion_STATUS_12)) + gens["PremiumMessagingPartitions"] = gen.PtrOf(gen.Int()) + gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString()) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(SBNamespaceProperties_PublicNetworkAccess_STATUS_Disabled, SBNamespaceProperties_PublicNetworkAccess_STATUS_Enabled, SBNamespaceProperties_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()) +} + +// AddRelatedPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBNamespaceProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(Encryption_STATUS_ARMGenerator()) + gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnection_STATUS_ARMGenerator()) +} + +func Test_SBSku_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 SBSku_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSku_STATUS_ARM, SBSku_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSku_STATUS_ARM runs a test to see if a specific instance of SBSku_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSku_STATUS_ARM(subject SBSku_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSku_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 SBSku_STATUS_ARM instances for property testing - lazily instantiated by SBSku_STATUS_ARMGenerator() +var sbSku_STATUS_ARMGenerator gopter.Gen + +// SBSku_STATUS_ARMGenerator returns a generator of SBSku_STATUS_ARM instances for property testing. +func SBSku_STATUS_ARMGenerator() gopter.Gen { + if sbSku_STATUS_ARMGenerator != nil { + return sbSku_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSku_STATUS_ARM(generators) + sbSku_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBSku_STATUS_ARM{}), generators) + + return sbSku_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBSku_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSku_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Capacity"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf(SBSku_Name_STATUS_Basic, SBSku_Name_STATUS_Premium, SBSku_Name_STATUS_Standard)) + gens["Tier"] = gen.PtrOf(gen.OneConstOf(SBSku_Tier_STATUS_Basic, SBSku_Tier_STATUS_Premium, SBSku_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/servicebus/v1api20221001preview/namespace_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespace_types_gen.go new file mode 100644 index 00000000000..158751eff01 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespace_types_gen.go @@ -0,0 +1,3377 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import ( + "fmt" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" + "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: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/namespace-preview.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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 { + // intermediate variable for conversion + var source v20221001ps.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 nil +} + +// ConvertTo populates the provided hub Namespace from our Namespace +func (namespace *Namespace) ConvertTo(hub conversion.Hub) error { + // intermediate variable for conversion + var destination v20221001ps.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 nil +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20221001preview-namespace,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespaces,verbs=create;update,versions=v1api20221001preview,name=default.v1api20221001preview.namespaces.servicebus.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.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 "2022-10-01-preview" +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 +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces" +func (namespace *Namespace) GetType() string { + return "Microsoft.ServiceBus/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 &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: namespace.Spec.Owner.Name, + } +} + +// 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-servicebus-azure-com-v1api20221001preview-namespace,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespaces,verbs=create;update,versions=v1api20221001preview,name=validate.v1api20221001preview.namespaces.servicebus.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.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.validateSecretDestinations() + }, + } +} + +// 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.Endpoint, + 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 *v20221001ps.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 *v20221001ps.Namespace) error { + + // ObjectMeta + destination.ObjectMeta = *namespace.ObjectMeta.DeepCopy() + + // Spec + var spec v20221001ps.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 v20221001ps.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: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/namespace-preview.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName} +type NamespaceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Namespace `json:"items"` +} + +// +kubebuilder:validation:Enum={"2022-10-01-preview"} +type APIVersion string + +const APIVersion_Value = APIVersion("2022-10-01-preview") + +type Namespace_Spec struct { + // AlternateName: Alternate name for namespace + 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"` + + // DisableLocalAuth: This property disables SAS authentication for the Service Bus 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"` + + // +kubebuilder:validation:Required + // Location: The Geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // MinimumTlsVersion: The minimum TLS version for the cluster to support, e.g. '1.2' + MinimumTlsVersion *SBNamespaceProperties_MinimumTlsVersion `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"` + + // PremiumMessagingPartitions: The number of partitions of a Service Bus namespace. This property is only applicable to + // Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4 + PremiumMessagingPartitions *int `json:"premiumMessagingPartitions,omitempty"` + + // PublicNetworkAccess: This determines if traffic is allowed over public network. By default it is enabled. + PublicNetworkAccess *SBNamespaceProperties_PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + + // Sku: Properties of SKU + Sku *SBSku `json:"sku,omitempty"` + + // Tags: Resource tags + Tags map[string]string `json:"tags,omitempty"` + + // ZoneRedundant: Enabling this property creates a Premium Service Bus 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.DisableLocalAuth != nil || + namespace.Encryption != nil || + namespace.MinimumTlsVersion != nil || + namespace.PremiumMessagingPartitions != nil || + namespace.PublicNetworkAccess != nil || + namespace.ZoneRedundant != nil { + result.Properties = &SBNamespaceProperties_ARM{} + } + if namespace.AlternateName != nil { + alternateName := *namespace.AlternateName + result.Properties.AlternateName = &alternateName + } + 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.MinimumTlsVersion != nil { + minimumTlsVersion := *namespace.MinimumTlsVersion + result.Properties.MinimumTlsVersion = &minimumTlsVersion + } + if namespace.PremiumMessagingPartitions != nil { + premiumMessagingPartitions := *namespace.PremiumMessagingPartitions + result.Properties.PremiumMessagingPartitions = &premiumMessagingPartitions + } + 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.(*SBSku_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)) + + // 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 "Location": + if typedInput.Location != nil { + location := *typedInput.Location + namespace.Location = &location + } + + // 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} + + // Set property "PremiumMessagingPartitions": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PremiumMessagingPartitions != nil { + premiumMessagingPartitions := *typedInput.Properties.PremiumMessagingPartitions + namespace.PremiumMessagingPartitions = &premiumMessagingPartitions + } + } + + // 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 SBSku + 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.(*v20221001ps.Namespace_Spec) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_Spec(src) + } + + // Convert to an intermediate form + src = &v20221001ps.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.(*v20221001ps.Namespace_Spec) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20221001ps.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 *v20221001ps.Namespace_Spec) error { + + // AlternateName + namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) + + // AzureName + namespace.AzureName = source.AzureName + + // 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 + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // MinimumTlsVersion + if source.MinimumTlsVersion != nil { + minimumTlsVersion := SBNamespaceProperties_MinimumTlsVersion(*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 + } + + // PremiumMessagingPartitions + namespace.PremiumMessagingPartitions = genruntime.ClonePointerToInt(source.PremiumMessagingPartitions) + + // PublicNetworkAccess + if source.PublicNetworkAccess != nil { + publicNetworkAccess := SBNamespaceProperties_PublicNetworkAccess(*source.PublicNetworkAccess) + namespace.PublicNetworkAccess = &publicNetworkAccess + } else { + namespace.PublicNetworkAccess = nil + } + + // Sku + if source.Sku != nil { + var sku SBSku + err := sku.AssignProperties_From_SBSku(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBSku() 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 *v20221001ps.Namespace_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AlternateName + destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName) + + // AzureName + destination.AzureName = namespace.AzureName + + // DisableLocalAuth + if namespace.DisableLocalAuth != nil { + disableLocalAuth := *namespace.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Encryption + if namespace.Encryption != nil { + var encryption v20221001ps.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 v20221001ps.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 + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // MinimumTlsVersion + if namespace.MinimumTlsVersion != nil { + minimumTlsVersion := string(*namespace.MinimumTlsVersion) + destination.MinimumTlsVersion = &minimumTlsVersion + } else { + destination.MinimumTlsVersion = nil + } + + // OperatorSpec + if namespace.OperatorSpec != nil { + var operatorSpec v20221001ps.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 + } + + // PremiumMessagingPartitions + destination.PremiumMessagingPartitions = genruntime.ClonePointerToInt(namespace.PremiumMessagingPartitions) + + // PublicNetworkAccess + if namespace.PublicNetworkAccess != nil { + publicNetworkAccess := string(*namespace.PublicNetworkAccess) + destination.PublicNetworkAccess = &publicNetworkAccess + } else { + destination.PublicNetworkAccess = nil + } + + // Sku + if namespace.Sku != nil { + var sku v20221001ps.SBSku + err := namespace.Sku.AssignProperties_To_SBSku(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBSku() 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 +} + +// 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 for namespace + AlternateName *string `json:"alternateName,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 Service Bus namespace. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // Encryption: Properties of BYOK Encryption description + Encryption *Encryption_STATUS `json:"encryption,omitempty"` + + // Id: Resource Id + Id *string `json:"id,omitempty"` + + // Identity: Properties of BYOK Identity description + Identity *Identity_STATUS `json:"identity,omitempty"` + + // Location: The Geo-location where the resource lives + Location *string `json:"location,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 *SBNamespaceProperties_MinimumTlsVersion_STATUS `json:"minimumTlsVersion,omitempty"` + + // Name: Resource name + Name *string `json:"name,omitempty"` + + // PremiumMessagingPartitions: The number of partitions of a Service Bus namespace. This property is only applicable to + // Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4 + PremiumMessagingPartitions *int `json:"premiumMessagingPartitions,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 *SBNamespaceProperties_PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"` + + // ServiceBusEndpoint: Endpoint you can use to perform Service Bus operations. + ServiceBusEndpoint *string `json:"serviceBusEndpoint,omitempty"` + + // Sku: Properties of SKU + Sku *SBSku_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: Resource type + Type *string `json:"type,omitempty"` + + // UpdatedAt: The time the namespace was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` + + // ZoneRedundant: Enabling this property creates a Premium Service Bus 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.(*v20221001ps.Namespace_STATUS) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_STATUS(src) + } + + // Convert to an intermediate form + src = &v20221001ps.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.(*v20221001ps.Namespace_STATUS) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20221001ps.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 + } + } + + // 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 "Location": + if typedInput.Location != nil { + location := *typedInput.Location + namespace.Location = &location + } + + // 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 "PremiumMessagingPartitions": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.PremiumMessagingPartitions != nil { + premiumMessagingPartitions := *typedInput.Properties.PremiumMessagingPartitions + namespace.PremiumMessagingPartitions = &premiumMessagingPartitions + } + } + + // 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 SBSku_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 *v20221001ps.Namespace_STATUS) error { + + // AlternateName + namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) + + // 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 + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // MetricId + namespace.MetricId = genruntime.ClonePointerToString(source.MetricId) + + // MinimumTlsVersion + if source.MinimumTlsVersion != nil { + minimumTlsVersion := SBNamespaceProperties_MinimumTlsVersion_STATUS(*source.MinimumTlsVersion) + namespace.MinimumTlsVersion = &minimumTlsVersion + } else { + namespace.MinimumTlsVersion = nil + } + + // Name + namespace.Name = genruntime.ClonePointerToString(source.Name) + + // PremiumMessagingPartitions + namespace.PremiumMessagingPartitions = genruntime.ClonePointerToInt(source.PremiumMessagingPartitions) + + // 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 := SBNamespaceProperties_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 SBSku_STATUS + err := sku.AssignProperties_From_SBSku_STATUS(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBSku_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 *v20221001ps.Namespace_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AlternateName + destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName) + + // 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 v20221001ps.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 v20221001ps.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 + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // 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) + + // PremiumMessagingPartitions + destination.PremiumMessagingPartitions = genruntime.ClonePointerToInt(namespace.PremiumMessagingPartitions) + + // PrivateEndpointConnections + if namespace.PrivateEndpointConnections != nil { + privateEndpointConnectionList := make([]v20221001ps.PrivateEndpointConnection_STATUS, len(namespace.PrivateEndpointConnections)) + for privateEndpointConnectionIndex, privateEndpointConnectionItem := range namespace.PrivateEndpointConnections { + // Shadow the loop variable to avoid aliasing + privateEndpointConnectionItem := privateEndpointConnectionItem + var privateEndpointConnection v20221001ps.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 v20221001ps.SBSku_STATUS + err := namespace.Sku.AssignProperties_To_SBSku_STATUS(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBSku_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 v20221001ps.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 *v20221001ps.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 *v20221001ps.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([]v20221001ps.KeyVaultProperties, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty v20221001ps.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 +} + +// 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 *v20221001ps.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 *v20221001ps.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([]v20221001ps.KeyVaultProperties_STATUS, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty v20221001ps.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 User Assigned Identities 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 *v20221001ps.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 *v20221001ps.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([]v20221001ps.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities)) + for userAssignedIdentityIndex, userAssignedIdentityItem := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityItem := userAssignedIdentityItem + var userAssignedIdentity v20221001ps.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 +} + +// Properties to configure User Assigned Identities 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 *v20221001ps.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 *v20221001ps.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]v20221001ps.UserAssignedIdentity_STATUS, len(identity.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + var userAssignedIdentity v20221001ps.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 +} + +// 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 *v20221001ps.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 *v20221001ps.NamespaceOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Secrets + if operator.Secrets != nil { + var secret v20221001ps.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 *v20221001ps.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 *v20221001ps.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 +} + +// +kubebuilder:validation:Enum={"1.0","1.1","1.2"} +type SBNamespaceProperties_MinimumTlsVersion string + +const ( + SBNamespaceProperties_MinimumTlsVersion_10 = SBNamespaceProperties_MinimumTlsVersion("1.0") + SBNamespaceProperties_MinimumTlsVersion_11 = SBNamespaceProperties_MinimumTlsVersion("1.1") + SBNamespaceProperties_MinimumTlsVersion_12 = SBNamespaceProperties_MinimumTlsVersion("1.2") +) + +type SBNamespaceProperties_MinimumTlsVersion_STATUS string + +const ( + SBNamespaceProperties_MinimumTlsVersion_STATUS_10 = SBNamespaceProperties_MinimumTlsVersion_STATUS("1.0") + SBNamespaceProperties_MinimumTlsVersion_STATUS_11 = SBNamespaceProperties_MinimumTlsVersion_STATUS("1.1") + SBNamespaceProperties_MinimumTlsVersion_STATUS_12 = SBNamespaceProperties_MinimumTlsVersion_STATUS("1.2") +) + +// +kubebuilder:validation:Enum={"Disabled","Enabled","SecuredByPerimeter"} +type SBNamespaceProperties_PublicNetworkAccess string + +const ( + SBNamespaceProperties_PublicNetworkAccess_Disabled = SBNamespaceProperties_PublicNetworkAccess("Disabled") + SBNamespaceProperties_PublicNetworkAccess_Enabled = SBNamespaceProperties_PublicNetworkAccess("Enabled") + SBNamespaceProperties_PublicNetworkAccess_SecuredByPerimeter = SBNamespaceProperties_PublicNetworkAccess("SecuredByPerimeter") +) + +type SBNamespaceProperties_PublicNetworkAccess_STATUS string + +const ( + SBNamespaceProperties_PublicNetworkAccess_STATUS_Disabled = SBNamespaceProperties_PublicNetworkAccess_STATUS("Disabled") + SBNamespaceProperties_PublicNetworkAccess_STATUS_Enabled = SBNamespaceProperties_PublicNetworkAccess_STATUS("Enabled") + SBNamespaceProperties_PublicNetworkAccess_STATUS_SecuredByPerimeter = SBNamespaceProperties_PublicNetworkAccess_STATUS("SecuredByPerimeter") +) + +// SKU of the namespace. +type SBSku struct { + // Capacity: Messaging units for your service bus premium namespace. Valid capacities are {1, 2, 4, 8, 16} multiples of + // your properties.premiumMessagingPartitions setting. For example, If properties.premiumMessagingPartitions is 1 then + // possible capacity values are 1, 2, 4, 8, and 16. If properties.premiumMessagingPartitions is 4 then possible capacity + // values are 4, 8, 16, 32 and 64 + Capacity *int `json:"capacity,omitempty"` + + // +kubebuilder:validation:Required + // Name: Name of this SKU. + Name *SBSku_Name `json:"name,omitempty"` + + // Tier: The billing tier of this particular SKU. + Tier *SBSku_Tier `json:"tier,omitempty"` +} + +var _ genruntime.ARMTransformer = &SBSku{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (sbSku *SBSku) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if sbSku == nil { + return nil, nil + } + result := &SBSku_ARM{} + + // Set property "Capacity": + if sbSku.Capacity != nil { + capacity := *sbSku.Capacity + result.Capacity = &capacity + } + + // Set property "Name": + if sbSku.Name != nil { + name := *sbSku.Name + result.Name = &name + } + + // Set property "Tier": + if sbSku.Tier != nil { + tier := *sbSku.Tier + result.Tier = &tier + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (sbSku *SBSku) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SBSku_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (sbSku *SBSku) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SBSku_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SBSku_ARM, got %T", armInput) + } + + // Set property "Capacity": + if typedInput.Capacity != nil { + capacity := *typedInput.Capacity + sbSku.Capacity = &capacity + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + sbSku.Name = &name + } + + // Set property "Tier": + if typedInput.Tier != nil { + tier := *typedInput.Tier + sbSku.Tier = &tier + } + + // No error + return nil +} + +// AssignProperties_From_SBSku populates our SBSku from the provided source SBSku +func (sbSku *SBSku) AssignProperties_From_SBSku(source *v20221001ps.SBSku) error { + + // Capacity + sbSku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + if source.Name != nil { + name := SBSku_Name(*source.Name) + sbSku.Name = &name + } else { + sbSku.Name = nil + } + + // Tier + if source.Tier != nil { + tier := SBSku_Tier(*source.Tier) + sbSku.Tier = &tier + } else { + sbSku.Tier = nil + } + + // No error + return nil +} + +// AssignProperties_To_SBSku populates the provided destination SBSku from our SBSku +func (sbSku *SBSku) AssignProperties_To_SBSku(destination *v20221001ps.SBSku) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Capacity + destination.Capacity = genruntime.ClonePointerToInt(sbSku.Capacity) + + // Name + if sbSku.Name != nil { + name := string(*sbSku.Name) + destination.Name = &name + } else { + destination.Name = nil + } + + // Tier + if sbSku.Tier != nil { + tier := string(*sbSku.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 +} + +// SKU of the namespace. +type SBSku_STATUS struct { + // Capacity: Messaging units for your service bus premium namespace. Valid capacities are {1, 2, 4, 8, 16} multiples of + // your properties.premiumMessagingPartitions setting. For example, If properties.premiumMessagingPartitions is 1 then + // possible capacity values are 1, 2, 4, 8, and 16. If properties.premiumMessagingPartitions is 4 then possible capacity + // values are 4, 8, 16, 32 and 64 + Capacity *int `json:"capacity,omitempty"` + + // Name: Name of this SKU. + Name *SBSku_Name_STATUS `json:"name,omitempty"` + + // Tier: The billing tier of this particular SKU. + Tier *SBSku_Tier_STATUS `json:"tier,omitempty"` +} + +var _ genruntime.FromARMConverter = &SBSku_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (sbSku *SBSku_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SBSku_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (sbSku *SBSku_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SBSku_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SBSku_STATUS_ARM, got %T", armInput) + } + + // Set property "Capacity": + if typedInput.Capacity != nil { + capacity := *typedInput.Capacity + sbSku.Capacity = &capacity + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + sbSku.Name = &name + } + + // Set property "Tier": + if typedInput.Tier != nil { + tier := *typedInput.Tier + sbSku.Tier = &tier + } + + // No error + return nil +} + +// AssignProperties_From_SBSku_STATUS populates our SBSku_STATUS from the provided source SBSku_STATUS +func (sbSku *SBSku_STATUS) AssignProperties_From_SBSku_STATUS(source *v20221001ps.SBSku_STATUS) error { + + // Capacity + sbSku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + if source.Name != nil { + name := SBSku_Name_STATUS(*source.Name) + sbSku.Name = &name + } else { + sbSku.Name = nil + } + + // Tier + if source.Tier != nil { + tier := SBSku_Tier_STATUS(*source.Tier) + sbSku.Tier = &tier + } else { + sbSku.Tier = nil + } + + // No error + return nil +} + +// AssignProperties_To_SBSku_STATUS populates the provided destination SBSku_STATUS from our SBSku_STATUS +func (sbSku *SBSku_STATUS) AssignProperties_To_SBSku_STATUS(destination *v20221001ps.SBSku_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Capacity + destination.Capacity = genruntime.ClonePointerToInt(sbSku.Capacity) + + // Name + if sbSku.Name != nil { + name := string(*sbSku.Name) + destination.Name = &name + } else { + destination.Name = nil + } + + // Tier + if sbSku.Tier != nil { + tier := string(*sbSku.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 *v20221001ps.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 *v20221001ps.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: Version of KeyVault + 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 *v20221001ps.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 *v20221001ps.KeyVaultProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Identity + if properties.Identity != nil { + var identity v20221001ps.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 +} + +// 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: Version of KeyVault + 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 *v20221001ps.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 *v20221001ps.KeyVaultProperties_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Identity + if properties.Identity != nil { + var identity v20221001ps.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 { + // Endpoint: indicates where the Endpoint secret should be placed. If omitted, the secret will not be retrieved from Azure. + Endpoint *genruntime.SecretDestination `json:"endpoint,omitempty"` + + // 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 *v20221001ps.NamespaceOperatorSecrets) error { + + // Endpoint + if source.Endpoint != nil { + endpoint := source.Endpoint.Copy() + secrets.Endpoint = &endpoint + } else { + secrets.Endpoint = nil + } + + // 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 *v20221001ps.NamespaceOperatorSecrets) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Endpoint + if secrets.Endpoint != nil { + endpoint := secrets.Endpoint.Copy() + destination.Endpoint = &endpoint + } else { + destination.Endpoint = nil + } + + // 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 *v20221001ps.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 *v20221001ps.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 *v20221001ps.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 *v20221001ps.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 *v20221001ps.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 *v20221001ps.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 +} + +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 *v20221001ps.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 *v20221001ps.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/servicebus/v1api20221001preview/namespace_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespace_types_gen_test.go new file mode 100644 index 00000000000..a4c550128a6 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespace_types_gen_test.go @@ -0,0 +1,2169 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" + "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 v20211101s.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MinimumTlsVersion"] = gen.PtrOf(gen.OneConstOf(SBNamespaceProperties_MinimumTlsVersion_10, SBNamespaceProperties_MinimumTlsVersion_11, SBNamespaceProperties_MinimumTlsVersion_12)) + gens["PremiumMessagingPartitions"] = gen.PtrOf(gen.Int()) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(SBNamespaceProperties_PublicNetworkAccess_Disabled, SBNamespaceProperties_PublicNetworkAccess_Enabled, SBNamespaceProperties_PublicNetworkAccess_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(SBSkuGenerator()) +} + +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 v1api20221001previewstorage 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 v20221001ps.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["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MetricId"] = gen.PtrOf(gen.AlphaString()) + gens["MinimumTlsVersion"] = gen.PtrOf(gen.OneConstOf(SBNamespaceProperties_MinimumTlsVersion_STATUS_10, SBNamespaceProperties_MinimumTlsVersion_STATUS_11, SBNamespaceProperties_MinimumTlsVersion_STATUS_12)) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["PremiumMessagingPartitions"] = gen.PtrOf(gen.Int()) + gens["ProvisioningState"] = gen.PtrOf(gen.AlphaString()) + gens["PublicNetworkAccess"] = gen.PtrOf(gen.OneConstOf(SBNamespaceProperties_PublicNetworkAccess_STATUS_Disabled, SBNamespaceProperties_PublicNetworkAccess_STATUS_Enabled, SBNamespaceProperties_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(SBSku_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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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_SBSku_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBSku to SBSku via AssignProperties_To_SBSku & AssignProperties_From_SBSku returns original", + prop.ForAll(RunPropertyAssignmentTestForSBSku, SBSkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBSku tests if a specific instance of SBSku can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForSBSku(subject SBSku) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20221001ps.SBSku + err := copied.AssignProperties_To_SBSku(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBSku + err = actual.AssignProperties_From_SBSku(&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_SBSku_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 SBSku via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSku, SBSkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSku runs a test to see if a specific instance of SBSku round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSku(subject SBSku) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSku + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SBSku instances for property testing - lazily instantiated by SBSkuGenerator() +var sbSkuGenerator gopter.Gen + +// SBSkuGenerator returns a generator of SBSku instances for property testing. +func SBSkuGenerator() gopter.Gen { + if sbSkuGenerator != nil { + return sbSkuGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSku(generators) + sbSkuGenerator = gen.Struct(reflect.TypeOf(SBSku{}), generators) + + return sbSkuGenerator +} + +// AddIndependentPropertyGeneratorsForSBSku is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSku(gens map[string]gopter.Gen) { + gens["Capacity"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf(SBSku_Name_Basic, SBSku_Name_Premium, SBSku_Name_Standard)) + gens["Tier"] = gen.PtrOf(gen.OneConstOf(SBSku_Tier_Basic, SBSku_Tier_Premium, SBSku_Tier_Standard)) +} + +func Test_SBSku_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBSku_STATUS to SBSku_STATUS via AssignProperties_To_SBSku_STATUS & AssignProperties_From_SBSku_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSBSku_STATUS, SBSku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBSku_STATUS tests if a specific instance of SBSku_STATUS can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForSBSku_STATUS(subject SBSku_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 v20221001ps.SBSku_STATUS + err := copied.AssignProperties_To_SBSku_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBSku_STATUS + err = actual.AssignProperties_From_SBSku_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_SBSku_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 SBSku_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSku_STATUS, SBSku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSku_STATUS runs a test to see if a specific instance of SBSku_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSku_STATUS(subject SBSku_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSku_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 SBSku_STATUS instances for property testing - lazily instantiated by SBSku_STATUSGenerator() +var sbSku_STATUSGenerator gopter.Gen + +// SBSku_STATUSGenerator returns a generator of SBSku_STATUS instances for property testing. +func SBSku_STATUSGenerator() gopter.Gen { + if sbSku_STATUSGenerator != nil { + return sbSku_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSku_STATUS(generators) + sbSku_STATUSGenerator = gen.Struct(reflect.TypeOf(SBSku_STATUS{}), generators) + + return sbSku_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSBSku_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSku_STATUS(gens map[string]gopter.Gen) { + gens["Capacity"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.OneConstOf(SBSku_Name_STATUS_Basic, SBSku_Name_STATUS_Premium, SBSku_Name_STATUS_Standard)) + gens["Tier"] = gen.PtrOf(gen.OneConstOf(SBSku_Tier_STATUS_Basic, SBSku_Tier_STATUS_Premium, SBSku_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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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/servicebus/v1api20221001preview/namespaces_authorization_rule_spec_arm_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_spec_arm_types_gen.go new file mode 100644 index 00000000000..aaa8c570e10 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/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 v1api20221001preview + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_AuthorizationRule_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: AuthorizationRule properties. + 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 "2022-10-01-preview" +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.ServiceBus/namespaces/AuthorizationRules" +func (rule *Namespaces_AuthorizationRule_Spec_ARM) GetType() string { + return "Microsoft.ServiceBus/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/servicebus/v1api20221001preview/namespaces_authorization_rule_spec_arm_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..bb0ffb830b6 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/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 v1api20221001preview + +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/servicebus/v1api20221001preview/namespaces_authorization_rule_status_arm_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_status_arm_types_gen.go new file mode 100644 index 00000000000..45f4788dd47 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/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 v1api20221001preview + +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: AuthorizationRule properties. + 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/servicebus/v1api20221001preview/namespaces_authorization_rule_status_arm_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_status_arm_types_gen_test.go new file mode 100644 index 00000000000..92d8af4d9be --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/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 v1api20221001preview + +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/servicebus/v1api20221001preview/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_types_gen.go new file mode 100644 index 00000000000..32c9d026f99 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_types_gen.go @@ -0,0 +1,988 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import ( + "fmt" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" + "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: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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 { + // intermediate variable for conversion + var source v20221001ps.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") + } + + return nil +} + +// ConvertTo populates the provided hub NamespacesAuthorizationRule from our NamespacesAuthorizationRule +func (rule *NamespacesAuthorizationRule) ConvertTo(hub conversion.Hub) error { + // intermediate variable for conversion + var destination v20221001ps.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 nil +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20221001preview-namespacesauthorizationrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesauthorizationrules,verbs=create;update,versions=v1api20221001preview,name=default.v1api20221001preview.namespacesauthorizationrules.servicebus.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.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 "2022-10-01-preview" +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 +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/AuthorizationRules" +func (rule *NamespacesAuthorizationRule) GetType() string { + return "Microsoft.ServiceBus/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 &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: rule.Spec.Owner.Name, + } +} + +// 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-servicebus-azure-com-v1api20221001preview-namespacesauthorizationrule,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesauthorizationrules,verbs=create;update,versions=v1api20221001preview,name=validate.v1api20221001preview.namespacesauthorizationrules.servicebus.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.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.validateSecretDestinations() + }, + } +} + +// 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 *v20221001ps.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 *v20221001ps.NamespacesAuthorizationRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec v20221001ps.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 v20221001ps.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: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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: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"` + + // 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 servicebus.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"servicebus.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} + + // 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.(*v20221001ps.Namespaces_AuthorizationRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src) + } + + // Convert to an intermediate form + src = &v20221001ps.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.(*v20221001ps.Namespaces_AuthorizationRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_AuthorizationRule_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20221001ps.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 *v20221001ps.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 *v20221001ps.Namespaces_AuthorizationRule_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AzureName + destination.AzureName = rule.AzureName + + // OperatorSpec + if rule.OperatorSpec != nil { + var operatorSpec v20221001ps.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 +} + +// 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.(*v20221001ps.Namespaces_AuthorizationRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src) + } + + // Convert to an intermediate form + src = &v20221001ps.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.(*v20221001ps.Namespaces_AuthorizationRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20221001ps.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 *v20221001ps.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 *v20221001ps.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 v20221001ps.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 *v20221001ps.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 *v20221001ps.NamespacesAuthorizationRuleOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Secrets + if operator.Secrets != nil { + var secret v20221001ps.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 *v20221001ps.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 *v20221001ps.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/servicebus/v1api20221001preview/namespaces_authorization_rule_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_types_gen_test.go new file mode 100644 index 00000000000..bbd0db7821c --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_types_gen_test.go @@ -0,0 +1,606 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" + "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 v20211101s.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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 v1api20221001previewstorage 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 v20221001ps.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/servicebus/v1api20221001preview/namespaces_queue_spec_arm_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_queue_spec_arm_types_gen.go new file mode 100644 index 00000000000..2f24dc0c4fd --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_queue_spec_arm_types_gen.go @@ -0,0 +1,88 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_Queue_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: Queue Properties + Properties *SBQueueProperties_ARM `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespaces_Queue_Spec_ARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2022-10-01-preview" +func (queue Namespaces_Queue_Spec_ARM) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetName returns the Name of the resource +func (queue *Namespaces_Queue_Spec_ARM) GetName() string { + return queue.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/queues" +func (queue *Namespaces_Queue_Spec_ARM) GetType() string { + return "Microsoft.ServiceBus/namespaces/queues" +} + +// The Queue Properties definition. +type SBQueueProperties_ARM struct { + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // DeadLetteringOnMessageExpiration: A value that indicates whether this queue has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: A value that indicates whether Express Entities are enabled. An express queue holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: A value that indicates whether the queue is to be partitioned across multiple message brokers. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // LockDuration: ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for + // other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: The maximum delivery count. A message is automatically deadlettered after this number of deliveries. + // default value is 10. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the queue. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + + // RequiresDuplicateDetection: A value indicating if this queue requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // RequiresSession: A value that indicates whether the queue supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_queue_spec_arm_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_queue_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..b7c3764230b --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_queue_spec_arm_types_gen_test.go @@ -0,0 +1,168 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +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_Queue_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_Queue_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Queue_Spec_ARM, Namespaces_Queue_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Queue_Spec_ARM runs a test to see if a specific instance of Namespaces_Queue_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Queue_Spec_ARM(subject Namespaces_Queue_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Queue_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_Queue_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_Queue_Spec_ARMGenerator() +var namespaces_Queue_Spec_ARMGenerator gopter.Gen + +// Namespaces_Queue_Spec_ARMGenerator returns a generator of Namespaces_Queue_Spec_ARM instances for property testing. +// We first initialize namespaces_Queue_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_Queue_Spec_ARMGenerator() gopter.Gen { + if namespaces_Queue_Spec_ARMGenerator != nil { + return namespaces_Queue_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec_ARM(generators) + namespaces_Queue_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Queue_Spec_ARM(generators) + namespaces_Queue_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_Spec_ARM{}), generators) + + return namespaces_Queue_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_Queue_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Queue_Spec_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBQueueProperties_ARMGenerator()) +} + +func Test_SBQueueProperties_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 SBQueueProperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBQueueProperties_ARM, SBQueueProperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBQueueProperties_ARM runs a test to see if a specific instance of SBQueueProperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBQueueProperties_ARM(subject SBQueueProperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBQueueProperties_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 SBQueueProperties_ARM instances for property testing - lazily instantiated by +// SBQueueProperties_ARMGenerator() +var sbQueueProperties_ARMGenerator gopter.Gen + +// SBQueueProperties_ARMGenerator returns a generator of SBQueueProperties_ARM instances for property testing. +func SBQueueProperties_ARMGenerator() gopter.Gen { + if sbQueueProperties_ARMGenerator != nil { + return sbQueueProperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBQueueProperties_ARM(generators) + sbQueueProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBQueueProperties_ARM{}), generators) + + return sbQueueProperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBQueueProperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBQueueProperties_ARM(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_queue_status_arm_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_queue_status_arm_types_gen.go new file mode 100644 index 00000000000..32a1a7d414a --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_queue_status_arm_types_gen.go @@ -0,0 +1,122 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +type Namespaces_Queue_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: Queue Properties + Properties *SBQueueProperties_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"` +} + +// The Queue Properties definition. +type SBQueueProperties_STATUS_ARM struct { + // AccessedAt: Last time a message was sent, or the last time there was a receive request to this queue. + AccessedAt *string `json:"accessedAt,omitempty"` + + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // CountDetails: Message Count Details. + CountDetails *MessageCountDetails_STATUS_ARM `json:"countDetails,omitempty"` + + // CreatedAt: The exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DeadLetteringOnMessageExpiration: A value that indicates whether this queue has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: A value that indicates whether Express Entities are enabled. An express queue holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: A value that indicates whether the queue is to be partitioned across multiple message brokers. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // LockDuration: ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for + // other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: The maximum delivery count. A message is automatically deadlettered after this number of deliveries. + // default value is 10. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the queue. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + + // MessageCount: The number of messages in the queue. + MessageCount *int `json:"messageCount,omitempty"` + + // RequiresDuplicateDetection: A value indicating if this queue requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // RequiresSession: A value that indicates whether the queue supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` + + // SizeInBytes: The size of the queue, in bytes. + SizeInBytes *int `json:"sizeInBytes,omitempty"` + + // Status: Enumerates the possible values for the status of a messaging entity. + Status *EntityStatus_STATUS `json:"status,omitempty"` + + // UpdatedAt: The exact time the message was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +// Message Count Details. +type MessageCountDetails_STATUS_ARM struct { + // ActiveMessageCount: Number of active messages in the queue, topic, or subscription. + ActiveMessageCount *int `json:"activeMessageCount,omitempty"` + + // DeadLetterMessageCount: Number of messages that are dead lettered. + DeadLetterMessageCount *int `json:"deadLetterMessageCount,omitempty"` + + // ScheduledMessageCount: Number of scheduled messages. + ScheduledMessageCount *int `json:"scheduledMessageCount,omitempty"` + + // TransferDeadLetterMessageCount: Number of messages transferred into dead letters. + TransferDeadLetterMessageCount *int `json:"transferDeadLetterMessageCount,omitempty"` + + // TransferMessageCount: Number of messages transferred to another queue, topic, or subscription. + TransferMessageCount *int `json:"transferMessageCount,omitempty"` +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_queue_status_arm_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_queue_status_arm_types_gen_test.go new file mode 100644 index 00000000000..492e6c258d1 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_queue_status_arm_types_gen_test.go @@ -0,0 +1,266 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +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_Queue_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_Queue_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Queue_STATUS_ARM, Namespaces_Queue_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Queue_STATUS_ARM runs a test to see if a specific instance of Namespaces_Queue_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Queue_STATUS_ARM(subject Namespaces_Queue_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Queue_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_Queue_STATUS_ARM instances for property testing - lazily instantiated by +// Namespaces_Queue_STATUS_ARMGenerator() +var namespaces_Queue_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Queue_STATUS_ARMGenerator returns a generator of Namespaces_Queue_STATUS_ARM instances for property testing. +// We first initialize namespaces_Queue_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_Queue_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Queue_STATUS_ARMGenerator != nil { + return namespaces_Queue_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS_ARM(generators) + namespaces_Queue_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS_ARM(generators) + namespaces_Queue_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_STATUS_ARM{}), generators) + + return namespaces_Queue_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Queue_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_Queue_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBQueueProperties_STATUS_ARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) +} + +func Test_SBQueueProperties_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 SBQueueProperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBQueueProperties_STATUS_ARM, SBQueueProperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBQueueProperties_STATUS_ARM runs a test to see if a specific instance of SBQueueProperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBQueueProperties_STATUS_ARM(subject SBQueueProperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBQueueProperties_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 SBQueueProperties_STATUS_ARM instances for property testing - lazily instantiated by +// SBQueueProperties_STATUS_ARMGenerator() +var sbQueueProperties_STATUS_ARMGenerator gopter.Gen + +// SBQueueProperties_STATUS_ARMGenerator returns a generator of SBQueueProperties_STATUS_ARM instances for property testing. +// We first initialize sbQueueProperties_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 SBQueueProperties_STATUS_ARMGenerator() gopter.Gen { + if sbQueueProperties_STATUS_ARMGenerator != nil { + return sbQueueProperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBQueueProperties_STATUS_ARM(generators) + sbQueueProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBQueueProperties_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBQueueProperties_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForSBQueueProperties_STATUS_ARM(generators) + sbQueueProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBQueueProperties_STATUS_ARM{}), generators) + + return sbQueueProperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBQueueProperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBQueueProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["MessageCount"] = gen.PtrOf(gen.Int()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) + gens["SizeInBytes"] = gen.PtrOf(gen.Int()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + EntityStatus_STATUS_Active, + EntityStatus_STATUS_Creating, + EntityStatus_STATUS_Deleting, + EntityStatus_STATUS_Disabled, + EntityStatus_STATUS_ReceiveDisabled, + EntityStatus_STATUS_Renaming, + EntityStatus_STATUS_Restoring, + EntityStatus_STATUS_SendDisabled, + EntityStatus_STATUS_Unknown)) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForSBQueueProperties_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBQueueProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUS_ARMGenerator()) +} + +func Test_MessageCountDetails_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 MessageCountDetails_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForMessageCountDetails_STATUS_ARM, MessageCountDetails_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForMessageCountDetails_STATUS_ARM runs a test to see if a specific instance of MessageCountDetails_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForMessageCountDetails_STATUS_ARM(subject MessageCountDetails_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual MessageCountDetails_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 MessageCountDetails_STATUS_ARM instances for property testing - lazily instantiated by +// MessageCountDetails_STATUS_ARMGenerator() +var messageCountDetails_STATUS_ARMGenerator gopter.Gen + +// MessageCountDetails_STATUS_ARMGenerator returns a generator of MessageCountDetails_STATUS_ARM instances for property testing. +func MessageCountDetails_STATUS_ARMGenerator() gopter.Gen { + if messageCountDetails_STATUS_ARMGenerator != nil { + return messageCountDetails_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS_ARM(generators) + messageCountDetails_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(MessageCountDetails_STATUS_ARM{}), generators) + + return messageCountDetails_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS_ARM(gens map[string]gopter.Gen) { + gens["ActiveMessageCount"] = gen.PtrOf(gen.Int()) + gens["DeadLetterMessageCount"] = gen.PtrOf(gen.Int()) + gens["ScheduledMessageCount"] = gen.PtrOf(gen.Int()) + gens["TransferDeadLetterMessageCount"] = gen.PtrOf(gen.Int()) + gens["TransferMessageCount"] = gen.PtrOf(gen.Int()) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen.go new file mode 100644 index 00000000000..33673451ab3 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen.go @@ -0,0 +1,1728 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import ( + "fmt" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" + "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: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/Queue.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName} +type NamespacesQueue struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Queue_Spec `json:"spec,omitempty"` + Status Namespaces_Queue_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesQueue{} + +// GetConditions returns the conditions of the resource +func (queue *NamespacesQueue) GetConditions() conditions.Conditions { + return queue.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (queue *NamespacesQueue) SetConditions(conditions conditions.Conditions) { + queue.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesQueue{} + +// ConvertFrom populates our NamespacesQueue from the provided hub NamespacesQueue +func (queue *NamespacesQueue) ConvertFrom(hub conversion.Hub) error { + // intermediate variable for conversion + var source v20221001ps.NamespacesQueue + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") + } + + err = queue.AssignProperties_From_NamespacesQueue(&source) + if err != nil { + return errors.Wrap(err, "converting from source to queue") + } + + return nil +} + +// ConvertTo populates the provided hub NamespacesQueue from our NamespacesQueue +func (queue *NamespacesQueue) ConvertTo(hub conversion.Hub) error { + // intermediate variable for conversion + var destination v20221001ps.NamespacesQueue + err := queue.AssignProperties_To_NamespacesQueue(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from queue") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") + } + + return nil +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20221001preview-namespacesqueue,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesqueues,verbs=create;update,versions=v1api20221001preview,name=default.v1api20221001preview.namespacesqueues.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &NamespacesQueue{} + +// Default applies defaults to the NamespacesQueue resource +func (queue *NamespacesQueue) Default() { + queue.defaultImpl() + var temp any = queue + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (queue *NamespacesQueue) defaultAzureName() { + if queue.Spec.AzureName == "" { + queue.Spec.AzureName = queue.Name + } +} + +// defaultImpl applies the code generated defaults to the NamespacesQueue resource +func (queue *NamespacesQueue) defaultImpl() { queue.defaultAzureName() } + +var _ genruntime.KubernetesResource = &NamespacesQueue{} + +// AzureName returns the Azure name of the resource +func (queue *NamespacesQueue) AzureName() string { + return queue.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2022-10-01-preview" +func (queue NamespacesQueue) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (queue *NamespacesQueue) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (queue *NamespacesQueue) GetSpec() genruntime.ConvertibleSpec { + return &queue.Spec +} + +// GetStatus returns the status of this resource +func (queue *NamespacesQueue) GetStatus() genruntime.ConvertibleStatus { + return &queue.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/queues" +func (queue *NamespacesQueue) GetType() string { + return "Microsoft.ServiceBus/namespaces/queues" +} + +// NewEmptyStatus returns a new empty (blank) status +func (queue *NamespacesQueue) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Queue_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (queue *NamespacesQueue) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: queue.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (queue *NamespacesQueue) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Queue_STATUS); ok { + queue.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Queue_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + queue.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-servicebus-azure-com-v1api20221001preview-namespacesqueue,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesqueues,verbs=create;update,versions=v1api20221001preview,name=validate.v1api20221001preview.namespacesqueues.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &NamespacesQueue{} + +// ValidateCreate validates the creation of the resource +func (queue *NamespacesQueue) ValidateCreate() (admission.Warnings, error) { + validations := queue.createValidations() + var temp any = queue + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + return genruntime.ValidateCreate(validations) +} + +// ValidateDelete validates the deletion of the resource +func (queue *NamespacesQueue) ValidateDelete() (admission.Warnings, error) { + validations := queue.deleteValidations() + var temp any = queue + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + return genruntime.ValidateDelete(validations) +} + +// ValidateUpdate validates an update of the resource +func (queue *NamespacesQueue) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { + validations := queue.updateValidations() + var temp any = queue + 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 (queue *NamespacesQueue) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){queue.validateResourceReferences} +} + +// deleteValidations validates the deletion of the resource +func (queue *NamespacesQueue) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (queue *NamespacesQueue) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return queue.validateResourceReferences() + }, + queue.validateWriteOnceProperties} +} + +// validateResourceReferences validates all resource references +func (queue *NamespacesQueue) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&queue.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (queue *NamespacesQueue) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*NamespacesQueue) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, queue) +} + +// AssignProperties_From_NamespacesQueue populates our NamespacesQueue from the provided source NamespacesQueue +func (queue *NamespacesQueue) AssignProperties_From_NamespacesQueue(source *v20221001ps.NamespacesQueue) error { + + // ObjectMeta + queue.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Queue_Spec + err := spec.AssignProperties_From_Namespaces_Queue_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Queue_Spec() to populate field Spec") + } + queue.Spec = spec + + // Status + var status Namespaces_Queue_STATUS + err = status.AssignProperties_From_Namespaces_Queue_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Queue_STATUS() to populate field Status") + } + queue.Status = status + + // No error + return nil +} + +// AssignProperties_To_NamespacesQueue populates the provided destination NamespacesQueue from our NamespacesQueue +func (queue *NamespacesQueue) AssignProperties_To_NamespacesQueue(destination *v20221001ps.NamespacesQueue) error { + + // ObjectMeta + destination.ObjectMeta = *queue.ObjectMeta.DeepCopy() + + // Spec + var spec v20221001ps.Namespaces_Queue_Spec + err := queue.Spec.AssignProperties_To_Namespaces_Queue_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Queue_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20221001ps.Namespaces_Queue_STATUS + err = queue.Status.AssignProperties_To_Namespaces_Queue_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Queue_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 (queue *NamespacesQueue) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: queue.Spec.OriginalVersion(), + Kind: "NamespacesQueue", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/Queue.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName} +type NamespacesQueueList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesQueue `json:"items"` +} + +type Namespaces_Queue_Spec struct { + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // +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"` + + // DeadLetteringOnMessageExpiration: A value that indicates whether this queue has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: A value that indicates whether Express Entities are enabled. An express queue holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: A value that indicates whether the queue is to be partitioned across multiple message brokers. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // LockDuration: ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for + // other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: The maximum delivery count. A message is automatically deadlettered after this number of deliveries. + // default value is 10. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the queue. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,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 servicebus.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"Namespace"` + + // RequiresDuplicateDetection: A value indicating if this queue requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // RequiresSession: A value that indicates whether the queue supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` +} + +var _ genruntime.ARMTransformer = &Namespaces_Queue_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (queue *Namespaces_Queue_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if queue == nil { + return nil, nil + } + result := &Namespaces_Queue_Spec_ARM{} + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if queue.AutoDeleteOnIdle != nil || + queue.DeadLetteringOnMessageExpiration != nil || + queue.DefaultMessageTimeToLive != nil || + queue.DuplicateDetectionHistoryTimeWindow != nil || + queue.EnableBatchedOperations != nil || + queue.EnableExpress != nil || + queue.EnablePartitioning != nil || + queue.ForwardDeadLetteredMessagesTo != nil || + queue.ForwardTo != nil || + queue.LockDuration != nil || + queue.MaxDeliveryCount != nil || + queue.MaxMessageSizeInKilobytes != nil || + queue.MaxSizeInMegabytes != nil || + queue.RequiresDuplicateDetection != nil || + queue.RequiresSession != nil { + result.Properties = &SBQueueProperties_ARM{} + } + if queue.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *queue.AutoDeleteOnIdle + result.Properties.AutoDeleteOnIdle = &autoDeleteOnIdle + } + if queue.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *queue.DeadLetteringOnMessageExpiration + result.Properties.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } + if queue.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *queue.DefaultMessageTimeToLive + result.Properties.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + if queue.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *queue.DuplicateDetectionHistoryTimeWindow + result.Properties.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + if queue.EnableBatchedOperations != nil { + enableBatchedOperations := *queue.EnableBatchedOperations + result.Properties.EnableBatchedOperations = &enableBatchedOperations + } + if queue.EnableExpress != nil { + enableExpress := *queue.EnableExpress + result.Properties.EnableExpress = &enableExpress + } + if queue.EnablePartitioning != nil { + enablePartitioning := *queue.EnablePartitioning + result.Properties.EnablePartitioning = &enablePartitioning + } + if queue.ForwardDeadLetteredMessagesTo != nil { + forwardDeadLetteredMessagesTo := *queue.ForwardDeadLetteredMessagesTo + result.Properties.ForwardDeadLetteredMessagesTo = &forwardDeadLetteredMessagesTo + } + if queue.ForwardTo != nil { + forwardTo := *queue.ForwardTo + result.Properties.ForwardTo = &forwardTo + } + if queue.LockDuration != nil { + lockDuration := *queue.LockDuration + result.Properties.LockDuration = &lockDuration + } + if queue.MaxDeliveryCount != nil { + maxDeliveryCount := *queue.MaxDeliveryCount + result.Properties.MaxDeliveryCount = &maxDeliveryCount + } + if queue.MaxMessageSizeInKilobytes != nil { + maxMessageSizeInKilobytes := *queue.MaxMessageSizeInKilobytes + result.Properties.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobytes + } + if queue.MaxSizeInMegabytes != nil { + maxSizeInMegabytes := *queue.MaxSizeInMegabytes + result.Properties.MaxSizeInMegabytes = &maxSizeInMegabytes + } + if queue.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *queue.RequiresDuplicateDetection + result.Properties.RequiresDuplicateDetection = &requiresDuplicateDetection + } + if queue.RequiresSession != nil { + requiresSession := *queue.RequiresSession + result.Properties.RequiresSession = &requiresSession + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (queue *Namespaces_Queue_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Queue_Spec_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (queue *Namespaces_Queue_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Queue_Spec_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Queue_Spec_ARM, got %T", armInput) + } + + // Set property "AutoDeleteOnIdle": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *typedInput.Properties.AutoDeleteOnIdle + queue.AutoDeleteOnIdle = &autoDeleteOnIdle + } + } + + // Set property "AzureName": + queue.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // Set property "DeadLetteringOnMessageExpiration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *typedInput.Properties.DeadLetteringOnMessageExpiration + queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } + } + + // Set property "DefaultMessageTimeToLive": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *typedInput.Properties.DefaultMessageTimeToLive + queue.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + } + + // Set property "DuplicateDetectionHistoryTimeWindow": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *typedInput.Properties.DuplicateDetectionHistoryTimeWindow + queue.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + } + + // Set property "EnableBatchedOperations": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableBatchedOperations != nil { + enableBatchedOperations := *typedInput.Properties.EnableBatchedOperations + queue.EnableBatchedOperations = &enableBatchedOperations + } + } + + // Set property "EnableExpress": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableExpress != nil { + enableExpress := *typedInput.Properties.EnableExpress + queue.EnableExpress = &enableExpress + } + } + + // Set property "EnablePartitioning": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnablePartitioning != nil { + enablePartitioning := *typedInput.Properties.EnablePartitioning + queue.EnablePartitioning = &enablePartitioning + } + } + + // Set property "ForwardDeadLetteredMessagesTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardDeadLetteredMessagesTo != nil { + forwardDeadLetteredMessagesTo := *typedInput.Properties.ForwardDeadLetteredMessagesTo + queue.ForwardDeadLetteredMessagesTo = &forwardDeadLetteredMessagesTo + } + } + + // Set property "ForwardTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardTo != nil { + forwardTo := *typedInput.Properties.ForwardTo + queue.ForwardTo = &forwardTo + } + } + + // Set property "LockDuration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.LockDuration != nil { + lockDuration := *typedInput.Properties.LockDuration + queue.LockDuration = &lockDuration + } + } + + // Set property "MaxDeliveryCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxDeliveryCount != nil { + maxDeliveryCount := *typedInput.Properties.MaxDeliveryCount + queue.MaxDeliveryCount = &maxDeliveryCount + } + } + + // Set property "MaxMessageSizeInKilobytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxMessageSizeInKilobytes != nil { + maxMessageSizeInKilobytes := *typedInput.Properties.MaxMessageSizeInKilobytes + queue.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobytes + } + } + + // Set property "MaxSizeInMegabytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxSizeInMegabytes != nil { + maxSizeInMegabytes := *typedInput.Properties.MaxSizeInMegabytes + queue.MaxSizeInMegabytes = &maxSizeInMegabytes + } + } + + // Set property "Owner": + queue.Owner = &genruntime.KnownResourceReference{Name: owner.Name} + + // Set property "RequiresDuplicateDetection": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *typedInput.Properties.RequiresDuplicateDetection + queue.RequiresDuplicateDetection = &requiresDuplicateDetection + } + } + + // Set property "RequiresSession": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresSession != nil { + requiresSession := *typedInput.Properties.RequiresSession + queue.RequiresSession = &requiresSession + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Queue_Spec{} + +// ConvertSpecFrom populates our Namespaces_Queue_Spec from the provided source +func (queue *Namespaces_Queue_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20221001ps.Namespaces_Queue_Spec) + if ok { + // Populate our instance from source + return queue.AssignProperties_From_Namespaces_Queue_Spec(src) + } + + // Convert to an intermediate form + src = &v20221001ps.Namespaces_Queue_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = queue.AssignProperties_From_Namespaces_Queue_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_Queue_Spec +func (queue *Namespaces_Queue_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20221001ps.Namespaces_Queue_Spec) + if ok { + // Populate destination from our instance + return queue.AssignProperties_To_Namespaces_Queue_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20221001ps.Namespaces_Queue_Spec{} + err := queue.AssignProperties_To_Namespaces_Queue_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_Queue_Spec populates our Namespaces_Queue_Spec from the provided source Namespaces_Queue_Spec +func (queue *Namespaces_Queue_Spec) AssignProperties_From_Namespaces_Queue_Spec(source *v20221001ps.Namespaces_Queue_Spec) error { + + // AutoDeleteOnIdle + queue.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // AzureName + queue.AzureName = source.AzureName + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + queue.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + queue.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + queue.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + queue.EnableBatchedOperations = &enableBatchedOperation + } else { + queue.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + queue.EnableExpress = &enableExpress + } else { + queue.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + queue.EnablePartitioning = &enablePartitioning + } else { + queue.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + queue.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + queue.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // LockDuration + queue.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + queue.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + queue.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + queue.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + queue.Owner = &owner + } else { + queue.Owner = nil + } + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + queue.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + queue.RequiresDuplicateDetection = nil + } + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + queue.RequiresSession = &requiresSession + } else { + queue.RequiresSession = nil + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Queue_Spec populates the provided destination Namespaces_Queue_Spec from our Namespaces_Queue_Spec +func (queue *Namespaces_Queue_Spec) AssignProperties_To_Namespaces_Queue_Spec(destination *v20221001ps.Namespaces_Queue_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(queue.AutoDeleteOnIdle) + + // AzureName + destination.AzureName = queue.AzureName + + // DeadLetteringOnMessageExpiration + if queue.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *queue.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(queue.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(queue.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if queue.EnableBatchedOperations != nil { + enableBatchedOperation := *queue.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if queue.EnableExpress != nil { + enableExpress := *queue.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if queue.EnablePartitioning != nil { + enablePartitioning := *queue.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(queue.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(queue.ForwardTo) + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(queue.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(queue.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + destination.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(queue.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(queue.MaxSizeInMegabytes) + + // OriginalVersion + destination.OriginalVersion = queue.OriginalVersion() + + // Owner + if queue.Owner != nil { + owner := queue.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // RequiresDuplicateDetection + if queue.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *queue.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // RequiresSession + if queue.RequiresSession != nil { + requiresSession := *queue.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (queue *Namespaces_Queue_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (queue *Namespaces_Queue_Spec) SetAzureName(azureName string) { queue.AzureName = azureName } + +type Namespaces_Queue_STATUS struct { + // AccessedAt: Last time a message was sent, or the last time there was a receive request to this queue. + AccessedAt *string `json:"accessedAt,omitempty"` + + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the queue is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // CountDetails: Message Count Details. + CountDetails *MessageCountDetails_STATUS `json:"countDetails,omitempty"` + + // CreatedAt: The exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DeadLetteringOnMessageExpiration: A value that indicates whether this queue has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: A value that indicates whether Express Entities are enabled. An express queue holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: A value that indicates whether the queue is to be partitioned across multiple message brokers. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,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"` + + // LockDuration: ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for + // other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: The maximum delivery count. A message is automatically deadlettered after this number of deliveries. + // default value is 10. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the queue. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: The maximum size of the queue in megabytes, which is the size of memory allocated for the queue. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + + // MessageCount: The number of messages in the queue. + MessageCount *int `json:"messageCount,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // RequiresDuplicateDetection: A value indicating if this queue requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // RequiresSession: A value that indicates whether the queue supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` + + // SizeInBytes: The size of the queue, in bytes. + SizeInBytes *int `json:"sizeInBytes,omitempty"` + + // Status: Enumerates the possible values for the status of a messaging entity. + Status *EntityStatus_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_Queue_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Queue_STATUS from the provided source +func (queue *Namespaces_Queue_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20221001ps.Namespaces_Queue_STATUS) + if ok { + // Populate our instance from source + return queue.AssignProperties_From_Namespaces_Queue_STATUS(src) + } + + // Convert to an intermediate form + src = &v20221001ps.Namespaces_Queue_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = queue.AssignProperties_From_Namespaces_Queue_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_Queue_STATUS +func (queue *Namespaces_Queue_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20221001ps.Namespaces_Queue_STATUS) + if ok { + // Populate destination from our instance + return queue.AssignProperties_To_Namespaces_Queue_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20221001ps.Namespaces_Queue_STATUS{} + err := queue.AssignProperties_To_Namespaces_Queue_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_Queue_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (queue *Namespaces_Queue_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Queue_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (queue *Namespaces_Queue_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Queue_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Queue_STATUS_ARM, got %T", armInput) + } + + // Set property "AccessedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AccessedAt != nil { + accessedAt := *typedInput.Properties.AccessedAt + queue.AccessedAt = &accessedAt + } + } + + // Set property "AutoDeleteOnIdle": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *typedInput.Properties.AutoDeleteOnIdle + queue.AutoDeleteOnIdle = &autoDeleteOnIdle + } + } + + // no assignment for property "Conditions" + + // Set property "CountDetails": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CountDetails != nil { + var countDetails1 MessageCountDetails_STATUS + err := countDetails1.PopulateFromARM(owner, *typedInput.Properties.CountDetails) + if err != nil { + return err + } + countDetails := countDetails1 + queue.CountDetails = &countDetails + } + } + + // Set property "CreatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CreatedAt != nil { + createdAt := *typedInput.Properties.CreatedAt + queue.CreatedAt = &createdAt + } + } + + // Set property "DeadLetteringOnMessageExpiration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *typedInput.Properties.DeadLetteringOnMessageExpiration + queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } + } + + // Set property "DefaultMessageTimeToLive": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *typedInput.Properties.DefaultMessageTimeToLive + queue.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + } + + // Set property "DuplicateDetectionHistoryTimeWindow": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *typedInput.Properties.DuplicateDetectionHistoryTimeWindow + queue.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + } + + // Set property "EnableBatchedOperations": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableBatchedOperations != nil { + enableBatchedOperations := *typedInput.Properties.EnableBatchedOperations + queue.EnableBatchedOperations = &enableBatchedOperations + } + } + + // Set property "EnableExpress": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableExpress != nil { + enableExpress := *typedInput.Properties.EnableExpress + queue.EnableExpress = &enableExpress + } + } + + // Set property "EnablePartitioning": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnablePartitioning != nil { + enablePartitioning := *typedInput.Properties.EnablePartitioning + queue.EnablePartitioning = &enablePartitioning + } + } + + // Set property "ForwardDeadLetteredMessagesTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardDeadLetteredMessagesTo != nil { + forwardDeadLetteredMessagesTo := *typedInput.Properties.ForwardDeadLetteredMessagesTo + queue.ForwardDeadLetteredMessagesTo = &forwardDeadLetteredMessagesTo + } + } + + // Set property "ForwardTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardTo != nil { + forwardTo := *typedInput.Properties.ForwardTo + queue.ForwardTo = &forwardTo + } + } + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + queue.Id = &id + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + queue.Location = &location + } + + // Set property "LockDuration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.LockDuration != nil { + lockDuration := *typedInput.Properties.LockDuration + queue.LockDuration = &lockDuration + } + } + + // Set property "MaxDeliveryCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxDeliveryCount != nil { + maxDeliveryCount := *typedInput.Properties.MaxDeliveryCount + queue.MaxDeliveryCount = &maxDeliveryCount + } + } + + // Set property "MaxMessageSizeInKilobytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxMessageSizeInKilobytes != nil { + maxMessageSizeInKilobytes := *typedInput.Properties.MaxMessageSizeInKilobytes + queue.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobytes + } + } + + // Set property "MaxSizeInMegabytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxSizeInMegabytes != nil { + maxSizeInMegabytes := *typedInput.Properties.MaxSizeInMegabytes + queue.MaxSizeInMegabytes = &maxSizeInMegabytes + } + } + + // Set property "MessageCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MessageCount != nil { + messageCount := *typedInput.Properties.MessageCount + queue.MessageCount = &messageCount + } + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + queue.Name = &name + } + + // Set property "RequiresDuplicateDetection": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *typedInput.Properties.RequiresDuplicateDetection + queue.RequiresDuplicateDetection = &requiresDuplicateDetection + } + } + + // Set property "RequiresSession": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresSession != nil { + requiresSession := *typedInput.Properties.RequiresSession + queue.RequiresSession = &requiresSession + } + } + + // Set property "SizeInBytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SizeInBytes != nil { + sizeInBytes := *typedInput.Properties.SizeInBytes + queue.SizeInBytes = &sizeInBytes + } + } + + // Set property "Status": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Status != nil { + status := *typedInput.Properties.Status + queue.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 + queue.SystemData = &systemData + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + queue.Type = &typeVar + } + + // Set property "UpdatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.UpdatedAt != nil { + updatedAt := *typedInput.Properties.UpdatedAt + queue.UpdatedAt = &updatedAt + } + } + + // No error + return nil +} + +// AssignProperties_From_Namespaces_Queue_STATUS populates our Namespaces_Queue_STATUS from the provided source Namespaces_Queue_STATUS +func (queue *Namespaces_Queue_STATUS) AssignProperties_From_Namespaces_Queue_STATUS(source *v20221001ps.Namespaces_Queue_STATUS) error { + + // AccessedAt + queue.AccessedAt = genruntime.ClonePointerToString(source.AccessedAt) + + // AutoDeleteOnIdle + queue.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // Conditions + queue.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CountDetails + if source.CountDetails != nil { + var countDetail MessageCountDetails_STATUS + err := countDetail.AssignProperties_From_MessageCountDetails_STATUS(source.CountDetails) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_MessageCountDetails_STATUS() to populate field CountDetails") + } + queue.CountDetails = &countDetail + } else { + queue.CountDetails = nil + } + + // CreatedAt + queue.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + queue.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + queue.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + queue.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + queue.EnableBatchedOperations = &enableBatchedOperation + } else { + queue.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + queue.EnableExpress = &enableExpress + } else { + queue.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + queue.EnablePartitioning = &enablePartitioning + } else { + queue.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + queue.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + queue.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // Id + queue.Id = genruntime.ClonePointerToString(source.Id) + + // Location + queue.Location = genruntime.ClonePointerToString(source.Location) + + // LockDuration + queue.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + queue.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + queue.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + queue.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // MessageCount + queue.MessageCount = genruntime.ClonePointerToInt(source.MessageCount) + + // Name + queue.Name = genruntime.ClonePointerToString(source.Name) + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + queue.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + queue.RequiresDuplicateDetection = nil + } + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + queue.RequiresSession = &requiresSession + } else { + queue.RequiresSession = nil + } + + // SizeInBytes + queue.SizeInBytes = genruntime.ClonePointerToInt(source.SizeInBytes) + + // Status + if source.Status != nil { + status := EntityStatus_STATUS(*source.Status) + queue.Status = &status + } else { + queue.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") + } + queue.SystemData = &systemDatum + } else { + queue.SystemData = nil + } + + // Type + queue.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + queue.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Queue_STATUS populates the provided destination Namespaces_Queue_STATUS from our Namespaces_Queue_STATUS +func (queue *Namespaces_Queue_STATUS) AssignProperties_To_Namespaces_Queue_STATUS(destination *v20221001ps.Namespaces_Queue_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AccessedAt + destination.AccessedAt = genruntime.ClonePointerToString(queue.AccessedAt) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(queue.AutoDeleteOnIdle) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(queue.Conditions) + + // CountDetails + if queue.CountDetails != nil { + var countDetail v20221001ps.MessageCountDetails_STATUS + err := queue.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_MessageCountDetails_STATUS() to populate field CountDetails") + } + destination.CountDetails = &countDetail + } else { + destination.CountDetails = nil + } + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(queue.CreatedAt) + + // DeadLetteringOnMessageExpiration + if queue.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *queue.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(queue.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(queue.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if queue.EnableBatchedOperations != nil { + enableBatchedOperation := *queue.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if queue.EnableExpress != nil { + enableExpress := *queue.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if queue.EnablePartitioning != nil { + enablePartitioning := *queue.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(queue.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(queue.ForwardTo) + + // Id + destination.Id = genruntime.ClonePointerToString(queue.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(queue.Location) + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(queue.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(queue.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + destination.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(queue.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(queue.MaxSizeInMegabytes) + + // MessageCount + destination.MessageCount = genruntime.ClonePointerToInt(queue.MessageCount) + + // Name + destination.Name = genruntime.ClonePointerToString(queue.Name) + + // RequiresDuplicateDetection + if queue.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *queue.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // RequiresSession + if queue.RequiresSession != nil { + requiresSession := *queue.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // SizeInBytes + destination.SizeInBytes = genruntime.ClonePointerToInt(queue.SizeInBytes) + + // Status + if queue.Status != nil { + status := string(*queue.Status) + destination.Status = &status + } else { + destination.Status = nil + } + + // SystemData + if queue.SystemData != nil { + var systemDatum v20221001ps.SystemData_STATUS + err := queue.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(queue.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(queue.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Entity status. +type EntityStatus_STATUS string + +const ( + EntityStatus_STATUS_Active = EntityStatus_STATUS("Active") + EntityStatus_STATUS_Creating = EntityStatus_STATUS("Creating") + EntityStatus_STATUS_Deleting = EntityStatus_STATUS("Deleting") + EntityStatus_STATUS_Disabled = EntityStatus_STATUS("Disabled") + EntityStatus_STATUS_ReceiveDisabled = EntityStatus_STATUS("ReceiveDisabled") + EntityStatus_STATUS_Renaming = EntityStatus_STATUS("Renaming") + EntityStatus_STATUS_Restoring = EntityStatus_STATUS("Restoring") + EntityStatus_STATUS_SendDisabled = EntityStatus_STATUS("SendDisabled") + EntityStatus_STATUS_Unknown = EntityStatus_STATUS("Unknown") +) + +// Message Count Details. +type MessageCountDetails_STATUS struct { + // ActiveMessageCount: Number of active messages in the queue, topic, or subscription. + ActiveMessageCount *int `json:"activeMessageCount,omitempty"` + + // DeadLetterMessageCount: Number of messages that are dead lettered. + DeadLetterMessageCount *int `json:"deadLetterMessageCount,omitempty"` + + // ScheduledMessageCount: Number of scheduled messages. + ScheduledMessageCount *int `json:"scheduledMessageCount,omitempty"` + + // TransferDeadLetterMessageCount: Number of messages transferred into dead letters. + TransferDeadLetterMessageCount *int `json:"transferDeadLetterMessageCount,omitempty"` + + // TransferMessageCount: Number of messages transferred to another queue, topic, or subscription. + TransferMessageCount *int `json:"transferMessageCount,omitempty"` +} + +var _ genruntime.FromARMConverter = &MessageCountDetails_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (details *MessageCountDetails_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &MessageCountDetails_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (details *MessageCountDetails_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(MessageCountDetails_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected MessageCountDetails_STATUS_ARM, got %T", armInput) + } + + // Set property "ActiveMessageCount": + if typedInput.ActiveMessageCount != nil { + activeMessageCount := *typedInput.ActiveMessageCount + details.ActiveMessageCount = &activeMessageCount + } + + // Set property "DeadLetterMessageCount": + if typedInput.DeadLetterMessageCount != nil { + deadLetterMessageCount := *typedInput.DeadLetterMessageCount + details.DeadLetterMessageCount = &deadLetterMessageCount + } + + // Set property "ScheduledMessageCount": + if typedInput.ScheduledMessageCount != nil { + scheduledMessageCount := *typedInput.ScheduledMessageCount + details.ScheduledMessageCount = &scheduledMessageCount + } + + // Set property "TransferDeadLetterMessageCount": + if typedInput.TransferDeadLetterMessageCount != nil { + transferDeadLetterMessageCount := *typedInput.TransferDeadLetterMessageCount + details.TransferDeadLetterMessageCount = &transferDeadLetterMessageCount + } + + // Set property "TransferMessageCount": + if typedInput.TransferMessageCount != nil { + transferMessageCount := *typedInput.TransferMessageCount + details.TransferMessageCount = &transferMessageCount + } + + // No error + return nil +} + +// AssignProperties_From_MessageCountDetails_STATUS populates our MessageCountDetails_STATUS from the provided source MessageCountDetails_STATUS +func (details *MessageCountDetails_STATUS) AssignProperties_From_MessageCountDetails_STATUS(source *v20221001ps.MessageCountDetails_STATUS) error { + + // ActiveMessageCount + details.ActiveMessageCount = genruntime.ClonePointerToInt(source.ActiveMessageCount) + + // DeadLetterMessageCount + details.DeadLetterMessageCount = genruntime.ClonePointerToInt(source.DeadLetterMessageCount) + + // ScheduledMessageCount + details.ScheduledMessageCount = genruntime.ClonePointerToInt(source.ScheduledMessageCount) + + // TransferDeadLetterMessageCount + details.TransferDeadLetterMessageCount = genruntime.ClonePointerToInt(source.TransferDeadLetterMessageCount) + + // TransferMessageCount + details.TransferMessageCount = genruntime.ClonePointerToInt(source.TransferMessageCount) + + // No error + return nil +} + +// AssignProperties_To_MessageCountDetails_STATUS populates the provided destination MessageCountDetails_STATUS from our MessageCountDetails_STATUS +func (details *MessageCountDetails_STATUS) AssignProperties_To_MessageCountDetails_STATUS(destination *v20221001ps.MessageCountDetails_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ActiveMessageCount + destination.ActiveMessageCount = genruntime.ClonePointerToInt(details.ActiveMessageCount) + + // DeadLetterMessageCount + destination.DeadLetterMessageCount = genruntime.ClonePointerToInt(details.DeadLetterMessageCount) + + // ScheduledMessageCount + destination.ScheduledMessageCount = genruntime.ClonePointerToInt(details.ScheduledMessageCount) + + // TransferDeadLetterMessageCount + destination.TransferDeadLetterMessageCount = genruntime.ClonePointerToInt(details.TransferDeadLetterMessageCount) + + // TransferMessageCount + destination.TransferMessageCount = genruntime.ClonePointerToInt(details.TransferMessageCount) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&NamespacesQueue{}, &NamespacesQueueList{}) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen_test.go new file mode 100644 index 00000000000..03841edc623 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen_test.go @@ -0,0 +1,542 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" + "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_NamespacesQueue_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 NamespacesQueue to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesQueue, NamespacesQueueGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesQueue tests if a specific instance of NamespacesQueue round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesQueue(subject NamespacesQueue) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesQueue + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesQueue + 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_NamespacesQueue_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesQueue to NamespacesQueue via AssignProperties_To_NamespacesQueue & AssignProperties_From_NamespacesQueue returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesQueue, NamespacesQueueGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesQueue tests if a specific instance of NamespacesQueue can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForNamespacesQueue(subject NamespacesQueue) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20221001ps.NamespacesQueue + err := copied.AssignProperties_To_NamespacesQueue(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesQueue + err = actual.AssignProperties_From_NamespacesQueue(&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_NamespacesQueue_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 NamespacesQueue via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesQueue, NamespacesQueueGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesQueue runs a test to see if a specific instance of NamespacesQueue round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesQueue(subject NamespacesQueue) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesQueue + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesQueue instances for property testing - lazily instantiated by NamespacesQueueGenerator() +var namespacesQueueGenerator gopter.Gen + +// NamespacesQueueGenerator returns a generator of NamespacesQueue instances for property testing. +func NamespacesQueueGenerator() gopter.Gen { + if namespacesQueueGenerator != nil { + return namespacesQueueGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesQueue(generators) + namespacesQueueGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue{}), generators) + + return namespacesQueueGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesQueue is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesQueue(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Queue_SpecGenerator() + gens["Status"] = Namespaces_Queue_STATUSGenerator() +} + +func Test_Namespaces_Queue_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Queue_Spec to Namespaces_Queue_Spec via AssignProperties_To_Namespaces_Queue_Spec & AssignProperties_From_Namespaces_Queue_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Queue_Spec, Namespaces_Queue_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Queue_Spec tests if a specific instance of Namespaces_Queue_Spec can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Queue_Spec(subject Namespaces_Queue_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 v20221001ps.Namespaces_Queue_Spec + err := copied.AssignProperties_To_Namespaces_Queue_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Queue_Spec + err = actual.AssignProperties_From_Namespaces_Queue_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_Queue_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_Queue_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Queue_Spec, Namespaces_Queue_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Queue_Spec runs a test to see if a specific instance of Namespaces_Queue_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Queue_Spec(subject Namespaces_Queue_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Queue_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_Queue_Spec instances for property testing - lazily instantiated by +// Namespaces_Queue_SpecGenerator() +var namespaces_Queue_SpecGenerator gopter.Gen + +// Namespaces_Queue_SpecGenerator returns a generator of Namespaces_Queue_Spec instances for property testing. +func Namespaces_Queue_SpecGenerator() gopter.Gen { + if namespaces_Queue_SpecGenerator != nil { + return namespaces_Queue_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec(generators) + namespaces_Queue_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_Spec{}), generators) + + return namespaces_Queue_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) +} + +func Test_Namespaces_Queue_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Queue_STATUS to Namespaces_Queue_STATUS via AssignProperties_To_Namespaces_Queue_STATUS & AssignProperties_From_Namespaces_Queue_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Queue_STATUS, Namespaces_Queue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Queue_STATUS tests if a specific instance of Namespaces_Queue_STATUS can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Queue_STATUS(subject Namespaces_Queue_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 v20221001ps.Namespaces_Queue_STATUS + err := copied.AssignProperties_To_Namespaces_Queue_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Queue_STATUS + err = actual.AssignProperties_From_Namespaces_Queue_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_Queue_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_Queue_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Queue_STATUS, Namespaces_Queue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Queue_STATUS runs a test to see if a specific instance of Namespaces_Queue_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Queue_STATUS(subject Namespaces_Queue_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Queue_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_Queue_STATUS instances for property testing - lazily instantiated by +// Namespaces_Queue_STATUSGenerator() +var namespaces_Queue_STATUSGenerator gopter.Gen + +// Namespaces_Queue_STATUSGenerator returns a generator of Namespaces_Queue_STATUS instances for property testing. +// We first initialize namespaces_Queue_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_Queue_STATUSGenerator() gopter.Gen { + if namespaces_Queue_STATUSGenerator != nil { + return namespaces_Queue_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS(generators) + namespaces_Queue_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS(generators) + namespaces_Queue_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_STATUS{}), generators) + + return namespaces_Queue_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["MessageCount"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) + gens["SizeInBytes"] = gen.PtrOf(gen.Int()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + EntityStatus_STATUS_Active, + EntityStatus_STATUS_Creating, + EntityStatus_STATUS_Deleting, + EntityStatus_STATUS_Disabled, + EntityStatus_STATUS_ReceiveDisabled, + EntityStatus_STATUS_Renaming, + EntityStatus_STATUS_Restoring, + EntityStatus_STATUS_SendDisabled, + EntityStatus_STATUS_Unknown)) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_MessageCountDetails_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from MessageCountDetails_STATUS to MessageCountDetails_STATUS via AssignProperties_To_MessageCountDetails_STATUS & AssignProperties_From_MessageCountDetails_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForMessageCountDetails_STATUS, MessageCountDetails_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForMessageCountDetails_STATUS tests if a specific instance of MessageCountDetails_STATUS can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForMessageCountDetails_STATUS(subject MessageCountDetails_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 v20221001ps.MessageCountDetails_STATUS + err := copied.AssignProperties_To_MessageCountDetails_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual MessageCountDetails_STATUS + err = actual.AssignProperties_From_MessageCountDetails_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_MessageCountDetails_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 MessageCountDetails_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForMessageCountDetails_STATUS, MessageCountDetails_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForMessageCountDetails_STATUS runs a test to see if a specific instance of MessageCountDetails_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForMessageCountDetails_STATUS(subject MessageCountDetails_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual MessageCountDetails_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 MessageCountDetails_STATUS instances for property testing - lazily instantiated by +// MessageCountDetails_STATUSGenerator() +var messageCountDetails_STATUSGenerator gopter.Gen + +// MessageCountDetails_STATUSGenerator returns a generator of MessageCountDetails_STATUS instances for property testing. +func MessageCountDetails_STATUSGenerator() gopter.Gen { + if messageCountDetails_STATUSGenerator != nil { + return messageCountDetails_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS(generators) + messageCountDetails_STATUSGenerator = gen.Struct(reflect.TypeOf(MessageCountDetails_STATUS{}), generators) + + return messageCountDetails_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS(gens map[string]gopter.Gen) { + gens["ActiveMessageCount"] = gen.PtrOf(gen.Int()) + gens["DeadLetterMessageCount"] = gen.PtrOf(gen.Int()) + gens["ScheduledMessageCount"] = gen.PtrOf(gen.Int()) + gens["TransferDeadLetterMessageCount"] = gen.PtrOf(gen.Int()) + gens["TransferMessageCount"] = gen.PtrOf(gen.Int()) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topic_spec_arm_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_topic_spec_arm_types_gen.go new file mode 100644 index 00000000000..051dd2fd50c --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topic_spec_arm_types_gen.go @@ -0,0 +1,70 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_Topic_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: Properties of topic resource. + Properties *SBTopicProperties_ARM `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespaces_Topic_Spec_ARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2022-10-01-preview" +func (topic Namespaces_Topic_Spec_ARM) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetName returns the Name of the resource +func (topic *Namespaces_Topic_Spec_ARM) GetName() string { + return topic.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics" +func (topic *Namespaces_Topic_Spec_ARM) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics" +} + +// The Topic Properties definition. +type SBTopicProperties_ARM struct { + // AutoDeleteOnIdle: ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO8601 timespan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: Value that indicates whether Express Entities are enabled. An express topic holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: Value that indicates whether the topic to be partitioned across multiple message brokers is enabled. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the topic. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + + // RequiresDuplicateDetection: Value indicating if this topic requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // SupportOrdering: Value that indicates whether the topic supports ordering. + SupportOrdering *bool `json:"supportOrdering,omitempty"` +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topic_spec_arm_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_topic_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..4abee65479d --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topic_spec_arm_types_gen_test.go @@ -0,0 +1,163 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +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_Topic_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_Topic_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topic_Spec_ARM, Namespaces_Topic_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topic_Spec_ARM runs a test to see if a specific instance of Namespaces_Topic_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topic_Spec_ARM(subject Namespaces_Topic_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topic_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_Topic_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_Topic_Spec_ARMGenerator() +var namespaces_Topic_Spec_ARMGenerator gopter.Gen + +// Namespaces_Topic_Spec_ARMGenerator returns a generator of Namespaces_Topic_Spec_ARM instances for property testing. +// We first initialize namespaces_Topic_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_Topic_Spec_ARMGenerator() gopter.Gen { + if namespaces_Topic_Spec_ARMGenerator != nil { + return namespaces_Topic_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec_ARM(generators) + namespaces_Topic_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topic_Spec_ARM(generators) + namespaces_Topic_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_Spec_ARM{}), generators) + + return namespaces_Topic_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topic_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topic_Spec_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBTopicProperties_ARMGenerator()) +} + +func Test_SBTopicProperties_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 SBTopicProperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBTopicProperties_ARM, SBTopicProperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBTopicProperties_ARM runs a test to see if a specific instance of SBTopicProperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBTopicProperties_ARM(subject SBTopicProperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBTopicProperties_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 SBTopicProperties_ARM instances for property testing - lazily instantiated by +// SBTopicProperties_ARMGenerator() +var sbTopicProperties_ARMGenerator gopter.Gen + +// SBTopicProperties_ARMGenerator returns a generator of SBTopicProperties_ARM instances for property testing. +func SBTopicProperties_ARMGenerator() gopter.Gen { + if sbTopicProperties_ARMGenerator != nil { + return sbTopicProperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBTopicProperties_ARM(generators) + sbTopicProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBTopicProperties_ARM{}), generators) + + return sbTopicProperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBTopicProperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBTopicProperties_ARM(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["SupportOrdering"] = gen.PtrOf(gen.Bool()) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topic_status_arm_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_topic_status_arm_types_gen.go new file mode 100644 index 00000000000..b2f5cef8739 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topic_status_arm_types_gen.go @@ -0,0 +1,86 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +type Namespaces_Topic_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 of topic resource. + Properties *SBTopicProperties_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"` +} + +// The Topic Properties definition. +type SBTopicProperties_STATUS_ARM struct { + // AccessedAt: Last time the message was sent, or a request was received, for this topic. + AccessedAt *string `json:"accessedAt,omitempty"` + + // AutoDeleteOnIdle: ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // CountDetails: Message count details + CountDetails *MessageCountDetails_STATUS_ARM `json:"countDetails,omitempty"` + + // CreatedAt: Exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO8601 timespan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: Value that indicates whether Express Entities are enabled. An express topic holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: Value that indicates whether the topic to be partitioned across multiple message brokers is enabled. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the topic. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + + // RequiresDuplicateDetection: Value indicating if this topic requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // SizeInBytes: Size of the topic, in bytes. + SizeInBytes *int `json:"sizeInBytes,omitempty"` + + // Status: Enumerates the possible values for the status of a messaging entity. + Status *EntityStatus_STATUS `json:"status,omitempty"` + + // SubscriptionCount: Number of subscriptions. + SubscriptionCount *int `json:"subscriptionCount,omitempty"` + + // SupportOrdering: Value that indicates whether the topic supports ordering. + SupportOrdering *bool `json:"supportOrdering,omitempty"` + + // UpdatedAt: The exact time the message was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topic_status_arm_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_topic_status_arm_types_gen_test.go new file mode 100644 index 00000000000..afebd26a89d --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topic_status_arm_types_gen_test.go @@ -0,0 +1,196 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +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_Topic_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_Topic_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topic_STATUS_ARM, Namespaces_Topic_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topic_STATUS_ARM runs a test to see if a specific instance of Namespaces_Topic_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topic_STATUS_ARM(subject Namespaces_Topic_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topic_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_Topic_STATUS_ARM instances for property testing - lazily instantiated by +// Namespaces_Topic_STATUS_ARMGenerator() +var namespaces_Topic_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Topic_STATUS_ARMGenerator returns a generator of Namespaces_Topic_STATUS_ARM instances for property testing. +// We first initialize namespaces_Topic_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_Topic_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Topic_STATUS_ARMGenerator != nil { + return namespaces_Topic_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS_ARM(generators) + namespaces_Topic_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS_ARM(generators) + namespaces_Topic_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_STATUS_ARM{}), generators) + + return namespaces_Topic_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topic_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_Topic_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBTopicProperties_STATUS_ARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) +} + +func Test_SBTopicProperties_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 SBTopicProperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBTopicProperties_STATUS_ARM, SBTopicProperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBTopicProperties_STATUS_ARM runs a test to see if a specific instance of SBTopicProperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBTopicProperties_STATUS_ARM(subject SBTopicProperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBTopicProperties_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 SBTopicProperties_STATUS_ARM instances for property testing - lazily instantiated by +// SBTopicProperties_STATUS_ARMGenerator() +var sbTopicProperties_STATUS_ARMGenerator gopter.Gen + +// SBTopicProperties_STATUS_ARMGenerator returns a generator of SBTopicProperties_STATUS_ARM instances for property testing. +// We first initialize sbTopicProperties_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 SBTopicProperties_STATUS_ARMGenerator() gopter.Gen { + if sbTopicProperties_STATUS_ARMGenerator != nil { + return sbTopicProperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBTopicProperties_STATUS_ARM(generators) + sbTopicProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBTopicProperties_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBTopicProperties_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForSBTopicProperties_STATUS_ARM(generators) + sbTopicProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBTopicProperties_STATUS_ARM{}), generators) + + return sbTopicProperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBTopicProperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBTopicProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["SizeInBytes"] = gen.PtrOf(gen.Int()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + EntityStatus_STATUS_Active, + EntityStatus_STATUS_Creating, + EntityStatus_STATUS_Deleting, + EntityStatus_STATUS_Disabled, + EntityStatus_STATUS_ReceiveDisabled, + EntityStatus_STATUS_Renaming, + EntityStatus_STATUS_Restoring, + EntityStatus_STATUS_SendDisabled, + EntityStatus_STATUS_Unknown)) + gens["SubscriptionCount"] = gen.PtrOf(gen.Int()) + gens["SupportOrdering"] = gen.PtrOf(gen.Bool()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForSBTopicProperties_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBTopicProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUS_ARMGenerator()) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen.go new file mode 100644 index 00000000000..8bc759340c2 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen.go @@ -0,0 +1,1363 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import ( + "fmt" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" + "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: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/topics.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName} +type NamespacesTopic struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Topic_Spec `json:"spec,omitempty"` + Status Namespaces_Topic_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesTopic{} + +// GetConditions returns the conditions of the resource +func (topic *NamespacesTopic) GetConditions() conditions.Conditions { + return topic.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (topic *NamespacesTopic) SetConditions(conditions conditions.Conditions) { + topic.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesTopic{} + +// ConvertFrom populates our NamespacesTopic from the provided hub NamespacesTopic +func (topic *NamespacesTopic) ConvertFrom(hub conversion.Hub) error { + // intermediate variable for conversion + var source v20221001ps.NamespacesTopic + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") + } + + err = topic.AssignProperties_From_NamespacesTopic(&source) + if err != nil { + return errors.Wrap(err, "converting from source to topic") + } + + return nil +} + +// ConvertTo populates the provided hub NamespacesTopic from our NamespacesTopic +func (topic *NamespacesTopic) ConvertTo(hub conversion.Hub) error { + // intermediate variable for conversion + var destination v20221001ps.NamespacesTopic + err := topic.AssignProperties_To_NamespacesTopic(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from topic") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") + } + + return nil +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20221001preview-namespacestopic,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopics,verbs=create;update,versions=v1api20221001preview,name=default.v1api20221001preview.namespacestopics.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &NamespacesTopic{} + +// Default applies defaults to the NamespacesTopic resource +func (topic *NamespacesTopic) Default() { + topic.defaultImpl() + var temp any = topic + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (topic *NamespacesTopic) defaultAzureName() { + if topic.Spec.AzureName == "" { + topic.Spec.AzureName = topic.Name + } +} + +// defaultImpl applies the code generated defaults to the NamespacesTopic resource +func (topic *NamespacesTopic) defaultImpl() { topic.defaultAzureName() } + +var _ genruntime.KubernetesResource = &NamespacesTopic{} + +// AzureName returns the Azure name of the resource +func (topic *NamespacesTopic) AzureName() string { + return topic.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2022-10-01-preview" +func (topic NamespacesTopic) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (topic *NamespacesTopic) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (topic *NamespacesTopic) GetSpec() genruntime.ConvertibleSpec { + return &topic.Spec +} + +// GetStatus returns the status of this resource +func (topic *NamespacesTopic) GetStatus() genruntime.ConvertibleStatus { + return &topic.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics" +func (topic *NamespacesTopic) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics" +} + +// NewEmptyStatus returns a new empty (blank) status +func (topic *NamespacesTopic) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Topic_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (topic *NamespacesTopic) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: topic.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (topic *NamespacesTopic) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Topic_STATUS); ok { + topic.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Topic_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + topic.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-servicebus-azure-com-v1api20221001preview-namespacestopic,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopics,verbs=create;update,versions=v1api20221001preview,name=validate.v1api20221001preview.namespacestopics.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &NamespacesTopic{} + +// ValidateCreate validates the creation of the resource +func (topic *NamespacesTopic) ValidateCreate() (admission.Warnings, error) { + validations := topic.createValidations() + var temp any = topic + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + return genruntime.ValidateCreate(validations) +} + +// ValidateDelete validates the deletion of the resource +func (topic *NamespacesTopic) ValidateDelete() (admission.Warnings, error) { + validations := topic.deleteValidations() + var temp any = topic + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + return genruntime.ValidateDelete(validations) +} + +// ValidateUpdate validates an update of the resource +func (topic *NamespacesTopic) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { + validations := topic.updateValidations() + var temp any = topic + 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 (topic *NamespacesTopic) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){topic.validateResourceReferences} +} + +// deleteValidations validates the deletion of the resource +func (topic *NamespacesTopic) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (topic *NamespacesTopic) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return topic.validateResourceReferences() + }, + topic.validateWriteOnceProperties} +} + +// validateResourceReferences validates all resource references +func (topic *NamespacesTopic) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&topic.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (topic *NamespacesTopic) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*NamespacesTopic) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, topic) +} + +// AssignProperties_From_NamespacesTopic populates our NamespacesTopic from the provided source NamespacesTopic +func (topic *NamespacesTopic) AssignProperties_From_NamespacesTopic(source *v20221001ps.NamespacesTopic) error { + + // ObjectMeta + topic.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Topic_Spec + err := spec.AssignProperties_From_Namespaces_Topic_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topic_Spec() to populate field Spec") + } + topic.Spec = spec + + // Status + var status Namespaces_Topic_STATUS + err = status.AssignProperties_From_Namespaces_Topic_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topic_STATUS() to populate field Status") + } + topic.Status = status + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopic populates the provided destination NamespacesTopic from our NamespacesTopic +func (topic *NamespacesTopic) AssignProperties_To_NamespacesTopic(destination *v20221001ps.NamespacesTopic) error { + + // ObjectMeta + destination.ObjectMeta = *topic.ObjectMeta.DeepCopy() + + // Spec + var spec v20221001ps.Namespaces_Topic_Spec + err := topic.Spec.AssignProperties_To_Namespaces_Topic_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topic_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20221001ps.Namespaces_Topic_STATUS + err = topic.Status.AssignProperties_To_Namespaces_Topic_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topic_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 (topic *NamespacesTopic) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: topic.Spec.OriginalVersion(), + Kind: "NamespacesTopic", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/topics.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName} +type NamespacesTopicList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesTopic `json:"items"` +} + +type Namespaces_Topic_Spec struct { + // AutoDeleteOnIdle: ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // +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"` + + // DefaultMessageTimeToLive: ISO 8601 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO8601 timespan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: Value that indicates whether Express Entities are enabled. An express topic holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: Value that indicates whether the topic to be partitioned across multiple message brokers is enabled. + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the topic. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,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 servicebus.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"Namespace"` + + // RequiresDuplicateDetection: Value indicating if this topic requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // SupportOrdering: Value that indicates whether the topic supports ordering. + SupportOrdering *bool `json:"supportOrdering,omitempty"` +} + +var _ genruntime.ARMTransformer = &Namespaces_Topic_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (topic *Namespaces_Topic_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if topic == nil { + return nil, nil + } + result := &Namespaces_Topic_Spec_ARM{} + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if topic.AutoDeleteOnIdle != nil || + topic.DefaultMessageTimeToLive != nil || + topic.DuplicateDetectionHistoryTimeWindow != nil || + topic.EnableBatchedOperations != nil || + topic.EnableExpress != nil || + topic.EnablePartitioning != nil || + topic.MaxMessageSizeInKilobytes != nil || + topic.MaxSizeInMegabytes != nil || + topic.RequiresDuplicateDetection != nil || + topic.SupportOrdering != nil { + result.Properties = &SBTopicProperties_ARM{} + } + if topic.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *topic.AutoDeleteOnIdle + result.Properties.AutoDeleteOnIdle = &autoDeleteOnIdle + } + if topic.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *topic.DefaultMessageTimeToLive + result.Properties.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + if topic.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *topic.DuplicateDetectionHistoryTimeWindow + result.Properties.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + if topic.EnableBatchedOperations != nil { + enableBatchedOperations := *topic.EnableBatchedOperations + result.Properties.EnableBatchedOperations = &enableBatchedOperations + } + if topic.EnableExpress != nil { + enableExpress := *topic.EnableExpress + result.Properties.EnableExpress = &enableExpress + } + if topic.EnablePartitioning != nil { + enablePartitioning := *topic.EnablePartitioning + result.Properties.EnablePartitioning = &enablePartitioning + } + if topic.MaxMessageSizeInKilobytes != nil { + maxMessageSizeInKilobytes := *topic.MaxMessageSizeInKilobytes + result.Properties.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobytes + } + if topic.MaxSizeInMegabytes != nil { + maxSizeInMegabytes := *topic.MaxSizeInMegabytes + result.Properties.MaxSizeInMegabytes = &maxSizeInMegabytes + } + if topic.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *topic.RequiresDuplicateDetection + result.Properties.RequiresDuplicateDetection = &requiresDuplicateDetection + } + if topic.SupportOrdering != nil { + supportOrdering := *topic.SupportOrdering + result.Properties.SupportOrdering = &supportOrdering + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (topic *Namespaces_Topic_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Topic_Spec_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (topic *Namespaces_Topic_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Topic_Spec_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Topic_Spec_ARM, got %T", armInput) + } + + // Set property "AutoDeleteOnIdle": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *typedInput.Properties.AutoDeleteOnIdle + topic.AutoDeleteOnIdle = &autoDeleteOnIdle + } + } + + // Set property "AzureName": + topic.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // Set property "DefaultMessageTimeToLive": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *typedInput.Properties.DefaultMessageTimeToLive + topic.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + } + + // Set property "DuplicateDetectionHistoryTimeWindow": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *typedInput.Properties.DuplicateDetectionHistoryTimeWindow + topic.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + } + + // Set property "EnableBatchedOperations": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableBatchedOperations != nil { + enableBatchedOperations := *typedInput.Properties.EnableBatchedOperations + topic.EnableBatchedOperations = &enableBatchedOperations + } + } + + // Set property "EnableExpress": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableExpress != nil { + enableExpress := *typedInput.Properties.EnableExpress + topic.EnableExpress = &enableExpress + } + } + + // Set property "EnablePartitioning": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnablePartitioning != nil { + enablePartitioning := *typedInput.Properties.EnablePartitioning + topic.EnablePartitioning = &enablePartitioning + } + } + + // Set property "MaxMessageSizeInKilobytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxMessageSizeInKilobytes != nil { + maxMessageSizeInKilobytes := *typedInput.Properties.MaxMessageSizeInKilobytes + topic.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobytes + } + } + + // Set property "MaxSizeInMegabytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxSizeInMegabytes != nil { + maxSizeInMegabytes := *typedInput.Properties.MaxSizeInMegabytes + topic.MaxSizeInMegabytes = &maxSizeInMegabytes + } + } + + // Set property "Owner": + topic.Owner = &genruntime.KnownResourceReference{Name: owner.Name} + + // Set property "RequiresDuplicateDetection": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *typedInput.Properties.RequiresDuplicateDetection + topic.RequiresDuplicateDetection = &requiresDuplicateDetection + } + } + + // Set property "SupportOrdering": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SupportOrdering != nil { + supportOrdering := *typedInput.Properties.SupportOrdering + topic.SupportOrdering = &supportOrdering + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Topic_Spec{} + +// ConvertSpecFrom populates our Namespaces_Topic_Spec from the provided source +func (topic *Namespaces_Topic_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20221001ps.Namespaces_Topic_Spec) + if ok { + // Populate our instance from source + return topic.AssignProperties_From_Namespaces_Topic_Spec(src) + } + + // Convert to an intermediate form + src = &v20221001ps.Namespaces_Topic_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = topic.AssignProperties_From_Namespaces_Topic_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_Topic_Spec +func (topic *Namespaces_Topic_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20221001ps.Namespaces_Topic_Spec) + if ok { + // Populate destination from our instance + return topic.AssignProperties_To_Namespaces_Topic_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20221001ps.Namespaces_Topic_Spec{} + err := topic.AssignProperties_To_Namespaces_Topic_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_Topic_Spec populates our Namespaces_Topic_Spec from the provided source Namespaces_Topic_Spec +func (topic *Namespaces_Topic_Spec) AssignProperties_From_Namespaces_Topic_Spec(source *v20221001ps.Namespaces_Topic_Spec) error { + + // AutoDeleteOnIdle + topic.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // AzureName + topic.AzureName = source.AzureName + + // DefaultMessageTimeToLive + topic.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + topic.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + topic.EnableBatchedOperations = &enableBatchedOperation + } else { + topic.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + topic.EnableExpress = &enableExpress + } else { + topic.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + topic.EnablePartitioning = &enablePartitioning + } else { + topic.EnablePartitioning = nil + } + + // MaxMessageSizeInKilobytes + topic.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + topic.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + topic.Owner = &owner + } else { + topic.Owner = nil + } + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + topic.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + topic.RequiresDuplicateDetection = nil + } + + // SupportOrdering + if source.SupportOrdering != nil { + supportOrdering := *source.SupportOrdering + topic.SupportOrdering = &supportOrdering + } else { + topic.SupportOrdering = nil + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topic_Spec populates the provided destination Namespaces_Topic_Spec from our Namespaces_Topic_Spec +func (topic *Namespaces_Topic_Spec) AssignProperties_To_Namespaces_Topic_Spec(destination *v20221001ps.Namespaces_Topic_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(topic.AutoDeleteOnIdle) + + // AzureName + destination.AzureName = topic.AzureName + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(topic.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(topic.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if topic.EnableBatchedOperations != nil { + enableBatchedOperation := *topic.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if topic.EnableExpress != nil { + enableExpress := *topic.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if topic.EnablePartitioning != nil { + enablePartitioning := *topic.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // MaxMessageSizeInKilobytes + destination.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(topic.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(topic.MaxSizeInMegabytes) + + // OriginalVersion + destination.OriginalVersion = topic.OriginalVersion() + + // Owner + if topic.Owner != nil { + owner := topic.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // RequiresDuplicateDetection + if topic.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *topic.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // SupportOrdering + if topic.SupportOrdering != nil { + supportOrdering := *topic.SupportOrdering + destination.SupportOrdering = &supportOrdering + } else { + destination.SupportOrdering = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (topic *Namespaces_Topic_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (topic *Namespaces_Topic_Spec) SetAzureName(azureName string) { topic.AzureName = azureName } + +type Namespaces_Topic_STATUS struct { + // AccessedAt: Last time the message was sent, or a request was received, for this topic. + AccessedAt *string `json:"accessedAt,omitempty"` + + // AutoDeleteOnIdle: ISO 8601 timespan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // CountDetails: Message count details + CountDetails *MessageCountDetails_STATUS `json:"countDetails,omitempty"` + + // CreatedAt: Exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DefaultMessageTimeToLive: ISO 8601 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO8601 timespan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // EnableExpress: Value that indicates whether Express Entities are enabled. An express topic holds a message in memory + // temporarily before writing it to persistent storage. + EnableExpress *bool `json:"enableExpress,omitempty"` + + // EnablePartitioning: Value that indicates whether the topic to be partitioned across multiple message brokers is enabled. + EnablePartitioning *bool `json:"enablePartitioning,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"` + + // MaxMessageSizeInKilobytes: Maximum size (in KB) of the message payload that can be accepted by the topic. This property + // is only used in Premium today and default is 1024. + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + + // MaxSizeInMegabytes: Maximum size of the topic in megabytes, which is the size of the memory allocated for the topic. + // Default is 1024. + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // RequiresDuplicateDetection: Value indicating if this topic requires duplicate detection. + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + + // SizeInBytes: Size of the topic, in bytes. + SizeInBytes *int `json:"sizeInBytes,omitempty"` + + // Status: Enumerates the possible values for the status of a messaging entity. + Status *EntityStatus_STATUS `json:"status,omitempty"` + + // SubscriptionCount: Number of subscriptions. + SubscriptionCount *int `json:"subscriptionCount,omitempty"` + + // SupportOrdering: Value that indicates whether the topic supports ordering. + SupportOrdering *bool `json:"supportOrdering,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_Topic_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Topic_STATUS from the provided source +func (topic *Namespaces_Topic_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20221001ps.Namespaces_Topic_STATUS) + if ok { + // Populate our instance from source + return topic.AssignProperties_From_Namespaces_Topic_STATUS(src) + } + + // Convert to an intermediate form + src = &v20221001ps.Namespaces_Topic_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = topic.AssignProperties_From_Namespaces_Topic_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_Topic_STATUS +func (topic *Namespaces_Topic_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20221001ps.Namespaces_Topic_STATUS) + if ok { + // Populate destination from our instance + return topic.AssignProperties_To_Namespaces_Topic_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20221001ps.Namespaces_Topic_STATUS{} + err := topic.AssignProperties_To_Namespaces_Topic_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_Topic_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (topic *Namespaces_Topic_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Topic_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (topic *Namespaces_Topic_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Topic_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Topic_STATUS_ARM, got %T", armInput) + } + + // Set property "AccessedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AccessedAt != nil { + accessedAt := *typedInput.Properties.AccessedAt + topic.AccessedAt = &accessedAt + } + } + + // Set property "AutoDeleteOnIdle": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *typedInput.Properties.AutoDeleteOnIdle + topic.AutoDeleteOnIdle = &autoDeleteOnIdle + } + } + + // no assignment for property "Conditions" + + // Set property "CountDetails": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CountDetails != nil { + var countDetails1 MessageCountDetails_STATUS + err := countDetails1.PopulateFromARM(owner, *typedInput.Properties.CountDetails) + if err != nil { + return err + } + countDetails := countDetails1 + topic.CountDetails = &countDetails + } + } + + // Set property "CreatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CreatedAt != nil { + createdAt := *typedInput.Properties.CreatedAt + topic.CreatedAt = &createdAt + } + } + + // Set property "DefaultMessageTimeToLive": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *typedInput.Properties.DefaultMessageTimeToLive + topic.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + } + + // Set property "DuplicateDetectionHistoryTimeWindow": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *typedInput.Properties.DuplicateDetectionHistoryTimeWindow + topic.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + } + + // Set property "EnableBatchedOperations": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableBatchedOperations != nil { + enableBatchedOperations := *typedInput.Properties.EnableBatchedOperations + topic.EnableBatchedOperations = &enableBatchedOperations + } + } + + // Set property "EnableExpress": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableExpress != nil { + enableExpress := *typedInput.Properties.EnableExpress + topic.EnableExpress = &enableExpress + } + } + + // Set property "EnablePartitioning": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnablePartitioning != nil { + enablePartitioning := *typedInput.Properties.EnablePartitioning + topic.EnablePartitioning = &enablePartitioning + } + } + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + topic.Id = &id + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + topic.Location = &location + } + + // Set property "MaxMessageSizeInKilobytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxMessageSizeInKilobytes != nil { + maxMessageSizeInKilobytes := *typedInput.Properties.MaxMessageSizeInKilobytes + topic.MaxMessageSizeInKilobytes = &maxMessageSizeInKilobytes + } + } + + // Set property "MaxSizeInMegabytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxSizeInMegabytes != nil { + maxSizeInMegabytes := *typedInput.Properties.MaxSizeInMegabytes + topic.MaxSizeInMegabytes = &maxSizeInMegabytes + } + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + topic.Name = &name + } + + // Set property "RequiresDuplicateDetection": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *typedInput.Properties.RequiresDuplicateDetection + topic.RequiresDuplicateDetection = &requiresDuplicateDetection + } + } + + // Set property "SizeInBytes": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SizeInBytes != nil { + sizeInBytes := *typedInput.Properties.SizeInBytes + topic.SizeInBytes = &sizeInBytes + } + } + + // Set property "Status": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Status != nil { + status := *typedInput.Properties.Status + topic.Status = &status + } + } + + // Set property "SubscriptionCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SubscriptionCount != nil { + subscriptionCount := *typedInput.Properties.SubscriptionCount + topic.SubscriptionCount = &subscriptionCount + } + } + + // Set property "SupportOrdering": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SupportOrdering != nil { + supportOrdering := *typedInput.Properties.SupportOrdering + topic.SupportOrdering = &supportOrdering + } + } + + // Set property "SystemData": + if typedInput.SystemData != nil { + var systemData1 SystemData_STATUS + err := systemData1.PopulateFromARM(owner, *typedInput.SystemData) + if err != nil { + return err + } + systemData := systemData1 + topic.SystemData = &systemData + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + topic.Type = &typeVar + } + + // Set property "UpdatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.UpdatedAt != nil { + updatedAt := *typedInput.Properties.UpdatedAt + topic.UpdatedAt = &updatedAt + } + } + + // No error + return nil +} + +// AssignProperties_From_Namespaces_Topic_STATUS populates our Namespaces_Topic_STATUS from the provided source Namespaces_Topic_STATUS +func (topic *Namespaces_Topic_STATUS) AssignProperties_From_Namespaces_Topic_STATUS(source *v20221001ps.Namespaces_Topic_STATUS) error { + + // AccessedAt + topic.AccessedAt = genruntime.ClonePointerToString(source.AccessedAt) + + // AutoDeleteOnIdle + topic.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // Conditions + topic.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CountDetails + if source.CountDetails != nil { + var countDetail MessageCountDetails_STATUS + err := countDetail.AssignProperties_From_MessageCountDetails_STATUS(source.CountDetails) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_MessageCountDetails_STATUS() to populate field CountDetails") + } + topic.CountDetails = &countDetail + } else { + topic.CountDetails = nil + } + + // CreatedAt + topic.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DefaultMessageTimeToLive + topic.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + topic.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + topic.EnableBatchedOperations = &enableBatchedOperation + } else { + topic.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + topic.EnableExpress = &enableExpress + } else { + topic.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + topic.EnablePartitioning = &enablePartitioning + } else { + topic.EnablePartitioning = nil + } + + // Id + topic.Id = genruntime.ClonePointerToString(source.Id) + + // Location + topic.Location = genruntime.ClonePointerToString(source.Location) + + // MaxMessageSizeInKilobytes + topic.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + topic.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // Name + topic.Name = genruntime.ClonePointerToString(source.Name) + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + topic.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + topic.RequiresDuplicateDetection = nil + } + + // SizeInBytes + topic.SizeInBytes = genruntime.ClonePointerToInt(source.SizeInBytes) + + // Status + if source.Status != nil { + status := EntityStatus_STATUS(*source.Status) + topic.Status = &status + } else { + topic.Status = nil + } + + // SubscriptionCount + topic.SubscriptionCount = genruntime.ClonePointerToInt(source.SubscriptionCount) + + // SupportOrdering + if source.SupportOrdering != nil { + supportOrdering := *source.SupportOrdering + topic.SupportOrdering = &supportOrdering + } else { + topic.SupportOrdering = 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") + } + topic.SystemData = &systemDatum + } else { + topic.SystemData = nil + } + + // Type + topic.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + topic.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topic_STATUS populates the provided destination Namespaces_Topic_STATUS from our Namespaces_Topic_STATUS +func (topic *Namespaces_Topic_STATUS) AssignProperties_To_Namespaces_Topic_STATUS(destination *v20221001ps.Namespaces_Topic_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AccessedAt + destination.AccessedAt = genruntime.ClonePointerToString(topic.AccessedAt) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(topic.AutoDeleteOnIdle) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(topic.Conditions) + + // CountDetails + if topic.CountDetails != nil { + var countDetail v20221001ps.MessageCountDetails_STATUS + err := topic.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_MessageCountDetails_STATUS() to populate field CountDetails") + } + destination.CountDetails = &countDetail + } else { + destination.CountDetails = nil + } + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(topic.CreatedAt) + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(topic.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(topic.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if topic.EnableBatchedOperations != nil { + enableBatchedOperation := *topic.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if topic.EnableExpress != nil { + enableExpress := *topic.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if topic.EnablePartitioning != nil { + enablePartitioning := *topic.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // Id + destination.Id = genruntime.ClonePointerToString(topic.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(topic.Location) + + // MaxMessageSizeInKilobytes + destination.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(topic.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(topic.MaxSizeInMegabytes) + + // Name + destination.Name = genruntime.ClonePointerToString(topic.Name) + + // RequiresDuplicateDetection + if topic.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *topic.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // SizeInBytes + destination.SizeInBytes = genruntime.ClonePointerToInt(topic.SizeInBytes) + + // Status + if topic.Status != nil { + status := string(*topic.Status) + destination.Status = &status + } else { + destination.Status = nil + } + + // SubscriptionCount + destination.SubscriptionCount = genruntime.ClonePointerToInt(topic.SubscriptionCount) + + // SupportOrdering + if topic.SupportOrdering != nil { + supportOrdering := *topic.SupportOrdering + destination.SupportOrdering = &supportOrdering + } else { + destination.SupportOrdering = nil + } + + // SystemData + if topic.SystemData != nil { + var systemDatum v20221001ps.SystemData_STATUS + err := topic.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(topic.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(topic.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&NamespacesTopic{}, &NamespacesTopicList{}) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen_test.go new file mode 100644 index 00000000000..faf5f05703a --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen_test.go @@ -0,0 +1,425 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" + "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_NamespacesTopic_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 NamespacesTopic to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesTopic, NamespacesTopicGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesTopic tests if a specific instance of NamespacesTopic round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesTopic(subject NamespacesTopic) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesTopic + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesTopic + 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_NamespacesTopic_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopic to NamespacesTopic via AssignProperties_To_NamespacesTopic & AssignProperties_From_NamespacesTopic returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopic, NamespacesTopicGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopic tests if a specific instance of NamespacesTopic can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopic(subject NamespacesTopic) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20221001ps.NamespacesTopic + err := copied.AssignProperties_To_NamespacesTopic(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopic + err = actual.AssignProperties_From_NamespacesTopic(&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_NamespacesTopic_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 NamespacesTopic via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopic, NamespacesTopicGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopic runs a test to see if a specific instance of NamespacesTopic round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopic(subject NamespacesTopic) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopic + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopic instances for property testing - lazily instantiated by NamespacesTopicGenerator() +var namespacesTopicGenerator gopter.Gen + +// NamespacesTopicGenerator returns a generator of NamespacesTopic instances for property testing. +func NamespacesTopicGenerator() gopter.Gen { + if namespacesTopicGenerator != nil { + return namespacesTopicGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesTopic(generators) + namespacesTopicGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic{}), generators) + + return namespacesTopicGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesTopic is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopic(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Topic_SpecGenerator() + gens["Status"] = Namespaces_Topic_STATUSGenerator() +} + +func Test_Namespaces_Topic_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topic_Spec to Namespaces_Topic_Spec via AssignProperties_To_Namespaces_Topic_Spec & AssignProperties_From_Namespaces_Topic_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topic_Spec, Namespaces_Topic_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topic_Spec tests if a specific instance of Namespaces_Topic_Spec can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topic_Spec(subject Namespaces_Topic_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 v20221001ps.Namespaces_Topic_Spec + err := copied.AssignProperties_To_Namespaces_Topic_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topic_Spec + err = actual.AssignProperties_From_Namespaces_Topic_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_Topic_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_Topic_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topic_Spec, Namespaces_Topic_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topic_Spec runs a test to see if a specific instance of Namespaces_Topic_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topic_Spec(subject Namespaces_Topic_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topic_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_Topic_Spec instances for property testing - lazily instantiated by +// Namespaces_Topic_SpecGenerator() +var namespaces_Topic_SpecGenerator gopter.Gen + +// Namespaces_Topic_SpecGenerator returns a generator of Namespaces_Topic_Spec instances for property testing. +func Namespaces_Topic_SpecGenerator() gopter.Gen { + if namespaces_Topic_SpecGenerator != nil { + return namespaces_Topic_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec(generators) + namespaces_Topic_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_Spec{}), generators) + + return namespaces_Topic_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["SupportOrdering"] = gen.PtrOf(gen.Bool()) +} + +func Test_Namespaces_Topic_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topic_STATUS to Namespaces_Topic_STATUS via AssignProperties_To_Namespaces_Topic_STATUS & AssignProperties_From_Namespaces_Topic_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topic_STATUS, Namespaces_Topic_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topic_STATUS tests if a specific instance of Namespaces_Topic_STATUS can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topic_STATUS(subject Namespaces_Topic_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 v20221001ps.Namespaces_Topic_STATUS + err := copied.AssignProperties_To_Namespaces_Topic_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topic_STATUS + err = actual.AssignProperties_From_Namespaces_Topic_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_Topic_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_Topic_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topic_STATUS, Namespaces_Topic_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topic_STATUS runs a test to see if a specific instance of Namespaces_Topic_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topic_STATUS(subject Namespaces_Topic_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topic_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_Topic_STATUS instances for property testing - lazily instantiated by +// Namespaces_Topic_STATUSGenerator() +var namespaces_Topic_STATUSGenerator gopter.Gen + +// Namespaces_Topic_STATUSGenerator returns a generator of Namespaces_Topic_STATUS instances for property testing. +// We first initialize namespaces_Topic_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_Topic_STATUSGenerator() gopter.Gen { + if namespaces_Topic_STATUSGenerator != nil { + return namespaces_Topic_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS(generators) + namespaces_Topic_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS(generators) + namespaces_Topic_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_STATUS{}), generators) + + return namespaces_Topic_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["SizeInBytes"] = gen.PtrOf(gen.Int()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + EntityStatus_STATUS_Active, + EntityStatus_STATUS_Creating, + EntityStatus_STATUS_Deleting, + EntityStatus_STATUS_Disabled, + EntityStatus_STATUS_ReceiveDisabled, + EntityStatus_STATUS_Renaming, + EntityStatus_STATUS_Restoring, + EntityStatus_STATUS_SendDisabled, + EntityStatus_STATUS_Unknown)) + gens["SubscriptionCount"] = gen.PtrOf(gen.Int()) + gens["SupportOrdering"] = gen.PtrOf(gen.Bool()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_spec_arm_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_spec_arm_types_gen.go new file mode 100644 index 00000000000..11ffa67d19b --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_spec_arm_types_gen.go @@ -0,0 +1,90 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_Topics_Subscription_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: Properties of subscriptions resource. + Properties *SBSubscriptionProperties_ARM `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespaces_Topics_Subscription_Spec_ARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2022-10-01-preview" +func (subscription Namespaces_Topics_Subscription_Spec_ARM) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetName returns the Name of the resource +func (subscription *Namespaces_Topics_Subscription_Spec_ARM) GetName() string { + return subscription.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions" +func (subscription *Namespaces_Topics_Subscription_Spec_ARM) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions" +} + +// Description of Subscription Resource. +type SBSubscriptionProperties_ARM struct { + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // ClientAffineProperties: Properties specific to client affine subscriptions. + ClientAffineProperties *SBClientAffineProperties_ARM `json:"clientAffineProperties,omitempty"` + + // DeadLetteringOnFilterEvaluationExceptions: Value that indicates whether a subscription has dead letter support on filter + // evaluation exceptions. + DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"` + + // DeadLetteringOnMessageExpiration: Value that indicates whether a subscription has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8061 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // IsClientAffine: Value that indicates whether the subscription has an affinity to the client id. + IsClientAffine *bool `json:"isClientAffine,omitempty"` + + // LockDuration: ISO 8061 lock duration timespan for the subscription. The default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: Number of maximum deliveries. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // RequiresSession: Value indicating if a subscription supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` +} + +// Properties specific to client affine subscriptions. +type SBClientAffineProperties_ARM struct { + // ClientId: Indicates the Client ID of the application that created the client-affine subscription. + ClientId *string `json:"clientId,omitempty"` + + // IsDurable: For client-affine subscriptions, this value indicates whether the subscription is durable or not. + IsDurable *bool `json:"isDurable,omitempty"` + + // IsShared: For client-affine subscriptions, this value indicates whether the subscription is shared or not. + IsShared *bool `json:"isShared,omitempty"` +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_spec_arm_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..7b14dd845b3 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_spec_arm_types_gen_test.go @@ -0,0 +1,242 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +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_Topics_Subscription_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_Topics_Subscription_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec_ARM, Namespaces_Topics_Subscription_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec_ARM runs a test to see if a specific instance of Namespaces_Topics_Subscription_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec_ARM(subject Namespaces_Topics_Subscription_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscription_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_Topics_Subscription_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscription_Spec_ARMGenerator() +var namespaces_Topics_Subscription_Spec_ARMGenerator gopter.Gen + +// Namespaces_Topics_Subscription_Spec_ARMGenerator returns a generator of Namespaces_Topics_Subscription_Spec_ARM instances for property testing. +// We first initialize namespaces_Topics_Subscription_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_Topics_Subscription_Spec_ARMGenerator() gopter.Gen { + if namespaces_Topics_Subscription_Spec_ARMGenerator != nil { + return namespaces_Topics_Subscription_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM(generators) + namespaces_Topics_Subscription_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM(generators) + namespaces_Topics_Subscription_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_Spec_ARM{}), generators) + + return namespaces_Topics_Subscription_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBSubscriptionProperties_ARMGenerator()) +} + +func Test_SBSubscriptionProperties_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 SBSubscriptionProperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSubscriptionProperties_ARM, SBSubscriptionProperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSubscriptionProperties_ARM runs a test to see if a specific instance of SBSubscriptionProperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSubscriptionProperties_ARM(subject SBSubscriptionProperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSubscriptionProperties_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 SBSubscriptionProperties_ARM instances for property testing - lazily instantiated by +// SBSubscriptionProperties_ARMGenerator() +var sbSubscriptionProperties_ARMGenerator gopter.Gen + +// SBSubscriptionProperties_ARMGenerator returns a generator of SBSubscriptionProperties_ARM instances for property testing. +// We first initialize sbSubscriptionProperties_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 SBSubscriptionProperties_ARMGenerator() gopter.Gen { + if sbSubscriptionProperties_ARMGenerator != nil { + return sbSubscriptionProperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSubscriptionProperties_ARM(generators) + sbSubscriptionProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBSubscriptionProperties_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSubscriptionProperties_ARM(generators) + AddRelatedPropertyGeneratorsForSBSubscriptionProperties_ARM(generators) + sbSubscriptionProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBSubscriptionProperties_ARM{}), generators) + + return sbSubscriptionProperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBSubscriptionProperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSubscriptionProperties_ARM(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnFilterEvaluationExceptions"] = gen.PtrOf(gen.Bool()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["IsClientAffine"] = gen.PtrOf(gen.Bool()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForSBSubscriptionProperties_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBSubscriptionProperties_ARM(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffineProperties_ARMGenerator()) +} + +func Test_SBClientAffineProperties_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 SBClientAffineProperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBClientAffineProperties_ARM, SBClientAffineProperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBClientAffineProperties_ARM runs a test to see if a specific instance of SBClientAffineProperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBClientAffineProperties_ARM(subject SBClientAffineProperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBClientAffineProperties_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 SBClientAffineProperties_ARM instances for property testing - lazily instantiated by +// SBClientAffineProperties_ARMGenerator() +var sbClientAffineProperties_ARMGenerator gopter.Gen + +// SBClientAffineProperties_ARMGenerator returns a generator of SBClientAffineProperties_ARM instances for property testing. +func SBClientAffineProperties_ARMGenerator() gopter.Gen { + if sbClientAffineProperties_ARMGenerator != nil { + return sbClientAffineProperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBClientAffineProperties_ARM(generators) + sbClientAffineProperties_ARMGenerator = gen.Struct(reflect.TypeOf(SBClientAffineProperties_ARM{}), generators) + + return sbClientAffineProperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBClientAffineProperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBClientAffineProperties_ARM(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["IsDurable"] = gen.PtrOf(gen.Bool()) + gens["IsShared"] = gen.PtrOf(gen.Bool()) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_status_arm_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_status_arm_types_gen.go new file mode 100644 index 00000000000..1ec2dac0eea --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_status_arm_types_gen.go @@ -0,0 +1,103 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +type Namespaces_Topics_Subscription_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 of subscriptions resource. + Properties *SBSubscriptionProperties_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"` +} + +// Description of Subscription Resource. +type SBSubscriptionProperties_STATUS_ARM struct { + // AccessedAt: Last time there was a receive request to this subscription. + AccessedAt *string `json:"accessedAt,omitempty"` + + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // ClientAffineProperties: Properties specific to client affine subscriptions. + ClientAffineProperties *SBClientAffineProperties_STATUS_ARM `json:"clientAffineProperties,omitempty"` + + // CountDetails: Message count details + CountDetails *MessageCountDetails_STATUS_ARM `json:"countDetails,omitempty"` + + // CreatedAt: Exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DeadLetteringOnFilterEvaluationExceptions: Value that indicates whether a subscription has dead letter support on filter + // evaluation exceptions. + DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"` + + // DeadLetteringOnMessageExpiration: Value that indicates whether a subscription has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8061 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // IsClientAffine: Value that indicates whether the subscription has an affinity to the client id. + IsClientAffine *bool `json:"isClientAffine,omitempty"` + + // LockDuration: ISO 8061 lock duration timespan for the subscription. The default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: Number of maximum deliveries. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // MessageCount: Number of messages. + MessageCount *int `json:"messageCount,omitempty"` + + // RequiresSession: Value indicating if a subscription supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` + + // Status: Enumerates the possible values for the status of a messaging entity. + Status *EntityStatus_STATUS `json:"status,omitempty"` + + // UpdatedAt: The exact time the message was updated. + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +// Properties specific to client affine subscriptions. +type SBClientAffineProperties_STATUS_ARM struct { + // ClientId: Indicates the Client ID of the application that created the client-affine subscription. + ClientId *string `json:"clientId,omitempty"` + + // IsDurable: For client-affine subscriptions, this value indicates whether the subscription is durable or not. + IsDurable *bool `json:"isDurable,omitempty"` + + // IsShared: For client-affine subscriptions, this value indicates whether the subscription is shared or not. + IsShared *bool `json:"isShared,omitempty"` +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_status_arm_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_status_arm_types_gen_test.go new file mode 100644 index 00000000000..a149eff610c --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_status_arm_types_gen_test.go @@ -0,0 +1,261 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +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_Topics_Subscription_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_Topics_Subscription_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS_ARM, Namespaces_Topics_Subscription_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS_ARM runs a test to see if a specific instance of Namespaces_Topics_Subscription_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS_ARM(subject Namespaces_Topics_Subscription_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS_ARM instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscription_STATUS_ARMGenerator() +var namespaces_Topics_Subscription_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Topics_Subscription_STATUS_ARMGenerator returns a generator of Namespaces_Topics_Subscription_STATUS_ARM instances for property testing. +// We first initialize namespaces_Topics_Subscription_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_Topics_Subscription_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Topics_Subscription_STATUS_ARMGenerator != nil { + return namespaces_Topics_Subscription_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS_ARM(generators) + namespaces_Topics_Subscription_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS_ARM(generators) + namespaces_Topics_Subscription_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_STATUS_ARM{}), generators) + + return namespaces_Topics_Subscription_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_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_Topics_Subscription_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBSubscriptionProperties_STATUS_ARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) +} + +func Test_SBSubscriptionProperties_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 SBSubscriptionProperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSubscriptionProperties_STATUS_ARM, SBSubscriptionProperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSubscriptionProperties_STATUS_ARM runs a test to see if a specific instance of SBSubscriptionProperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSubscriptionProperties_STATUS_ARM(subject SBSubscriptionProperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSubscriptionProperties_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 SBSubscriptionProperties_STATUS_ARM instances for property testing - lazily instantiated by +// SBSubscriptionProperties_STATUS_ARMGenerator() +var sbSubscriptionProperties_STATUS_ARMGenerator gopter.Gen + +// SBSubscriptionProperties_STATUS_ARMGenerator returns a generator of SBSubscriptionProperties_STATUS_ARM instances for property testing. +// We first initialize sbSubscriptionProperties_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 SBSubscriptionProperties_STATUS_ARMGenerator() gopter.Gen { + if sbSubscriptionProperties_STATUS_ARMGenerator != nil { + return sbSubscriptionProperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM(generators) + sbSubscriptionProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBSubscriptionProperties_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM(generators) + sbSubscriptionProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBSubscriptionProperties_STATUS_ARM{}), generators) + + return sbSubscriptionProperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnFilterEvaluationExceptions"] = gen.PtrOf(gen.Bool()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["IsClientAffine"] = gen.PtrOf(gen.Bool()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MessageCount"] = gen.PtrOf(gen.Int()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + EntityStatus_STATUS_Active, + EntityStatus_STATUS_Creating, + EntityStatus_STATUS_Deleting, + EntityStatus_STATUS_Disabled, + EntityStatus_STATUS_ReceiveDisabled, + EntityStatus_STATUS_Renaming, + EntityStatus_STATUS_Restoring, + EntityStatus_STATUS_SendDisabled, + EntityStatus_STATUS_Unknown)) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBSubscriptionProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffineProperties_STATUS_ARMGenerator()) + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUS_ARMGenerator()) +} + +func Test_SBClientAffineProperties_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 SBClientAffineProperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBClientAffineProperties_STATUS_ARM, SBClientAffineProperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBClientAffineProperties_STATUS_ARM runs a test to see if a specific instance of SBClientAffineProperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSBClientAffineProperties_STATUS_ARM(subject SBClientAffineProperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBClientAffineProperties_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 SBClientAffineProperties_STATUS_ARM instances for property testing - lazily instantiated by +// SBClientAffineProperties_STATUS_ARMGenerator() +var sbClientAffineProperties_STATUS_ARMGenerator gopter.Gen + +// SBClientAffineProperties_STATUS_ARMGenerator returns a generator of SBClientAffineProperties_STATUS_ARM instances for property testing. +func SBClientAffineProperties_STATUS_ARMGenerator() gopter.Gen { + if sbClientAffineProperties_STATUS_ARMGenerator != nil { + return sbClientAffineProperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS_ARM(generators) + sbClientAffineProperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SBClientAffineProperties_STATUS_ARM{}), generators) + + return sbClientAffineProperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["IsDurable"] = gen.PtrOf(gen.Bool()) + gens["IsShared"] = gen.PtrOf(gen.Bool()) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_types_gen.go new file mode 100644 index 00000000000..333875b3db3 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_types_gen.go @@ -0,0 +1,1764 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import ( + "fmt" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" + "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: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/subscriptions.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName} +type NamespacesTopicsSubscription struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Topics_Subscription_Spec `json:"spec,omitempty"` + Status Namespaces_Topics_Subscription_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesTopicsSubscription{} + +// GetConditions returns the conditions of the resource +func (subscription *NamespacesTopicsSubscription) GetConditions() conditions.Conditions { + return subscription.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (subscription *NamespacesTopicsSubscription) SetConditions(conditions conditions.Conditions) { + subscription.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesTopicsSubscription{} + +// ConvertFrom populates our NamespacesTopicsSubscription from the provided hub NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) ConvertFrom(hub conversion.Hub) error { + // intermediate variable for conversion + var source v20221001ps.NamespacesTopicsSubscription + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") + } + + err = subscription.AssignProperties_From_NamespacesTopicsSubscription(&source) + if err != nil { + return errors.Wrap(err, "converting from source to subscription") + } + + return nil +} + +// ConvertTo populates the provided hub NamespacesTopicsSubscription from our NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) ConvertTo(hub conversion.Hub) error { + // intermediate variable for conversion + var destination v20221001ps.NamespacesTopicsSubscription + err := subscription.AssignProperties_To_NamespacesTopicsSubscription(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from subscription") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") + } + + return nil +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20221001preview-namespacestopicssubscription,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptions,verbs=create;update,versions=v1api20221001preview,name=default.v1api20221001preview.namespacestopicssubscriptions.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &NamespacesTopicsSubscription{} + +// Default applies defaults to the NamespacesTopicsSubscription resource +func (subscription *NamespacesTopicsSubscription) Default() { + subscription.defaultImpl() + var temp any = subscription + if runtimeDefaulter, ok := temp.(genruntime.Defaulter); ok { + runtimeDefaulter.CustomDefault() + } +} + +// defaultAzureName defaults the Azure name of the resource to the Kubernetes name +func (subscription *NamespacesTopicsSubscription) defaultAzureName() { + if subscription.Spec.AzureName == "" { + subscription.Spec.AzureName = subscription.Name + } +} + +// defaultImpl applies the code generated defaults to the NamespacesTopicsSubscription resource +func (subscription *NamespacesTopicsSubscription) defaultImpl() { subscription.defaultAzureName() } + +var _ genruntime.KubernetesResource = &NamespacesTopicsSubscription{} + +// AzureName returns the Azure name of the resource +func (subscription *NamespacesTopicsSubscription) AzureName() string { + return subscription.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2022-10-01-preview" +func (subscription NamespacesTopicsSubscription) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (subscription *NamespacesTopicsSubscription) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (subscription *NamespacesTopicsSubscription) GetSpec() genruntime.ConvertibleSpec { + return &subscription.Spec +} + +// GetStatus returns the status of this resource +func (subscription *NamespacesTopicsSubscription) GetStatus() genruntime.ConvertibleStatus { + return &subscription.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions" +func (subscription *NamespacesTopicsSubscription) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions" +} + +// NewEmptyStatus returns a new empty (blank) status +func (subscription *NamespacesTopicsSubscription) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Topics_Subscription_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (subscription *NamespacesTopicsSubscription) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: subscription.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (subscription *NamespacesTopicsSubscription) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Topics_Subscription_STATUS); ok { + subscription.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Topics_Subscription_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + subscription.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-servicebus-azure-com-v1api20221001preview-namespacestopicssubscription,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptions,verbs=create;update,versions=v1api20221001preview,name=validate.v1api20221001preview.namespacestopicssubscriptions.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &NamespacesTopicsSubscription{} + +// ValidateCreate validates the creation of the resource +func (subscription *NamespacesTopicsSubscription) ValidateCreate() (admission.Warnings, error) { + validations := subscription.createValidations() + var temp any = subscription + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.CreateValidations()...) + } + return genruntime.ValidateCreate(validations) +} + +// ValidateDelete validates the deletion of the resource +func (subscription *NamespacesTopicsSubscription) ValidateDelete() (admission.Warnings, error) { + validations := subscription.deleteValidations() + var temp any = subscription + if runtimeValidator, ok := temp.(genruntime.Validator); ok { + validations = append(validations, runtimeValidator.DeleteValidations()...) + } + return genruntime.ValidateDelete(validations) +} + +// ValidateUpdate validates an update of the resource +func (subscription *NamespacesTopicsSubscription) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { + validations := subscription.updateValidations() + var temp any = subscription + 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 (subscription *NamespacesTopicsSubscription) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){subscription.validateResourceReferences} +} + +// deleteValidations validates the deletion of the resource +func (subscription *NamespacesTopicsSubscription) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (subscription *NamespacesTopicsSubscription) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return subscription.validateResourceReferences() + }, + subscription.validateWriteOnceProperties} +} + +// validateResourceReferences validates all resource references +func (subscription *NamespacesTopicsSubscription) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&subscription.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (subscription *NamespacesTopicsSubscription) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*NamespacesTopicsSubscription) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, subscription) +} + +// AssignProperties_From_NamespacesTopicsSubscription populates our NamespacesTopicsSubscription from the provided source NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) AssignProperties_From_NamespacesTopicsSubscription(source *v20221001ps.NamespacesTopicsSubscription) error { + + // ObjectMeta + subscription.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Topics_Subscription_Spec + err := spec.AssignProperties_From_Namespaces_Topics_Subscription_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscription_Spec() to populate field Spec") + } + subscription.Spec = spec + + // Status + var status Namespaces_Topics_Subscription_STATUS + err = status.AssignProperties_From_Namespaces_Topics_Subscription_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscription_STATUS() to populate field Status") + } + subscription.Status = status + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscription populates the provided destination NamespacesTopicsSubscription from our NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) AssignProperties_To_NamespacesTopicsSubscription(destination *v20221001ps.NamespacesTopicsSubscription) error { + + // ObjectMeta + destination.ObjectMeta = *subscription.ObjectMeta.DeepCopy() + + // Spec + var spec v20221001ps.Namespaces_Topics_Subscription_Spec + err := subscription.Spec.AssignProperties_To_Namespaces_Topics_Subscription_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscription_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20221001ps.Namespaces_Topics_Subscription_STATUS + err = subscription.Status.AssignProperties_To_Namespaces_Topics_Subscription_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscription_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 (subscription *NamespacesTopicsSubscription) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: subscription.Spec.OriginalVersion(), + Kind: "NamespacesTopicsSubscription", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/subscriptions.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName} +type NamespacesTopicsSubscriptionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesTopicsSubscription `json:"items"` +} + +type Namespaces_Topics_Subscription_Spec struct { + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // +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"` + + // ClientAffineProperties: Properties specific to client affine subscriptions. + ClientAffineProperties *SBClientAffineProperties `json:"clientAffineProperties,omitempty"` + + // DeadLetteringOnFilterEvaluationExceptions: Value that indicates whether a subscription has dead letter support on filter + // evaluation exceptions. + DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"` + + // DeadLetteringOnMessageExpiration: Value that indicates whether a subscription has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8061 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // IsClientAffine: Value that indicates whether the subscription has an affinity to the client id. + IsClientAffine *bool `json:"isClientAffine,omitempty"` + + // LockDuration: ISO 8061 lock duration timespan for the subscription. The default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: Number of maximum deliveries. + MaxDeliveryCount *int `json:"maxDeliveryCount,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 servicebus.azure.com/NamespacesTopic resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"NamespacesTopic"` + + // RequiresSession: Value indicating if a subscription supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` +} + +var _ genruntime.ARMTransformer = &Namespaces_Topics_Subscription_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (subscription *Namespaces_Topics_Subscription_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if subscription == nil { + return nil, nil + } + result := &Namespaces_Topics_Subscription_Spec_ARM{} + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if subscription.AutoDeleteOnIdle != nil || + subscription.ClientAffineProperties != nil || + subscription.DeadLetteringOnFilterEvaluationExceptions != nil || + subscription.DeadLetteringOnMessageExpiration != nil || + subscription.DefaultMessageTimeToLive != nil || + subscription.DuplicateDetectionHistoryTimeWindow != nil || + subscription.EnableBatchedOperations != nil || + subscription.ForwardDeadLetteredMessagesTo != nil || + subscription.ForwardTo != nil || + subscription.IsClientAffine != nil || + subscription.LockDuration != nil || + subscription.MaxDeliveryCount != nil || + subscription.RequiresSession != nil { + result.Properties = &SBSubscriptionProperties_ARM{} + } + if subscription.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *subscription.AutoDeleteOnIdle + result.Properties.AutoDeleteOnIdle = &autoDeleteOnIdle + } + if subscription.ClientAffineProperties != nil { + clientAffineProperties_ARM, err := (*subscription.ClientAffineProperties).ConvertToARM(resolved) + if err != nil { + return nil, err + } + clientAffineProperties := *clientAffineProperties_ARM.(*SBClientAffineProperties_ARM) + result.Properties.ClientAffineProperties = &clientAffineProperties + } + if subscription.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationExceptions := *subscription.DeadLetteringOnFilterEvaluationExceptions + result.Properties.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationExceptions + } + if subscription.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *subscription.DeadLetteringOnMessageExpiration + result.Properties.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } + if subscription.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *subscription.DefaultMessageTimeToLive + result.Properties.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + if subscription.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *subscription.DuplicateDetectionHistoryTimeWindow + result.Properties.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + if subscription.EnableBatchedOperations != nil { + enableBatchedOperations := *subscription.EnableBatchedOperations + result.Properties.EnableBatchedOperations = &enableBatchedOperations + } + if subscription.ForwardDeadLetteredMessagesTo != nil { + forwardDeadLetteredMessagesTo := *subscription.ForwardDeadLetteredMessagesTo + result.Properties.ForwardDeadLetteredMessagesTo = &forwardDeadLetteredMessagesTo + } + if subscription.ForwardTo != nil { + forwardTo := *subscription.ForwardTo + result.Properties.ForwardTo = &forwardTo + } + if subscription.IsClientAffine != nil { + isClientAffine := *subscription.IsClientAffine + result.Properties.IsClientAffine = &isClientAffine + } + if subscription.LockDuration != nil { + lockDuration := *subscription.LockDuration + result.Properties.LockDuration = &lockDuration + } + if subscription.MaxDeliveryCount != nil { + maxDeliveryCount := *subscription.MaxDeliveryCount + result.Properties.MaxDeliveryCount = &maxDeliveryCount + } + if subscription.RequiresSession != nil { + requiresSession := *subscription.RequiresSession + result.Properties.RequiresSession = &requiresSession + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (subscription *Namespaces_Topics_Subscription_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Topics_Subscription_Spec_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (subscription *Namespaces_Topics_Subscription_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Topics_Subscription_Spec_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Topics_Subscription_Spec_ARM, got %T", armInput) + } + + // Set property "AutoDeleteOnIdle": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *typedInput.Properties.AutoDeleteOnIdle + subscription.AutoDeleteOnIdle = &autoDeleteOnIdle + } + } + + // Set property "AzureName": + subscription.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // Set property "ClientAffineProperties": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ClientAffineProperties != nil { + var clientAffineProperties1 SBClientAffineProperties + err := clientAffineProperties1.PopulateFromARM(owner, *typedInput.Properties.ClientAffineProperties) + if err != nil { + return err + } + clientAffineProperties := clientAffineProperties1 + subscription.ClientAffineProperties = &clientAffineProperties + } + } + + // Set property "DeadLetteringOnFilterEvaluationExceptions": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationExceptions := *typedInput.Properties.DeadLetteringOnFilterEvaluationExceptions + subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationExceptions + } + } + + // Set property "DeadLetteringOnMessageExpiration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *typedInput.Properties.DeadLetteringOnMessageExpiration + subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } + } + + // Set property "DefaultMessageTimeToLive": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *typedInput.Properties.DefaultMessageTimeToLive + subscription.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + } + + // Set property "DuplicateDetectionHistoryTimeWindow": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *typedInput.Properties.DuplicateDetectionHistoryTimeWindow + subscription.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + } + + // Set property "EnableBatchedOperations": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableBatchedOperations != nil { + enableBatchedOperations := *typedInput.Properties.EnableBatchedOperations + subscription.EnableBatchedOperations = &enableBatchedOperations + } + } + + // Set property "ForwardDeadLetteredMessagesTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardDeadLetteredMessagesTo != nil { + forwardDeadLetteredMessagesTo := *typedInput.Properties.ForwardDeadLetteredMessagesTo + subscription.ForwardDeadLetteredMessagesTo = &forwardDeadLetteredMessagesTo + } + } + + // Set property "ForwardTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardTo != nil { + forwardTo := *typedInput.Properties.ForwardTo + subscription.ForwardTo = &forwardTo + } + } + + // Set property "IsClientAffine": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.IsClientAffine != nil { + isClientAffine := *typedInput.Properties.IsClientAffine + subscription.IsClientAffine = &isClientAffine + } + } + + // Set property "LockDuration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.LockDuration != nil { + lockDuration := *typedInput.Properties.LockDuration + subscription.LockDuration = &lockDuration + } + } + + // Set property "MaxDeliveryCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxDeliveryCount != nil { + maxDeliveryCount := *typedInput.Properties.MaxDeliveryCount + subscription.MaxDeliveryCount = &maxDeliveryCount + } + } + + // Set property "Owner": + subscription.Owner = &genruntime.KnownResourceReference{Name: owner.Name} + + // Set property "RequiresSession": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresSession != nil { + requiresSession := *typedInput.Properties.RequiresSession + subscription.RequiresSession = &requiresSession + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Topics_Subscription_Spec{} + +// ConvertSpecFrom populates our Namespaces_Topics_Subscription_Spec from the provided source +func (subscription *Namespaces_Topics_Subscription_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20221001ps.Namespaces_Topics_Subscription_Spec) + if ok { + // Populate our instance from source + return subscription.AssignProperties_From_Namespaces_Topics_Subscription_Spec(src) + } + + // Convert to an intermediate form + src = &v20221001ps.Namespaces_Topics_Subscription_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = subscription.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_Spec +func (subscription *Namespaces_Topics_Subscription_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20221001ps.Namespaces_Topics_Subscription_Spec) + if ok { + // Populate destination from our instance + return subscription.AssignProperties_To_Namespaces_Topics_Subscription_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20221001ps.Namespaces_Topics_Subscription_Spec{} + err := subscription.AssignProperties_To_Namespaces_Topics_Subscription_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_Topics_Subscription_Spec populates our Namespaces_Topics_Subscription_Spec from the provided source Namespaces_Topics_Subscription_Spec +func (subscription *Namespaces_Topics_Subscription_Spec) AssignProperties_From_Namespaces_Topics_Subscription_Spec(source *v20221001ps.Namespaces_Topics_Subscription_Spec) error { + + // AutoDeleteOnIdle + subscription.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // AzureName + subscription.AzureName = source.AzureName + + // ClientAffineProperties + if source.ClientAffineProperties != nil { + var clientAffineProperty SBClientAffineProperties + err := clientAffineProperty.AssignProperties_From_SBClientAffineProperties(source.ClientAffineProperties) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBClientAffineProperties() to populate field ClientAffineProperties") + } + subscription.ClientAffineProperties = &clientAffineProperty + } else { + subscription.ClientAffineProperties = nil + } + + // DeadLetteringOnFilterEvaluationExceptions + if source.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *source.DeadLetteringOnFilterEvaluationExceptions + subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + subscription.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + subscription.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + subscription.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + subscription.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + subscription.EnableBatchedOperations = &enableBatchedOperation + } else { + subscription.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + subscription.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + subscription.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // IsClientAffine + if source.IsClientAffine != nil { + isClientAffine := *source.IsClientAffine + subscription.IsClientAffine = &isClientAffine + } else { + subscription.IsClientAffine = nil + } + + // LockDuration + subscription.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + subscription.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + subscription.Owner = &owner + } else { + subscription.Owner = nil + } + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + subscription.RequiresSession = &requiresSession + } else { + subscription.RequiresSession = nil + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topics_Subscription_Spec populates the provided destination Namespaces_Topics_Subscription_Spec from our Namespaces_Topics_Subscription_Spec +func (subscription *Namespaces_Topics_Subscription_Spec) AssignProperties_To_Namespaces_Topics_Subscription_Spec(destination *v20221001ps.Namespaces_Topics_Subscription_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(subscription.AutoDeleteOnIdle) + + // AzureName + destination.AzureName = subscription.AzureName + + // ClientAffineProperties + if subscription.ClientAffineProperties != nil { + var clientAffineProperty v20221001ps.SBClientAffineProperties + err := subscription.ClientAffineProperties.AssignProperties_To_SBClientAffineProperties(&clientAffineProperty) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBClientAffineProperties() to populate field ClientAffineProperties") + } + destination.ClientAffineProperties = &clientAffineProperty + } else { + destination.ClientAffineProperties = nil + } + + // DeadLetteringOnFilterEvaluationExceptions + if subscription.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *subscription.DeadLetteringOnFilterEvaluationExceptions + destination.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + destination.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if subscription.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *subscription.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(subscription.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(subscription.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if subscription.EnableBatchedOperations != nil { + enableBatchedOperation := *subscription.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(subscription.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(subscription.ForwardTo) + + // IsClientAffine + if subscription.IsClientAffine != nil { + isClientAffine := *subscription.IsClientAffine + destination.IsClientAffine = &isClientAffine + } else { + destination.IsClientAffine = nil + } + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(subscription.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(subscription.MaxDeliveryCount) + + // OriginalVersion + destination.OriginalVersion = subscription.OriginalVersion() + + // Owner + if subscription.Owner != nil { + owner := subscription.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // RequiresSession + if subscription.RequiresSession != nil { + requiresSession := *subscription.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (subscription *Namespaces_Topics_Subscription_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (subscription *Namespaces_Topics_Subscription_Spec) SetAzureName(azureName string) { + subscription.AzureName = azureName +} + +type Namespaces_Topics_Subscription_STATUS struct { + // AccessedAt: Last time there was a receive request to this subscription. + AccessedAt *string `json:"accessedAt,omitempty"` + + // AutoDeleteOnIdle: ISO 8061 timeSpan idle interval after which the topic is automatically deleted. The minimum duration + // is 5 minutes. + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // ClientAffineProperties: Properties specific to client affine subscriptions. + ClientAffineProperties *SBClientAffineProperties_STATUS `json:"clientAffineProperties,omitempty"` + + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // CountDetails: Message count details + CountDetails *MessageCountDetails_STATUS `json:"countDetails,omitempty"` + + // CreatedAt: Exact time the message was created. + CreatedAt *string `json:"createdAt,omitempty"` + + // DeadLetteringOnFilterEvaluationExceptions: Value that indicates whether a subscription has dead letter support on filter + // evaluation exceptions. + DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"` + + // DeadLetteringOnMessageExpiration: Value that indicates whether a subscription has dead letter support when a message + // expires. + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + + // DefaultMessageTimeToLive: ISO 8061 Default message timespan to live value. This is the duration after which the message + // expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not + // set on a message itself. + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + + // DuplicateDetectionHistoryTimeWindow: ISO 8601 timeSpan structure that defines the duration of the duplicate detection + // history. The default value is 10 minutes. + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + + // EnableBatchedOperations: Value that indicates whether server-side batched operations are enabled. + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + + // ForwardDeadLetteredMessagesTo: Queue/Topic name to forward the Dead Letter message + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + + // ForwardTo: Queue/Topic name to forward the messages + ForwardTo *string `json:"forwardTo,omitempty"` + + // Id: Fully qualified resource ID for the resource. Ex - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + Id *string `json:"id,omitempty"` + + // IsClientAffine: Value that indicates whether the subscription has an affinity to the client id. + IsClientAffine *bool `json:"isClientAffine,omitempty"` + + // Location: The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // LockDuration: ISO 8061 lock duration timespan for the subscription. The default value is 1 minute. + LockDuration *string `json:"lockDuration,omitempty"` + + // MaxDeliveryCount: Number of maximum deliveries. + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + + // MessageCount: Number of messages. + MessageCount *int `json:"messageCount,omitempty"` + + // Name: The name of the resource + Name *string `json:"name,omitempty"` + + // RequiresSession: Value indicating if a subscription supports the concept of sessions. + RequiresSession *bool `json:"requiresSession,omitempty"` + + // Status: Enumerates the possible values for the status of a messaging entity. + Status *EntityStatus_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_Topics_Subscription_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Topics_Subscription_STATUS from the provided source +func (subscription *Namespaces_Topics_Subscription_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20221001ps.Namespaces_Topics_Subscription_STATUS) + if ok { + // Populate our instance from source + return subscription.AssignProperties_From_Namespaces_Topics_Subscription_STATUS(src) + } + + // Convert to an intermediate form + src = &v20221001ps.Namespaces_Topics_Subscription_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = subscription.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS +func (subscription *Namespaces_Topics_Subscription_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20221001ps.Namespaces_Topics_Subscription_STATUS) + if ok { + // Populate destination from our instance + return subscription.AssignProperties_To_Namespaces_Topics_Subscription_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20221001ps.Namespaces_Topics_Subscription_STATUS{} + err := subscription.AssignProperties_To_Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (subscription *Namespaces_Topics_Subscription_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Topics_Subscription_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (subscription *Namespaces_Topics_Subscription_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Topics_Subscription_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Topics_Subscription_STATUS_ARM, got %T", armInput) + } + + // Set property "AccessedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AccessedAt != nil { + accessedAt := *typedInput.Properties.AccessedAt + subscription.AccessedAt = &accessedAt + } + } + + // Set property "AutoDeleteOnIdle": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.AutoDeleteOnIdle != nil { + autoDeleteOnIdle := *typedInput.Properties.AutoDeleteOnIdle + subscription.AutoDeleteOnIdle = &autoDeleteOnIdle + } + } + + // Set property "ClientAffineProperties": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ClientAffineProperties != nil { + var clientAffineProperties1 SBClientAffineProperties_STATUS + err := clientAffineProperties1.PopulateFromARM(owner, *typedInput.Properties.ClientAffineProperties) + if err != nil { + return err + } + clientAffineProperties := clientAffineProperties1 + subscription.ClientAffineProperties = &clientAffineProperties + } + } + + // no assignment for property "Conditions" + + // Set property "CountDetails": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CountDetails != nil { + var countDetails1 MessageCountDetails_STATUS + err := countDetails1.PopulateFromARM(owner, *typedInput.Properties.CountDetails) + if err != nil { + return err + } + countDetails := countDetails1 + subscription.CountDetails = &countDetails + } + } + + // Set property "CreatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CreatedAt != nil { + createdAt := *typedInput.Properties.CreatedAt + subscription.CreatedAt = &createdAt + } + } + + // Set property "DeadLetteringOnFilterEvaluationExceptions": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationExceptions := *typedInput.Properties.DeadLetteringOnFilterEvaluationExceptions + subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationExceptions + } + } + + // Set property "DeadLetteringOnMessageExpiration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *typedInput.Properties.DeadLetteringOnMessageExpiration + subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } + } + + // Set property "DefaultMessageTimeToLive": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DefaultMessageTimeToLive != nil { + defaultMessageTimeToLive := *typedInput.Properties.DefaultMessageTimeToLive + subscription.DefaultMessageTimeToLive = &defaultMessageTimeToLive + } + } + + // Set property "DuplicateDetectionHistoryTimeWindow": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.DuplicateDetectionHistoryTimeWindow != nil { + duplicateDetectionHistoryTimeWindow := *typedInput.Properties.DuplicateDetectionHistoryTimeWindow + subscription.DuplicateDetectionHistoryTimeWindow = &duplicateDetectionHistoryTimeWindow + } + } + + // Set property "EnableBatchedOperations": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.EnableBatchedOperations != nil { + enableBatchedOperations := *typedInput.Properties.EnableBatchedOperations + subscription.EnableBatchedOperations = &enableBatchedOperations + } + } + + // Set property "ForwardDeadLetteredMessagesTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardDeadLetteredMessagesTo != nil { + forwardDeadLetteredMessagesTo := *typedInput.Properties.ForwardDeadLetteredMessagesTo + subscription.ForwardDeadLetteredMessagesTo = &forwardDeadLetteredMessagesTo + } + } + + // Set property "ForwardTo": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.ForwardTo != nil { + forwardTo := *typedInput.Properties.ForwardTo + subscription.ForwardTo = &forwardTo + } + } + + // Set property "Id": + if typedInput.Id != nil { + id := *typedInput.Id + subscription.Id = &id + } + + // Set property "IsClientAffine": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.IsClientAffine != nil { + isClientAffine := *typedInput.Properties.IsClientAffine + subscription.IsClientAffine = &isClientAffine + } + } + + // Set property "Location": + if typedInput.Location != nil { + location := *typedInput.Location + subscription.Location = &location + } + + // Set property "LockDuration": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.LockDuration != nil { + lockDuration := *typedInput.Properties.LockDuration + subscription.LockDuration = &lockDuration + } + } + + // Set property "MaxDeliveryCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MaxDeliveryCount != nil { + maxDeliveryCount := *typedInput.Properties.MaxDeliveryCount + subscription.MaxDeliveryCount = &maxDeliveryCount + } + } + + // Set property "MessageCount": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.MessageCount != nil { + messageCount := *typedInput.Properties.MessageCount + subscription.MessageCount = &messageCount + } + } + + // Set property "Name": + if typedInput.Name != nil { + name := *typedInput.Name + subscription.Name = &name + } + + // Set property "RequiresSession": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.RequiresSession != nil { + requiresSession := *typedInput.Properties.RequiresSession + subscription.RequiresSession = &requiresSession + } + } + + // Set property "Status": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Status != nil { + status := *typedInput.Properties.Status + subscription.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 + subscription.SystemData = &systemData + } + + // Set property "Type": + if typedInput.Type != nil { + typeVar := *typedInput.Type + subscription.Type = &typeVar + } + + // Set property "UpdatedAt": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.UpdatedAt != nil { + updatedAt := *typedInput.Properties.UpdatedAt + subscription.UpdatedAt = &updatedAt + } + } + + // No error + return nil +} + +// AssignProperties_From_Namespaces_Topics_Subscription_STATUS populates our Namespaces_Topics_Subscription_STATUS from the provided source Namespaces_Topics_Subscription_STATUS +func (subscription *Namespaces_Topics_Subscription_STATUS) AssignProperties_From_Namespaces_Topics_Subscription_STATUS(source *v20221001ps.Namespaces_Topics_Subscription_STATUS) error { + + // AccessedAt + subscription.AccessedAt = genruntime.ClonePointerToString(source.AccessedAt) + + // AutoDeleteOnIdle + subscription.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // ClientAffineProperties + if source.ClientAffineProperties != nil { + var clientAffineProperty SBClientAffineProperties_STATUS + err := clientAffineProperty.AssignProperties_From_SBClientAffineProperties_STATUS(source.ClientAffineProperties) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBClientAffineProperties_STATUS() to populate field ClientAffineProperties") + } + subscription.ClientAffineProperties = &clientAffineProperty + } else { + subscription.ClientAffineProperties = nil + } + + // Conditions + subscription.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CountDetails + if source.CountDetails != nil { + var countDetail MessageCountDetails_STATUS + err := countDetail.AssignProperties_From_MessageCountDetails_STATUS(source.CountDetails) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_MessageCountDetails_STATUS() to populate field CountDetails") + } + subscription.CountDetails = &countDetail + } else { + subscription.CountDetails = nil + } + + // CreatedAt + subscription.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DeadLetteringOnFilterEvaluationExceptions + if source.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *source.DeadLetteringOnFilterEvaluationExceptions + subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + subscription.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + subscription.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + subscription.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + subscription.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + subscription.EnableBatchedOperations = &enableBatchedOperation + } else { + subscription.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + subscription.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + subscription.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // Id + subscription.Id = genruntime.ClonePointerToString(source.Id) + + // IsClientAffine + if source.IsClientAffine != nil { + isClientAffine := *source.IsClientAffine + subscription.IsClientAffine = &isClientAffine + } else { + subscription.IsClientAffine = nil + } + + // Location + subscription.Location = genruntime.ClonePointerToString(source.Location) + + // LockDuration + subscription.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + subscription.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // MessageCount + subscription.MessageCount = genruntime.ClonePointerToInt(source.MessageCount) + + // Name + subscription.Name = genruntime.ClonePointerToString(source.Name) + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + subscription.RequiresSession = &requiresSession + } else { + subscription.RequiresSession = nil + } + + // Status + if source.Status != nil { + status := EntityStatus_STATUS(*source.Status) + subscription.Status = &status + } else { + subscription.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") + } + subscription.SystemData = &systemDatum + } else { + subscription.SystemData = nil + } + + // Type + subscription.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + subscription.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topics_Subscription_STATUS populates the provided destination Namespaces_Topics_Subscription_STATUS from our Namespaces_Topics_Subscription_STATUS +func (subscription *Namespaces_Topics_Subscription_STATUS) AssignProperties_To_Namespaces_Topics_Subscription_STATUS(destination *v20221001ps.Namespaces_Topics_Subscription_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AccessedAt + destination.AccessedAt = genruntime.ClonePointerToString(subscription.AccessedAt) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(subscription.AutoDeleteOnIdle) + + // ClientAffineProperties + if subscription.ClientAffineProperties != nil { + var clientAffineProperty v20221001ps.SBClientAffineProperties_STATUS + err := subscription.ClientAffineProperties.AssignProperties_To_SBClientAffineProperties_STATUS(&clientAffineProperty) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBClientAffineProperties_STATUS() to populate field ClientAffineProperties") + } + destination.ClientAffineProperties = &clientAffineProperty + } else { + destination.ClientAffineProperties = nil + } + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(subscription.Conditions) + + // CountDetails + if subscription.CountDetails != nil { + var countDetail v20221001ps.MessageCountDetails_STATUS + err := subscription.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_MessageCountDetails_STATUS() to populate field CountDetails") + } + destination.CountDetails = &countDetail + } else { + destination.CountDetails = nil + } + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(subscription.CreatedAt) + + // DeadLetteringOnFilterEvaluationExceptions + if subscription.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *subscription.DeadLetteringOnFilterEvaluationExceptions + destination.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + destination.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if subscription.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *subscription.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(subscription.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(subscription.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if subscription.EnableBatchedOperations != nil { + enableBatchedOperation := *subscription.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(subscription.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(subscription.ForwardTo) + + // Id + destination.Id = genruntime.ClonePointerToString(subscription.Id) + + // IsClientAffine + if subscription.IsClientAffine != nil { + isClientAffine := *subscription.IsClientAffine + destination.IsClientAffine = &isClientAffine + } else { + destination.IsClientAffine = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(subscription.Location) + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(subscription.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(subscription.MaxDeliveryCount) + + // MessageCount + destination.MessageCount = genruntime.ClonePointerToInt(subscription.MessageCount) + + // Name + destination.Name = genruntime.ClonePointerToString(subscription.Name) + + // RequiresSession + if subscription.RequiresSession != nil { + requiresSession := *subscription.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // Status + if subscription.Status != nil { + status := string(*subscription.Status) + destination.Status = &status + } else { + destination.Status = nil + } + + // SystemData + if subscription.SystemData != nil { + var systemDatum v20221001ps.SystemData_STATUS + err := subscription.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(subscription.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(subscription.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Properties specific to client affine subscriptions. +type SBClientAffineProperties struct { + // ClientId: Indicates the Client ID of the application that created the client-affine subscription. + ClientId *string `json:"clientId,omitempty"` + + // IsDurable: For client-affine subscriptions, this value indicates whether the subscription is durable or not. + IsDurable *bool `json:"isDurable,omitempty"` + + // IsShared: For client-affine subscriptions, this value indicates whether the subscription is shared or not. + IsShared *bool `json:"isShared,omitempty"` +} + +var _ genruntime.ARMTransformer = &SBClientAffineProperties{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (properties *SBClientAffineProperties) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if properties == nil { + return nil, nil + } + result := &SBClientAffineProperties_ARM{} + + // Set property "ClientId": + if properties.ClientId != nil { + clientId := *properties.ClientId + result.ClientId = &clientId + } + + // Set property "IsDurable": + if properties.IsDurable != nil { + isDurable := *properties.IsDurable + result.IsDurable = &isDurable + } + + // Set property "IsShared": + if properties.IsShared != nil { + isShared := *properties.IsShared + result.IsShared = &isShared + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *SBClientAffineProperties) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SBClientAffineProperties_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *SBClientAffineProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SBClientAffineProperties_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SBClientAffineProperties_ARM, got %T", armInput) + } + + // Set property "ClientId": + if typedInput.ClientId != nil { + clientId := *typedInput.ClientId + properties.ClientId = &clientId + } + + // Set property "IsDurable": + if typedInput.IsDurable != nil { + isDurable := *typedInput.IsDurable + properties.IsDurable = &isDurable + } + + // Set property "IsShared": + if typedInput.IsShared != nil { + isShared := *typedInput.IsShared + properties.IsShared = &isShared + } + + // No error + return nil +} + +// AssignProperties_From_SBClientAffineProperties populates our SBClientAffineProperties from the provided source SBClientAffineProperties +func (properties *SBClientAffineProperties) AssignProperties_From_SBClientAffineProperties(source *v20221001ps.SBClientAffineProperties) error { + + // ClientId + properties.ClientId = genruntime.ClonePointerToString(source.ClientId) + + // IsDurable + if source.IsDurable != nil { + isDurable := *source.IsDurable + properties.IsDurable = &isDurable + } else { + properties.IsDurable = nil + } + + // IsShared + if source.IsShared != nil { + isShared := *source.IsShared + properties.IsShared = &isShared + } else { + properties.IsShared = nil + } + + // No error + return nil +} + +// AssignProperties_To_SBClientAffineProperties populates the provided destination SBClientAffineProperties from our SBClientAffineProperties +func (properties *SBClientAffineProperties) AssignProperties_To_SBClientAffineProperties(destination *v20221001ps.SBClientAffineProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ClientId + destination.ClientId = genruntime.ClonePointerToString(properties.ClientId) + + // IsDurable + if properties.IsDurable != nil { + isDurable := *properties.IsDurable + destination.IsDurable = &isDurable + } else { + destination.IsDurable = nil + } + + // IsShared + if properties.IsShared != nil { + isShared := *properties.IsShared + destination.IsShared = &isShared + } else { + destination.IsShared = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Properties specific to client affine subscriptions. +type SBClientAffineProperties_STATUS struct { + // ClientId: Indicates the Client ID of the application that created the client-affine subscription. + ClientId *string `json:"clientId,omitempty"` + + // IsDurable: For client-affine subscriptions, this value indicates whether the subscription is durable or not. + IsDurable *bool `json:"isDurable,omitempty"` + + // IsShared: For client-affine subscriptions, this value indicates whether the subscription is shared or not. + IsShared *bool `json:"isShared,omitempty"` +} + +var _ genruntime.FromARMConverter = &SBClientAffineProperties_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (properties *SBClientAffineProperties_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SBClientAffineProperties_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *SBClientAffineProperties_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SBClientAffineProperties_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SBClientAffineProperties_STATUS_ARM, got %T", armInput) + } + + // Set property "ClientId": + if typedInput.ClientId != nil { + clientId := *typedInput.ClientId + properties.ClientId = &clientId + } + + // Set property "IsDurable": + if typedInput.IsDurable != nil { + isDurable := *typedInput.IsDurable + properties.IsDurable = &isDurable + } + + // Set property "IsShared": + if typedInput.IsShared != nil { + isShared := *typedInput.IsShared + properties.IsShared = &isShared + } + + // No error + return nil +} + +// AssignProperties_From_SBClientAffineProperties_STATUS populates our SBClientAffineProperties_STATUS from the provided source SBClientAffineProperties_STATUS +func (properties *SBClientAffineProperties_STATUS) AssignProperties_From_SBClientAffineProperties_STATUS(source *v20221001ps.SBClientAffineProperties_STATUS) error { + + // ClientId + properties.ClientId = genruntime.ClonePointerToString(source.ClientId) + + // IsDurable + if source.IsDurable != nil { + isDurable := *source.IsDurable + properties.IsDurable = &isDurable + } else { + properties.IsDurable = nil + } + + // IsShared + if source.IsShared != nil { + isShared := *source.IsShared + properties.IsShared = &isShared + } else { + properties.IsShared = nil + } + + // No error + return nil +} + +// AssignProperties_To_SBClientAffineProperties_STATUS populates the provided destination SBClientAffineProperties_STATUS from our SBClientAffineProperties_STATUS +func (properties *SBClientAffineProperties_STATUS) AssignProperties_To_SBClientAffineProperties_STATUS(destination *v20221001ps.SBClientAffineProperties_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ClientId + destination.ClientId = genruntime.ClonePointerToString(properties.ClientId) + + // IsDurable + if properties.IsDurable != nil { + isDurable := *properties.IsDurable + destination.IsDurable = &isDurable + } else { + destination.IsDurable = nil + } + + // IsShared + if properties.IsShared != nil { + isShared := *properties.IsShared + destination.IsShared = &isShared + } else { + destination.IsShared = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&NamespacesTopicsSubscription{}, &NamespacesTopicsSubscriptionList{}) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_types_gen_test.go new file mode 100644 index 00000000000..86c073ae959 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_types_gen_test.go @@ -0,0 +1,654 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" + "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_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesTopicsSubscription, NamespacesTopicsSubscriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesTopicsSubscription tests if a specific instance of NamespacesTopicsSubscription round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesTopicsSubscription(subject NamespacesTopicsSubscription) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesTopicsSubscription + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesTopicsSubscription + 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_NamespacesTopicsSubscription_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscription to NamespacesTopicsSubscription via AssignProperties_To_NamespacesTopicsSubscription & AssignProperties_From_NamespacesTopicsSubscription returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscription, NamespacesTopicsSubscriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscription tests if a specific instance of NamespacesTopicsSubscription can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscription(subject NamespacesTopicsSubscription) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20221001ps.NamespacesTopicsSubscription + err := copied.AssignProperties_To_NamespacesTopicsSubscription(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscription + err = actual.AssignProperties_From_NamespacesTopicsSubscription(&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_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscription, NamespacesTopicsSubscriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscription runs a test to see if a specific instance of NamespacesTopicsSubscription round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscription(subject NamespacesTopicsSubscription) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscription + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicsSubscription instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionGenerator() +var namespacesTopicsSubscriptionGenerator gopter.Gen + +// NamespacesTopicsSubscriptionGenerator returns a generator of NamespacesTopicsSubscription instances for property testing. +func NamespacesTopicsSubscriptionGenerator() gopter.Gen { + if namespacesTopicsSubscriptionGenerator != nil { + return namespacesTopicsSubscriptionGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription(generators) + namespacesTopicsSubscriptionGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription{}), generators) + + return namespacesTopicsSubscriptionGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Topics_Subscription_SpecGenerator() + gens["Status"] = Namespaces_Topics_Subscription_STATUSGenerator() +} + +func Test_Namespaces_Topics_Subscription_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscription_Spec to Namespaces_Topics_Subscription_Spec via AssignProperties_To_Namespaces_Topics_Subscription_Spec & AssignProperties_From_Namespaces_Topics_Subscription_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscription_Spec, Namespaces_Topics_Subscription_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscription_Spec tests if a specific instance of Namespaces_Topics_Subscription_Spec can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscription_Spec(subject Namespaces_Topics_Subscription_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 v20221001ps.Namespaces_Topics_Subscription_Spec + err := copied.AssignProperties_To_Namespaces_Topics_Subscription_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscription_Spec + err = actual.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_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_Topics_Subscription_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec, Namespaces_Topics_Subscription_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec runs a test to see if a specific instance of Namespaces_Topics_Subscription_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec(subject Namespaces_Topics_Subscription_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscription_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_Topics_Subscription_Spec instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscription_SpecGenerator() +var namespaces_Topics_Subscription_SpecGenerator gopter.Gen + +// Namespaces_Topics_Subscription_SpecGenerator returns a generator of Namespaces_Topics_Subscription_Spec instances for property testing. +// We first initialize namespaces_Topics_Subscription_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_Topics_Subscription_SpecGenerator() gopter.Gen { + if namespaces_Topics_Subscription_SpecGenerator != nil { + return namespaces_Topics_Subscription_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(generators) + namespaces_Topics_Subscription_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(generators) + namespaces_Topics_Subscription_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_Spec{}), generators) + + return namespaces_Topics_Subscription_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DeadLetteringOnFilterEvaluationExceptions"] = gen.PtrOf(gen.Bool()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["IsClientAffine"] = gen.PtrOf(gen.Bool()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffinePropertiesGenerator()) +} + +func Test_Namespaces_Topics_Subscription_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscription_STATUS to Namespaces_Topics_Subscription_STATUS via AssignProperties_To_Namespaces_Topics_Subscription_STATUS & AssignProperties_From_Namespaces_Topics_Subscription_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscription_STATUS, Namespaces_Topics_Subscription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscription_STATUS tests if a specific instance of Namespaces_Topics_Subscription_STATUS can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscription_STATUS(subject Namespaces_Topics_Subscription_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 v20221001ps.Namespaces_Topics_Subscription_STATUS + err := copied.AssignProperties_To_Namespaces_Topics_Subscription_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscription_STATUS + err = actual.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_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_Topics_Subscription_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS, Namespaces_Topics_Subscription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS runs a test to see if a specific instance of Namespaces_Topics_Subscription_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS(subject Namespaces_Topics_Subscription_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscription_STATUSGenerator() +var namespaces_Topics_Subscription_STATUSGenerator gopter.Gen + +// Namespaces_Topics_Subscription_STATUSGenerator returns a generator of Namespaces_Topics_Subscription_STATUS instances for property testing. +// We first initialize namespaces_Topics_Subscription_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_Topics_Subscription_STATUSGenerator() gopter.Gen { + if namespaces_Topics_Subscription_STATUSGenerator != nil { + return namespaces_Topics_Subscription_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(generators) + namespaces_Topics_Subscription_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(generators) + namespaces_Topics_Subscription_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_STATUS{}), generators) + + return namespaces_Topics_Subscription_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnFilterEvaluationExceptions"] = gen.PtrOf(gen.Bool()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["IsClientAffine"] = gen.PtrOf(gen.Bool()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MessageCount"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) + gens["Status"] = gen.PtrOf(gen.OneConstOf( + EntityStatus_STATUS_Active, + EntityStatus_STATUS_Creating, + EntityStatus_STATUS_Deleting, + EntityStatus_STATUS_Disabled, + EntityStatus_STATUS_ReceiveDisabled, + EntityStatus_STATUS_Renaming, + EntityStatus_STATUS_Restoring, + EntityStatus_STATUS_SendDisabled, + EntityStatus_STATUS_Unknown)) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffineProperties_STATUSGenerator()) + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_SBClientAffineProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBClientAffineProperties to SBClientAffineProperties via AssignProperties_To_SBClientAffineProperties & AssignProperties_From_SBClientAffineProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForSBClientAffineProperties, SBClientAffinePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBClientAffineProperties tests if a specific instance of SBClientAffineProperties can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForSBClientAffineProperties(subject SBClientAffineProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20221001ps.SBClientAffineProperties + err := copied.AssignProperties_To_SBClientAffineProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBClientAffineProperties + err = actual.AssignProperties_From_SBClientAffineProperties(&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_SBClientAffineProperties_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 SBClientAffineProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBClientAffineProperties, SBClientAffinePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBClientAffineProperties runs a test to see if a specific instance of SBClientAffineProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForSBClientAffineProperties(subject SBClientAffineProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBClientAffineProperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SBClientAffineProperties instances for property testing - lazily instantiated by +// SBClientAffinePropertiesGenerator() +var sbClientAffinePropertiesGenerator gopter.Gen + +// SBClientAffinePropertiesGenerator returns a generator of SBClientAffineProperties instances for property testing. +func SBClientAffinePropertiesGenerator() gopter.Gen { + if sbClientAffinePropertiesGenerator != nil { + return sbClientAffinePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBClientAffineProperties(generators) + sbClientAffinePropertiesGenerator = gen.Struct(reflect.TypeOf(SBClientAffineProperties{}), generators) + + return sbClientAffinePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForSBClientAffineProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBClientAffineProperties(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["IsDurable"] = gen.PtrOf(gen.Bool()) + gens["IsShared"] = gen.PtrOf(gen.Bool()) +} + +func Test_SBClientAffineProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBClientAffineProperties_STATUS to SBClientAffineProperties_STATUS via AssignProperties_To_SBClientAffineProperties_STATUS & AssignProperties_From_SBClientAffineProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSBClientAffineProperties_STATUS, SBClientAffineProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBClientAffineProperties_STATUS tests if a specific instance of SBClientAffineProperties_STATUS can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForSBClientAffineProperties_STATUS(subject SBClientAffineProperties_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 v20221001ps.SBClientAffineProperties_STATUS + err := copied.AssignProperties_To_SBClientAffineProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBClientAffineProperties_STATUS + err = actual.AssignProperties_From_SBClientAffineProperties_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_SBClientAffineProperties_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 SBClientAffineProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBClientAffineProperties_STATUS, SBClientAffineProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBClientAffineProperties_STATUS runs a test to see if a specific instance of SBClientAffineProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSBClientAffineProperties_STATUS(subject SBClientAffineProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBClientAffineProperties_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 SBClientAffineProperties_STATUS instances for property testing - lazily instantiated by +// SBClientAffineProperties_STATUSGenerator() +var sbClientAffineProperties_STATUSGenerator gopter.Gen + +// SBClientAffineProperties_STATUSGenerator returns a generator of SBClientAffineProperties_STATUS instances for property testing. +func SBClientAffineProperties_STATUSGenerator() gopter.Gen { + if sbClientAffineProperties_STATUSGenerator != nil { + return sbClientAffineProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS(generators) + sbClientAffineProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(SBClientAffineProperties_STATUS{}), generators) + + return sbClientAffineProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["IsDurable"] = gen.PtrOf(gen.Bool()) + gens["IsShared"] = gen.PtrOf(gen.Bool()) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_spec_arm_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_spec_arm_types_gen.go new file mode 100644 index 00000000000..6b8f9f73e51 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_spec_arm_types_gen.go @@ -0,0 +1,106 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespaces_Topics_Subscriptions_Rule_Spec_ARM struct { + Name string `json:"name,omitempty"` + + // Properties: Properties of Rule resource + Properties *Ruleproperties_ARM `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespaces_Topics_Subscriptions_Rule_Spec_ARM{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2022-10-01-preview" +func (rule Namespaces_Topics_Subscriptions_Rule_Spec_ARM) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetName returns the Name of the resource +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec_ARM) GetName() string { + return rule.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec_ARM) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +} + +// Description of Rule Resource. +type Ruleproperties_ARM struct { + // Action: Represents the filter actions which are allowed for the transformation of a message that have been matched by a + // filter expression. + Action *Action_ARM `json:"action,omitempty"` + + // CorrelationFilter: Properties of correlationFilter + CorrelationFilter *CorrelationFilter_ARM `json:"correlationFilter,omitempty"` + + // FilterType: Filter type that is evaluated against a BrokeredMessage. + FilterType *FilterType `json:"filterType,omitempty"` + + // SqlFilter: Properties of sqlFilter + SqlFilter *SqlFilter_ARM `json:"sqlFilter,omitempty"` +} + +// Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter +// expression. +type Action_ARM struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +// Represents the correlation filter expression. +type CorrelationFilter_ARM struct { + // ContentType: Content type of the message. + ContentType *string `json:"contentType,omitempty"` + + // CorrelationId: Identifier of the correlation. + CorrelationId *string `json:"correlationId,omitempty"` + + // Label: Application specific label. + Label *string `json:"label,omitempty"` + + // MessageId: Identifier of the message. + MessageId *string `json:"messageId,omitempty"` + + // Properties: dictionary object for custom filters + Properties map[string]string `json:"properties,omitempty"` + + // ReplyTo: Address of the queue to reply to. + ReplyTo *string `json:"replyTo,omitempty"` + + // ReplyToSessionId: Session identifier to reply to. + ReplyToSessionId *string `json:"replyToSessionId,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SessionId: Session identifier. + SessionId *string `json:"sessionId,omitempty"` + + // To: Address to send to. + To *string `json:"to,omitempty"` +} + +// Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. +type SqlFilter_ARM struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: The SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_spec_arm_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_spec_arm_types_gen_test.go new file mode 100644 index 00000000000..3f855301836 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_spec_arm_types_gen_test.go @@ -0,0 +1,363 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec_ARM, Namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec_ARM runs a test to see if a specific instance of Namespaces_Topics_Subscriptions_Rule_Spec_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec_ARM(subject Namespaces_Topics_Subscriptions_Rule_Spec_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec_ARM instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator() +var namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator gopter.Gen + +// Namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator returns a generator of Namespaces_Topics_Subscriptions_Rule_Spec_ARM instances for property testing. +// We first initialize namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec_ARMGenerator() gopter.Gen { + if namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator != nil { + return namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM(generators) + namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_Spec_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM(generators) + namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_Spec_ARM{}), generators) + + return namespaces_Topics_Subscriptions_Rule_Spec_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Ruleproperties_ARMGenerator()) +} + +func Test_Ruleproperties_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 Ruleproperties_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRuleproperties_ARM, Ruleproperties_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRuleproperties_ARM runs a test to see if a specific instance of Ruleproperties_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForRuleproperties_ARM(subject Ruleproperties_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Ruleproperties_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 Ruleproperties_ARM instances for property testing - lazily instantiated by Ruleproperties_ARMGenerator() +var ruleproperties_ARMGenerator gopter.Gen + +// Ruleproperties_ARMGenerator returns a generator of Ruleproperties_ARM instances for property testing. +// We first initialize ruleproperties_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 Ruleproperties_ARMGenerator() gopter.Gen { + if ruleproperties_ARMGenerator != nil { + return ruleproperties_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleproperties_ARM(generators) + ruleproperties_ARMGenerator = gen.Struct(reflect.TypeOf(Ruleproperties_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleproperties_ARM(generators) + AddRelatedPropertyGeneratorsForRuleproperties_ARM(generators) + ruleproperties_ARMGenerator = gen.Struct(reflect.TypeOf(Ruleproperties_ARM{}), generators) + + return ruleproperties_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForRuleproperties_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRuleproperties_ARM(gens map[string]gopter.Gen) { + gens["FilterType"] = gen.PtrOf(gen.OneConstOf(FilterType_CorrelationFilter, FilterType_SqlFilter)) +} + +// AddRelatedPropertyGeneratorsForRuleproperties_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForRuleproperties_ARM(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(Action_ARMGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilter_ARMGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilter_ARMGenerator()) +} + +func Test_Action_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 Action_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAction_ARM, Action_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAction_ARM runs a test to see if a specific instance of Action_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForAction_ARM(subject Action_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Action_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 Action_ARM instances for property testing - lazily instantiated by Action_ARMGenerator() +var action_ARMGenerator gopter.Gen + +// Action_ARMGenerator returns a generator of Action_ARM instances for property testing. +func Action_ARMGenerator() gopter.Gen { + if action_ARMGenerator != nil { + return action_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAction_ARM(generators) + action_ARMGenerator = gen.Struct(reflect.TypeOf(Action_ARM{}), generators) + + return action_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForAction_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAction_ARM(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CorrelationFilter_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 CorrelationFilter_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCorrelationFilter_ARM, CorrelationFilter_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCorrelationFilter_ARM runs a test to see if a specific instance of CorrelationFilter_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForCorrelationFilter_ARM(subject CorrelationFilter_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CorrelationFilter_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 CorrelationFilter_ARM instances for property testing - lazily instantiated by +// CorrelationFilter_ARMGenerator() +var correlationFilter_ARMGenerator gopter.Gen + +// CorrelationFilter_ARMGenerator returns a generator of CorrelationFilter_ARM instances for property testing. +func CorrelationFilter_ARMGenerator() gopter.Gen { + if correlationFilter_ARMGenerator != nil { + return correlationFilter_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCorrelationFilter_ARM(generators) + correlationFilter_ARMGenerator = gen.Struct(reflect.TypeOf(CorrelationFilter_ARM{}), generators) + + return correlationFilter_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForCorrelationFilter_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCorrelationFilter_ARM(gens map[string]gopter.Gen) { + gens["ContentType"] = gen.PtrOf(gen.AlphaString()) + gens["CorrelationId"] = gen.PtrOf(gen.AlphaString()) + gens["Label"] = gen.PtrOf(gen.AlphaString()) + gens["MessageId"] = gen.PtrOf(gen.AlphaString()) + gens["Properties"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ReplyTo"] = gen.PtrOf(gen.AlphaString()) + gens["ReplyToSessionId"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SessionId"] = gen.PtrOf(gen.AlphaString()) + gens["To"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SqlFilter_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 SqlFilter_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSqlFilter_ARM, SqlFilter_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSqlFilter_ARM runs a test to see if a specific instance of SqlFilter_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSqlFilter_ARM(subject SqlFilter_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SqlFilter_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 SqlFilter_ARM instances for property testing - lazily instantiated by SqlFilter_ARMGenerator() +var sqlFilter_ARMGenerator gopter.Gen + +// SqlFilter_ARMGenerator returns a generator of SqlFilter_ARM instances for property testing. +func SqlFilter_ARMGenerator() gopter.Gen { + if sqlFilter_ARMGenerator != nil { + return sqlFilter_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSqlFilter_ARM(generators) + sqlFilter_ARMGenerator = gen.Struct(reflect.TypeOf(SqlFilter_ARM{}), generators) + + return sqlFilter_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSqlFilter_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSqlFilter_ARM(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_status_arm_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_status_arm_types_gen.go new file mode 100644 index 00000000000..745bfda509c --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_status_arm_types_gen.go @@ -0,0 +1,101 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +type Namespaces_Topics_Subscriptions_Rule_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 of Rule resource + Properties *Ruleproperties_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"` +} + +// Description of Rule Resource. +type Ruleproperties_STATUS_ARM struct { + // Action: Represents the filter actions which are allowed for the transformation of a message that have been matched by a + // filter expression. + Action *Action_STATUS_ARM `json:"action,omitempty"` + + // CorrelationFilter: Properties of correlationFilter + CorrelationFilter *CorrelationFilter_STATUS_ARM `json:"correlationFilter,omitempty"` + + // FilterType: Filter type that is evaluated against a BrokeredMessage. + FilterType *FilterType_STATUS `json:"filterType,omitempty"` + + // SqlFilter: Properties of sqlFilter + SqlFilter *SqlFilter_STATUS_ARM `json:"sqlFilter,omitempty"` +} + +// Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter +// expression. +type Action_STATUS_ARM struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +// Represents the correlation filter expression. +type CorrelationFilter_STATUS_ARM struct { + // ContentType: Content type of the message. + ContentType *string `json:"contentType,omitempty"` + + // CorrelationId: Identifier of the correlation. + CorrelationId *string `json:"correlationId,omitempty"` + + // Label: Application specific label. + Label *string `json:"label,omitempty"` + + // MessageId: Identifier of the message. + MessageId *string `json:"messageId,omitempty"` + + // Properties: dictionary object for custom filters + Properties map[string]string `json:"properties,omitempty"` + + // ReplyTo: Address of the queue to reply to. + ReplyTo *string `json:"replyTo,omitempty"` + + // ReplyToSessionId: Session identifier to reply to. + ReplyToSessionId *string `json:"replyToSessionId,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SessionId: Session identifier. + SessionId *string `json:"sessionId,omitempty"` + + // To: Address to send to. + To *string `json:"to,omitempty"` +} + +// Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. +type SqlFilter_STATUS_ARM struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: The SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_status_arm_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_status_arm_types_gen_test.go new file mode 100644 index 00000000000..2db887a2629 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_status_arm_types_gen_test.go @@ -0,0 +1,369 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM, Namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM runs a test to see if a specific instance of Namespaces_Topics_Subscriptions_Rule_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM(subject Namespaces_Topics_Subscriptions_Rule_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS_ARM instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator() +var namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator gopter.Gen + +// Namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator returns a generator of Namespaces_Topics_Subscriptions_Rule_STATUS_ARM instances for property testing. +// We first initialize namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS_ARMGenerator() gopter.Gen { + if namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator != nil { + return namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM(generators) + namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM(generators) + namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_STATUS_ARM{}), generators) + + return namespaces_Topics_Subscriptions_Rule_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Ruleproperties_STATUS_ARMGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUS_ARMGenerator()) +} + +func Test_Ruleproperties_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 Ruleproperties_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRuleproperties_STATUS_ARM, Ruleproperties_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRuleproperties_STATUS_ARM runs a test to see if a specific instance of Ruleproperties_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForRuleproperties_STATUS_ARM(subject Ruleproperties_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Ruleproperties_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 Ruleproperties_STATUS_ARM instances for property testing - lazily instantiated by +// Ruleproperties_STATUS_ARMGenerator() +var ruleproperties_STATUS_ARMGenerator gopter.Gen + +// Ruleproperties_STATUS_ARMGenerator returns a generator of Ruleproperties_STATUS_ARM instances for property testing. +// We first initialize ruleproperties_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 Ruleproperties_STATUS_ARMGenerator() gopter.Gen { + if ruleproperties_STATUS_ARMGenerator != nil { + return ruleproperties_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleproperties_STATUS_ARM(generators) + ruleproperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Ruleproperties_STATUS_ARM{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleproperties_STATUS_ARM(generators) + AddRelatedPropertyGeneratorsForRuleproperties_STATUS_ARM(generators) + ruleproperties_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Ruleproperties_STATUS_ARM{}), generators) + + return ruleproperties_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForRuleproperties_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRuleproperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["FilterType"] = gen.PtrOf(gen.OneConstOf(FilterType_STATUS_CorrelationFilter, FilterType_STATUS_SqlFilter)) +} + +// AddRelatedPropertyGeneratorsForRuleproperties_STATUS_ARM is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForRuleproperties_STATUS_ARM(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(Action_STATUS_ARMGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilter_STATUS_ARMGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilter_STATUS_ARMGenerator()) +} + +func Test_Action_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 Action_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAction_STATUS_ARM, Action_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAction_STATUS_ARM runs a test to see if a specific instance of Action_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForAction_STATUS_ARM(subject Action_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Action_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 Action_STATUS_ARM instances for property testing - lazily instantiated by Action_STATUS_ARMGenerator() +var action_STATUS_ARMGenerator gopter.Gen + +// Action_STATUS_ARMGenerator returns a generator of Action_STATUS_ARM instances for property testing. +func Action_STATUS_ARMGenerator() gopter.Gen { + if action_STATUS_ARMGenerator != nil { + return action_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAction_STATUS_ARM(generators) + action_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(Action_STATUS_ARM{}), generators) + + return action_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForAction_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAction_STATUS_ARM(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CorrelationFilter_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 CorrelationFilter_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCorrelationFilter_STATUS_ARM, CorrelationFilter_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCorrelationFilter_STATUS_ARM runs a test to see if a specific instance of CorrelationFilter_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForCorrelationFilter_STATUS_ARM(subject CorrelationFilter_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CorrelationFilter_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 CorrelationFilter_STATUS_ARM instances for property testing - lazily instantiated by +// CorrelationFilter_STATUS_ARMGenerator() +var correlationFilter_STATUS_ARMGenerator gopter.Gen + +// CorrelationFilter_STATUS_ARMGenerator returns a generator of CorrelationFilter_STATUS_ARM instances for property testing. +func CorrelationFilter_STATUS_ARMGenerator() gopter.Gen { + if correlationFilter_STATUS_ARMGenerator != nil { + return correlationFilter_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS_ARM(generators) + correlationFilter_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(CorrelationFilter_STATUS_ARM{}), generators) + + return correlationFilter_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS_ARM(gens map[string]gopter.Gen) { + gens["ContentType"] = gen.PtrOf(gen.AlphaString()) + gens["CorrelationId"] = gen.PtrOf(gen.AlphaString()) + gens["Label"] = gen.PtrOf(gen.AlphaString()) + gens["MessageId"] = gen.PtrOf(gen.AlphaString()) + gens["Properties"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ReplyTo"] = gen.PtrOf(gen.AlphaString()) + gens["ReplyToSessionId"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SessionId"] = gen.PtrOf(gen.AlphaString()) + gens["To"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SqlFilter_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 SqlFilter_STATUS_ARM via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSqlFilter_STATUS_ARM, SqlFilter_STATUS_ARMGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSqlFilter_STATUS_ARM runs a test to see if a specific instance of SqlFilter_STATUS_ARM round trips to JSON and back losslessly +func RunJSONSerializationTestForSqlFilter_STATUS_ARM(subject SqlFilter_STATUS_ARM) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SqlFilter_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 SqlFilter_STATUS_ARM instances for property testing - lazily instantiated by +// SqlFilter_STATUS_ARMGenerator() +var sqlFilter_STATUS_ARMGenerator gopter.Gen + +// SqlFilter_STATUS_ARMGenerator returns a generator of SqlFilter_STATUS_ARM instances for property testing. +func SqlFilter_STATUS_ARMGenerator() gopter.Gen { + if sqlFilter_STATUS_ARMGenerator != nil { + return sqlFilter_STATUS_ARMGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSqlFilter_STATUS_ARM(generators) + sqlFilter_STATUS_ARMGenerator = gen.Struct(reflect.TypeOf(SqlFilter_STATUS_ARM{}), generators) + + return sqlFilter_STATUS_ARMGenerator +} + +// AddIndependentPropertyGeneratorsForSqlFilter_STATUS_ARM is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSqlFilter_STATUS_ARM(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_types_gen.go new file mode 100644 index 00000000000..effff7368d0 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_types_gen.go @@ -0,0 +1,1975 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import ( + "fmt" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" + "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: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/Rules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName} +type NamespacesTopicsSubscriptionsRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Topics_Subscriptions_Rule_Spec `json:"spec,omitempty"` + Status Namespaces_Topics_Subscriptions_Rule_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesTopicsSubscriptionsRule{} + +// GetConditions returns the conditions of the resource +func (rule *NamespacesTopicsSubscriptionsRule) GetConditions() conditions.Conditions { + return rule.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (rule *NamespacesTopicsSubscriptionsRule) SetConditions(conditions conditions.Conditions) { + rule.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesTopicsSubscriptionsRule{} + +// ConvertFrom populates our NamespacesTopicsSubscriptionsRule from the provided hub NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) ConvertFrom(hub conversion.Hub) error { + // intermediate variable for conversion + var source v20221001ps.NamespacesTopicsSubscriptionsRule + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") + } + + err = rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule(&source) + if err != nil { + return errors.Wrap(err, "converting from source to rule") + } + + return nil +} + +// ConvertTo populates the provided hub NamespacesTopicsSubscriptionsRule from our NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) ConvertTo(hub conversion.Hub) error { + // intermediate variable for conversion + var destination v20221001ps.NamespacesTopicsSubscriptionsRule + err := rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(&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 nil +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20221001preview-namespacestopicssubscriptionsrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptionsrules,verbs=create;update,versions=v1api20221001preview,name=default.v1api20221001preview.namespacestopicssubscriptionsrules.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Defaulter = &NamespacesTopicsSubscriptionsRule{} + +// Default applies defaults to the NamespacesTopicsSubscriptionsRule resource +func (rule *NamespacesTopicsSubscriptionsRule) 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 *NamespacesTopicsSubscriptionsRule) defaultAzureName() { + if rule.Spec.AzureName == "" { + rule.Spec.AzureName = rule.Name + } +} + +// defaultImpl applies the code generated defaults to the NamespacesTopicsSubscriptionsRule resource +func (rule *NamespacesTopicsSubscriptionsRule) defaultImpl() { rule.defaultAzureName() } + +var _ genruntime.KubernetesResource = &NamespacesTopicsSubscriptionsRule{} + +// AzureName returns the Azure name of the resource +func (rule *NamespacesTopicsSubscriptionsRule) AzureName() string { + return rule.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2022-10-01-preview" +func (rule NamespacesTopicsSubscriptionsRule) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (rule *NamespacesTopicsSubscriptionsRule) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (rule *NamespacesTopicsSubscriptionsRule) GetSpec() genruntime.ConvertibleSpec { + return &rule.Spec +} + +// GetStatus returns the status of this resource +func (rule *NamespacesTopicsSubscriptionsRule) GetStatus() genruntime.ConvertibleStatus { + return &rule.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +func (rule *NamespacesTopicsSubscriptionsRule) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +} + +// NewEmptyStatus returns a new empty (blank) status +func (rule *NamespacesTopicsSubscriptionsRule) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Topics_Subscriptions_Rule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *NamespacesTopicsSubscriptionsRule) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: rule.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (rule *NamespacesTopicsSubscriptionsRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Topics_Subscriptions_Rule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Topics_Subscriptions_Rule_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-servicebus-azure-com-v1api20221001preview-namespacestopicssubscriptionsrule,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptionsrules,verbs=create;update,versions=v1api20221001preview,name=validate.v1api20221001preview.namespacestopicssubscriptionsrules.servicebus.azure.com,admissionReviewVersions=v1 + +var _ admission.Validator = &NamespacesTopicsSubscriptionsRule{} + +// ValidateCreate validates the creation of the resource +func (rule *NamespacesTopicsSubscriptionsRule) 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 *NamespacesTopicsSubscriptionsRule) 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 *NamespacesTopicsSubscriptionsRule) 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 *NamespacesTopicsSubscriptionsRule) createValidations() []func() (admission.Warnings, error) { + return []func() (admission.Warnings, error){rule.validateResourceReferences} +} + +// deleteValidations validates the deletion of the resource +func (rule *NamespacesTopicsSubscriptionsRule) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (rule *NamespacesTopicsSubscriptionsRule) 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} +} + +// validateResourceReferences validates all resource references +func (rule *NamespacesTopicsSubscriptionsRule) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&rule.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (rule *NamespacesTopicsSubscriptionsRule) validateWriteOnceProperties(old runtime.Object) (admission.Warnings, error) { + oldObj, ok := old.(*NamespacesTopicsSubscriptionsRule) + if !ok { + return nil, nil + } + + return genruntime.ValidateWriteOnceProperties(oldObj, rule) +} + +// AssignProperties_From_NamespacesTopicsSubscriptionsRule populates our NamespacesTopicsSubscriptionsRule from the provided source NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) AssignProperties_From_NamespacesTopicsSubscriptionsRule(source *v20221001ps.NamespacesTopicsSubscriptionsRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Topics_Subscriptions_Rule_Spec + err := spec.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status Namespaces_Topics_Subscriptions_Rule_STATUS + err = status.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS() to populate field Status") + } + rule.Status = status + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscriptionsRule populates the provided destination NamespacesTopicsSubscriptionsRule from our NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) AssignProperties_To_NamespacesTopicsSubscriptionsRule(destination *v20221001ps.NamespacesTopicsSubscriptionsRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec v20221001ps.Namespaces_Topics_Subscriptions_Rule_Spec + err := rule.Spec.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20221001ps.Namespaces_Topics_Subscriptions_Rule_STATUS + err = rule.Status.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_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 *NamespacesTopicsSubscriptionsRule) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: rule.Spec.OriginalVersion(), + Kind: "NamespacesTopicsSubscriptionsRule", + } +} + +// +kubebuilder:object:root=true +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/Rules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName} +type NamespacesTopicsSubscriptionsRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesTopicsSubscriptionsRule `json:"items"` +} + +type Namespaces_Topics_Subscriptions_Rule_Spec struct { + // Action: Represents the filter actions which are allowed for the transformation of a message that have been matched by a + // filter expression. + Action *Action `json:"action,omitempty"` + + // +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"` + + // CorrelationFilter: Properties of correlationFilter + CorrelationFilter *CorrelationFilter `json:"correlationFilter,omitempty"` + + // FilterType: Filter type that is evaluated against a BrokeredMessage. + FilterType *FilterType `json:"filterType,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 servicebus.azure.com/NamespacesTopicsSubscription resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"NamespacesTopicsSubscription"` + + // SqlFilter: Properties of sqlFilter + SqlFilter *SqlFilter `json:"sqlFilter,omitempty"` +} + +var _ genruntime.ARMTransformer = &Namespaces_Topics_Subscriptions_Rule_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if rule == nil { + return nil, nil + } + result := &Namespaces_Topics_Subscriptions_Rule_Spec_ARM{} + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if rule.Action != nil || + rule.CorrelationFilter != nil || + rule.FilterType != nil || + rule.SqlFilter != nil { + result.Properties = &Ruleproperties_ARM{} + } + if rule.Action != nil { + action_ARM, err := (*rule.Action).ConvertToARM(resolved) + if err != nil { + return nil, err + } + action := *action_ARM.(*Action_ARM) + result.Properties.Action = &action + } + if rule.CorrelationFilter != nil { + correlationFilter_ARM, err := (*rule.CorrelationFilter).ConvertToARM(resolved) + if err != nil { + return nil, err + } + correlationFilter := *correlationFilter_ARM.(*CorrelationFilter_ARM) + result.Properties.CorrelationFilter = &correlationFilter + } + if rule.FilterType != nil { + filterType := *rule.FilterType + result.Properties.FilterType = &filterType + } + if rule.SqlFilter != nil { + sqlFilter_ARM, err := (*rule.SqlFilter).ConvertToARM(resolved) + if err != nil { + return nil, err + } + sqlFilter := *sqlFilter_ARM.(*SqlFilter_ARM) + result.Properties.SqlFilter = &sqlFilter + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Topics_Subscriptions_Rule_Spec_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Topics_Subscriptions_Rule_Spec_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Topics_Subscriptions_Rule_Spec_ARM, got %T", armInput) + } + + // Set property "Action": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Action != nil { + var action1 Action + err := action1.PopulateFromARM(owner, *typedInput.Properties.Action) + if err != nil { + return err + } + action := action1 + rule.Action = &action + } + } + + // Set property "AzureName": + rule.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // Set property "CorrelationFilter": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CorrelationFilter != nil { + var correlationFilter1 CorrelationFilter + err := correlationFilter1.PopulateFromARM(owner, *typedInput.Properties.CorrelationFilter) + if err != nil { + return err + } + correlationFilter := correlationFilter1 + rule.CorrelationFilter = &correlationFilter + } + } + + // Set property "FilterType": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.FilterType != nil { + filterType := *typedInput.Properties.FilterType + rule.FilterType = &filterType + } + } + + // Set property "Owner": + rule.Owner = &genruntime.KnownResourceReference{Name: owner.Name} + + // Set property "SqlFilter": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SqlFilter != nil { + var sqlFilter1 SqlFilter + err := sqlFilter1.PopulateFromARM(owner, *typedInput.Properties.SqlFilter) + if err != nil { + return err + } + sqlFilter := sqlFilter1 + rule.SqlFilter = &sqlFilter + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Topics_Subscriptions_Rule_Spec{} + +// ConvertSpecFrom populates our Namespaces_Topics_Subscriptions_Rule_Spec from the provided source +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20221001ps.Namespaces_Topics_Subscriptions_Rule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec(src) + } + + // Convert to an intermediate form + src = &v20221001ps.Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20221001ps.Namespaces_Topics_Subscriptions_Rule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20221001ps.Namespaces_Topics_Subscriptions_Rule_Spec{} + err := rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec populates our Namespaces_Topics_Subscriptions_Rule_Spec from the provided source Namespaces_Topics_Subscriptions_Rule_Spec +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec(source *v20221001ps.Namespaces_Topics_Subscriptions_Rule_Spec) error { + + // Action + if source.Action != nil { + var action Action + err := action.AssignProperties_From_Action(source.Action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Action() to populate field Action") + } + rule.Action = &action + } else { + rule.Action = nil + } + + // AzureName + rule.AzureName = source.AzureName + + // CorrelationFilter + if source.CorrelationFilter != nil { + var correlationFilter CorrelationFilter + err := correlationFilter.AssignProperties_From_CorrelationFilter(source.CorrelationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CorrelationFilter() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil + } + + // FilterType + if source.FilterType != nil { + filterType := FilterType(*source.FilterType) + rule.FilterType = &filterType + } else { + rule.FilterType = nil + } + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + rule.Owner = &owner + } else { + rule.Owner = nil + } + + // SqlFilter + if source.SqlFilter != nil { + var sqlFilter SqlFilter + err := sqlFilter.AssignProperties_From_SqlFilter(source.SqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SqlFilter() to populate field SqlFilter") + } + rule.SqlFilter = &sqlFilter + } else { + rule.SqlFilter = nil + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec populates the provided destination Namespaces_Topics_Subscriptions_Rule_Spec from our Namespaces_Topics_Subscriptions_Rule_Spec +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(destination *v20221001ps.Namespaces_Topics_Subscriptions_Rule_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Action + if rule.Action != nil { + var action v20221001ps.Action + err := rule.Action.AssignProperties_To_Action(&action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Action() to populate field Action") + } + destination.Action = &action + } else { + destination.Action = nil + } + + // AzureName + destination.AzureName = rule.AzureName + + // CorrelationFilter + if rule.CorrelationFilter != nil { + var correlationFilter v20221001ps.CorrelationFilter + err := rule.CorrelationFilter.AssignProperties_To_CorrelationFilter(&correlationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CorrelationFilter() to populate field CorrelationFilter") + } + destination.CorrelationFilter = &correlationFilter + } else { + destination.CorrelationFilter = nil + } + + // FilterType + if rule.FilterType != nil { + filterType := string(*rule.FilterType) + destination.FilterType = &filterType + } else { + destination.FilterType = nil + } + + // OriginalVersion + destination.OriginalVersion = rule.OriginalVersion() + + // Owner + if rule.Owner != nil { + owner := rule.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // SqlFilter + if rule.SqlFilter != nil { + var sqlFilter v20221001ps.SqlFilter + err := rule.SqlFilter.AssignProperties_To_SqlFilter(&sqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SqlFilter() to populate field SqlFilter") + } + destination.SqlFilter = &sqlFilter + } else { + destination.SqlFilter = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// OriginalVersion returns the original API version used to create the resource. +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) SetAzureName(azureName string) { + rule.AzureName = azureName +} + +type Namespaces_Topics_Subscriptions_Rule_STATUS struct { + // Action: Represents the filter actions which are allowed for the transformation of a message that have been matched by a + // filter expression. + Action *Action_STATUS `json:"action,omitempty"` + + // Conditions: The observed state of the resource + Conditions []conditions.Condition `json:"conditions,omitempty"` + + // CorrelationFilter: Properties of correlationFilter + CorrelationFilter *CorrelationFilter_STATUS `json:"correlationFilter,omitempty"` + + // FilterType: Filter type that is evaluated against a BrokeredMessage. + FilterType *FilterType_STATUS `json:"filterType,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"` + + // SqlFilter: Properties of sqlFilter + SqlFilter *SqlFilter_STATUS `json:"sqlFilter,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_Topics_Subscriptions_Rule_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Topics_Subscriptions_Rule_STATUS from the provided source +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20221001ps.Namespaces_Topics_Subscriptions_Rule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS(src) + } + + // Convert to an intermediate form + src = &v20221001ps.Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20221001ps.Namespaces_Topics_Subscriptions_Rule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20221001ps.Namespaces_Topics_Subscriptions_Rule_STATUS{} + err := rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Namespaces_Topics_Subscriptions_Rule_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Namespaces_Topics_Subscriptions_Rule_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Namespaces_Topics_Subscriptions_Rule_STATUS_ARM, got %T", armInput) + } + + // Set property "Action": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.Action != nil { + var action1 Action_STATUS + err := action1.PopulateFromARM(owner, *typedInput.Properties.Action) + if err != nil { + return err + } + action := action1 + rule.Action = &action + } + } + + // no assignment for property "Conditions" + + // Set property "CorrelationFilter": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.CorrelationFilter != nil { + var correlationFilter1 CorrelationFilter_STATUS + err := correlationFilter1.PopulateFromARM(owner, *typedInput.Properties.CorrelationFilter) + if err != nil { + return err + } + correlationFilter := correlationFilter1 + rule.CorrelationFilter = &correlationFilter + } + } + + // Set property "FilterType": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.FilterType != nil { + filterType := *typedInput.Properties.FilterType + rule.FilterType = &filterType + } + } + + // 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 "SqlFilter": + // copying flattened property: + if typedInput.Properties != nil { + if typedInput.Properties.SqlFilter != nil { + var sqlFilter1 SqlFilter_STATUS + err := sqlFilter1.PopulateFromARM(owner, *typedInput.Properties.SqlFilter) + if err != nil { + return err + } + sqlFilter := sqlFilter1 + rule.SqlFilter = &sqlFilter + } + } + + // 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_Topics_Subscriptions_Rule_STATUS populates our Namespaces_Topics_Subscriptions_Rule_STATUS from the provided source Namespaces_Topics_Subscriptions_Rule_STATUS +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS(source *v20221001ps.Namespaces_Topics_Subscriptions_Rule_STATUS) error { + + // Action + if source.Action != nil { + var action Action_STATUS + err := action.AssignProperties_From_Action_STATUS(source.Action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Action_STATUS() to populate field Action") + } + rule.Action = &action + } else { + rule.Action = nil + } + + // Conditions + rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CorrelationFilter + if source.CorrelationFilter != nil { + var correlationFilter CorrelationFilter_STATUS + err := correlationFilter.AssignProperties_From_CorrelationFilter_STATUS(source.CorrelationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CorrelationFilter_STATUS() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil + } + + // FilterType + if source.FilterType != nil { + filterType := FilterType_STATUS(*source.FilterType) + rule.FilterType = &filterType + } else { + rule.FilterType = nil + } + + // Id + rule.Id = genruntime.ClonePointerToString(source.Id) + + // Location + rule.Location = genruntime.ClonePointerToString(source.Location) + + // Name + rule.Name = genruntime.ClonePointerToString(source.Name) + + // SqlFilter + if source.SqlFilter != nil { + var sqlFilter SqlFilter_STATUS + err := sqlFilter.AssignProperties_From_SqlFilter_STATUS(source.SqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SqlFilter_STATUS() to populate field SqlFilter") + } + rule.SqlFilter = &sqlFilter + } else { + rule.SqlFilter = 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_Topics_Subscriptions_Rule_STATUS populates the provided destination Namespaces_Topics_Subscriptions_Rule_STATUS from our Namespaces_Topics_Subscriptions_Rule_STATUS +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(destination *v20221001ps.Namespaces_Topics_Subscriptions_Rule_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Action + if rule.Action != nil { + var action v20221001ps.Action_STATUS + err := rule.Action.AssignProperties_To_Action_STATUS(&action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Action_STATUS() to populate field Action") + } + destination.Action = &action + } else { + destination.Action = nil + } + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) + + // CorrelationFilter + if rule.CorrelationFilter != nil { + var correlationFilter v20221001ps.CorrelationFilter_STATUS + err := rule.CorrelationFilter.AssignProperties_To_CorrelationFilter_STATUS(&correlationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CorrelationFilter_STATUS() to populate field CorrelationFilter") + } + destination.CorrelationFilter = &correlationFilter + } else { + destination.CorrelationFilter = nil + } + + // FilterType + if rule.FilterType != nil { + filterType := string(*rule.FilterType) + destination.FilterType = &filterType + } else { + destination.FilterType = nil + } + + // Id + destination.Id = genruntime.ClonePointerToString(rule.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(rule.Location) + + // Name + destination.Name = genruntime.ClonePointerToString(rule.Name) + + // SqlFilter + if rule.SqlFilter != nil { + var sqlFilter v20221001ps.SqlFilter_STATUS + err := rule.SqlFilter.AssignProperties_To_SqlFilter_STATUS(&sqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SqlFilter_STATUS() to populate field SqlFilter") + } + destination.SqlFilter = &sqlFilter + } else { + destination.SqlFilter = nil + } + + // SystemData + if rule.SystemData != nil { + var systemDatum v20221001ps.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 +} + +// Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter +// expression. +type Action struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +var _ genruntime.ARMTransformer = &Action{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (action *Action) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if action == nil { + return nil, nil + } + result := &Action_ARM{} + + // Set property "CompatibilityLevel": + if action.CompatibilityLevel != nil { + compatibilityLevel := *action.CompatibilityLevel + result.CompatibilityLevel = &compatibilityLevel + } + + // Set property "RequiresPreprocessing": + if action.RequiresPreprocessing != nil { + requiresPreprocessing := *action.RequiresPreprocessing + result.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SqlExpression": + if action.SqlExpression != nil { + sqlExpression := *action.SqlExpression + result.SqlExpression = &sqlExpression + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (action *Action) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Action_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (action *Action) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Action_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Action_ARM, got %T", armInput) + } + + // Set property "CompatibilityLevel": + if typedInput.CompatibilityLevel != nil { + compatibilityLevel := *typedInput.CompatibilityLevel + action.CompatibilityLevel = &compatibilityLevel + } + + // Set property "RequiresPreprocessing": + if typedInput.RequiresPreprocessing != nil { + requiresPreprocessing := *typedInput.RequiresPreprocessing + action.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SqlExpression": + if typedInput.SqlExpression != nil { + sqlExpression := *typedInput.SqlExpression + action.SqlExpression = &sqlExpression + } + + // No error + return nil +} + +// AssignProperties_From_Action populates our Action from the provided source Action +func (action *Action) AssignProperties_From_Action(source *v20221001ps.Action) error { + + // CompatibilityLevel + action.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + action.RequiresPreprocessing = &requiresPreprocessing + } else { + action.RequiresPreprocessing = nil + } + + // SqlExpression + action.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // No error + return nil +} + +// AssignProperties_To_Action populates the provided destination Action from our Action +func (action *Action) AssignProperties_To_Action(destination *v20221001ps.Action) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(action.CompatibilityLevel) + + // RequiresPreprocessing + if action.RequiresPreprocessing != nil { + requiresPreprocessing := *action.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(action.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter +// expression. +type Action_STATUS struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +var _ genruntime.FromARMConverter = &Action_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (action *Action_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &Action_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (action *Action_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(Action_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected Action_STATUS_ARM, got %T", armInput) + } + + // Set property "CompatibilityLevel": + if typedInput.CompatibilityLevel != nil { + compatibilityLevel := *typedInput.CompatibilityLevel + action.CompatibilityLevel = &compatibilityLevel + } + + // Set property "RequiresPreprocessing": + if typedInput.RequiresPreprocessing != nil { + requiresPreprocessing := *typedInput.RequiresPreprocessing + action.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SqlExpression": + if typedInput.SqlExpression != nil { + sqlExpression := *typedInput.SqlExpression + action.SqlExpression = &sqlExpression + } + + // No error + return nil +} + +// AssignProperties_From_Action_STATUS populates our Action_STATUS from the provided source Action_STATUS +func (action *Action_STATUS) AssignProperties_From_Action_STATUS(source *v20221001ps.Action_STATUS) error { + + // CompatibilityLevel + action.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + action.RequiresPreprocessing = &requiresPreprocessing + } else { + action.RequiresPreprocessing = nil + } + + // SqlExpression + action.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // No error + return nil +} + +// AssignProperties_To_Action_STATUS populates the provided destination Action_STATUS from our Action_STATUS +func (action *Action_STATUS) AssignProperties_To_Action_STATUS(destination *v20221001ps.Action_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(action.CompatibilityLevel) + + // RequiresPreprocessing + if action.RequiresPreprocessing != nil { + requiresPreprocessing := *action.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(action.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Represents the correlation filter expression. +type CorrelationFilter struct { + // ContentType: Content type of the message. + ContentType *string `json:"contentType,omitempty"` + + // CorrelationId: Identifier of the correlation. + CorrelationId *string `json:"correlationId,omitempty"` + + // Label: Application specific label. + Label *string `json:"label,omitempty"` + + // MessageId: Identifier of the message. + MessageId *string `json:"messageId,omitempty"` + + // Properties: dictionary object for custom filters + Properties map[string]string `json:"properties,omitempty"` + + // ReplyTo: Address of the queue to reply to. + ReplyTo *string `json:"replyTo,omitempty"` + + // ReplyToSessionId: Session identifier to reply to. + ReplyToSessionId *string `json:"replyToSessionId,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SessionId: Session identifier. + SessionId *string `json:"sessionId,omitempty"` + + // To: Address to send to. + To *string `json:"to,omitempty"` +} + +var _ genruntime.ARMTransformer = &CorrelationFilter{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (filter *CorrelationFilter) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if filter == nil { + return nil, nil + } + result := &CorrelationFilter_ARM{} + + // Set property "ContentType": + if filter.ContentType != nil { + contentType := *filter.ContentType + result.ContentType = &contentType + } + + // Set property "CorrelationId": + if filter.CorrelationId != nil { + correlationId := *filter.CorrelationId + result.CorrelationId = &correlationId + } + + // Set property "Label": + if filter.Label != nil { + label := *filter.Label + result.Label = &label + } + + // Set property "MessageId": + if filter.MessageId != nil { + messageId := *filter.MessageId + result.MessageId = &messageId + } + + // Set property "Properties": + if filter.Properties != nil { + result.Properties = make(map[string]string, len(filter.Properties)) + for key, value := range filter.Properties { + result.Properties[key] = value + } + } + + // Set property "ReplyTo": + if filter.ReplyTo != nil { + replyTo := *filter.ReplyTo + result.ReplyTo = &replyTo + } + + // Set property "ReplyToSessionId": + if filter.ReplyToSessionId != nil { + replyToSessionId := *filter.ReplyToSessionId + result.ReplyToSessionId = &replyToSessionId + } + + // Set property "RequiresPreprocessing": + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + result.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SessionId": + if filter.SessionId != nil { + sessionId := *filter.SessionId + result.SessionId = &sessionId + } + + // Set property "To": + if filter.To != nil { + to := *filter.To + result.To = &to + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (filter *CorrelationFilter) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &CorrelationFilter_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (filter *CorrelationFilter) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(CorrelationFilter_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CorrelationFilter_ARM, got %T", armInput) + } + + // Set property "ContentType": + if typedInput.ContentType != nil { + contentType := *typedInput.ContentType + filter.ContentType = &contentType + } + + // Set property "CorrelationId": + if typedInput.CorrelationId != nil { + correlationId := *typedInput.CorrelationId + filter.CorrelationId = &correlationId + } + + // Set property "Label": + if typedInput.Label != nil { + label := *typedInput.Label + filter.Label = &label + } + + // Set property "MessageId": + if typedInput.MessageId != nil { + messageId := *typedInput.MessageId + filter.MessageId = &messageId + } + + // Set property "Properties": + if typedInput.Properties != nil { + filter.Properties = make(map[string]string, len(typedInput.Properties)) + for key, value := range typedInput.Properties { + filter.Properties[key] = value + } + } + + // Set property "ReplyTo": + if typedInput.ReplyTo != nil { + replyTo := *typedInput.ReplyTo + filter.ReplyTo = &replyTo + } + + // Set property "ReplyToSessionId": + if typedInput.ReplyToSessionId != nil { + replyToSessionId := *typedInput.ReplyToSessionId + filter.ReplyToSessionId = &replyToSessionId + } + + // Set property "RequiresPreprocessing": + if typedInput.RequiresPreprocessing != nil { + requiresPreprocessing := *typedInput.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SessionId": + if typedInput.SessionId != nil { + sessionId := *typedInput.SessionId + filter.SessionId = &sessionId + } + + // Set property "To": + if typedInput.To != nil { + to := *typedInput.To + filter.To = &to + } + + // No error + return nil +} + +// AssignProperties_From_CorrelationFilter populates our CorrelationFilter from the provided source CorrelationFilter +func (filter *CorrelationFilter) AssignProperties_From_CorrelationFilter(source *v20221001ps.CorrelationFilter) error { + + // ContentType + filter.ContentType = genruntime.ClonePointerToString(source.ContentType) + + // CorrelationId + filter.CorrelationId = genruntime.ClonePointerToString(source.CorrelationId) + + // Label + filter.Label = genruntime.ClonePointerToString(source.Label) + + // MessageId + filter.MessageId = genruntime.ClonePointerToString(source.MessageId) + + // Properties + filter.Properties = genruntime.CloneMapOfStringToString(source.Properties) + + // ReplyTo + filter.ReplyTo = genruntime.ClonePointerToString(source.ReplyTo) + + // ReplyToSessionId + filter.ReplyToSessionId = genruntime.ClonePointerToString(source.ReplyToSessionId) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SessionId + filter.SessionId = genruntime.ClonePointerToString(source.SessionId) + + // To + filter.To = genruntime.ClonePointerToString(source.To) + + // No error + return nil +} + +// AssignProperties_To_CorrelationFilter populates the provided destination CorrelationFilter from our CorrelationFilter +func (filter *CorrelationFilter) AssignProperties_To_CorrelationFilter(destination *v20221001ps.CorrelationFilter) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ContentType + destination.ContentType = genruntime.ClonePointerToString(filter.ContentType) + + // CorrelationId + destination.CorrelationId = genruntime.ClonePointerToString(filter.CorrelationId) + + // Label + destination.Label = genruntime.ClonePointerToString(filter.Label) + + // MessageId + destination.MessageId = genruntime.ClonePointerToString(filter.MessageId) + + // Properties + destination.Properties = genruntime.CloneMapOfStringToString(filter.Properties) + + // ReplyTo + destination.ReplyTo = genruntime.ClonePointerToString(filter.ReplyTo) + + // ReplyToSessionId + destination.ReplyToSessionId = genruntime.ClonePointerToString(filter.ReplyToSessionId) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SessionId + destination.SessionId = genruntime.ClonePointerToString(filter.SessionId) + + // To + destination.To = genruntime.ClonePointerToString(filter.To) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Represents the correlation filter expression. +type CorrelationFilter_STATUS struct { + // ContentType: Content type of the message. + ContentType *string `json:"contentType,omitempty"` + + // CorrelationId: Identifier of the correlation. + CorrelationId *string `json:"correlationId,omitempty"` + + // Label: Application specific label. + Label *string `json:"label,omitempty"` + + // MessageId: Identifier of the message. + MessageId *string `json:"messageId,omitempty"` + + // Properties: dictionary object for custom filters + Properties map[string]string `json:"properties,omitempty"` + + // ReplyTo: Address of the queue to reply to. + ReplyTo *string `json:"replyTo,omitempty"` + + // ReplyToSessionId: Session identifier to reply to. + ReplyToSessionId *string `json:"replyToSessionId,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SessionId: Session identifier. + SessionId *string `json:"sessionId,omitempty"` + + // To: Address to send to. + To *string `json:"to,omitempty"` +} + +var _ genruntime.FromARMConverter = &CorrelationFilter_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (filter *CorrelationFilter_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &CorrelationFilter_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (filter *CorrelationFilter_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(CorrelationFilter_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected CorrelationFilter_STATUS_ARM, got %T", armInput) + } + + // Set property "ContentType": + if typedInput.ContentType != nil { + contentType := *typedInput.ContentType + filter.ContentType = &contentType + } + + // Set property "CorrelationId": + if typedInput.CorrelationId != nil { + correlationId := *typedInput.CorrelationId + filter.CorrelationId = &correlationId + } + + // Set property "Label": + if typedInput.Label != nil { + label := *typedInput.Label + filter.Label = &label + } + + // Set property "MessageId": + if typedInput.MessageId != nil { + messageId := *typedInput.MessageId + filter.MessageId = &messageId + } + + // Set property "Properties": + if typedInput.Properties != nil { + filter.Properties = make(map[string]string, len(typedInput.Properties)) + for key, value := range typedInput.Properties { + filter.Properties[key] = value + } + } + + // Set property "ReplyTo": + if typedInput.ReplyTo != nil { + replyTo := *typedInput.ReplyTo + filter.ReplyTo = &replyTo + } + + // Set property "ReplyToSessionId": + if typedInput.ReplyToSessionId != nil { + replyToSessionId := *typedInput.ReplyToSessionId + filter.ReplyToSessionId = &replyToSessionId + } + + // Set property "RequiresPreprocessing": + if typedInput.RequiresPreprocessing != nil { + requiresPreprocessing := *typedInput.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SessionId": + if typedInput.SessionId != nil { + sessionId := *typedInput.SessionId + filter.SessionId = &sessionId + } + + // Set property "To": + if typedInput.To != nil { + to := *typedInput.To + filter.To = &to + } + + // No error + return nil +} + +// AssignProperties_From_CorrelationFilter_STATUS populates our CorrelationFilter_STATUS from the provided source CorrelationFilter_STATUS +func (filter *CorrelationFilter_STATUS) AssignProperties_From_CorrelationFilter_STATUS(source *v20221001ps.CorrelationFilter_STATUS) error { + + // ContentType + filter.ContentType = genruntime.ClonePointerToString(source.ContentType) + + // CorrelationId + filter.CorrelationId = genruntime.ClonePointerToString(source.CorrelationId) + + // Label + filter.Label = genruntime.ClonePointerToString(source.Label) + + // MessageId + filter.MessageId = genruntime.ClonePointerToString(source.MessageId) + + // Properties + filter.Properties = genruntime.CloneMapOfStringToString(source.Properties) + + // ReplyTo + filter.ReplyTo = genruntime.ClonePointerToString(source.ReplyTo) + + // ReplyToSessionId + filter.ReplyToSessionId = genruntime.ClonePointerToString(source.ReplyToSessionId) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SessionId + filter.SessionId = genruntime.ClonePointerToString(source.SessionId) + + // To + filter.To = genruntime.ClonePointerToString(source.To) + + // No error + return nil +} + +// AssignProperties_To_CorrelationFilter_STATUS populates the provided destination CorrelationFilter_STATUS from our CorrelationFilter_STATUS +func (filter *CorrelationFilter_STATUS) AssignProperties_To_CorrelationFilter_STATUS(destination *v20221001ps.CorrelationFilter_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ContentType + destination.ContentType = genruntime.ClonePointerToString(filter.ContentType) + + // CorrelationId + destination.CorrelationId = genruntime.ClonePointerToString(filter.CorrelationId) + + // Label + destination.Label = genruntime.ClonePointerToString(filter.Label) + + // MessageId + destination.MessageId = genruntime.ClonePointerToString(filter.MessageId) + + // Properties + destination.Properties = genruntime.CloneMapOfStringToString(filter.Properties) + + // ReplyTo + destination.ReplyTo = genruntime.ClonePointerToString(filter.ReplyTo) + + // ReplyToSessionId + destination.ReplyToSessionId = genruntime.ClonePointerToString(filter.ReplyToSessionId) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SessionId + destination.SessionId = genruntime.ClonePointerToString(filter.SessionId) + + // To + destination.To = genruntime.ClonePointerToString(filter.To) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Rule filter types +// +kubebuilder:validation:Enum={"CorrelationFilter","SqlFilter"} +type FilterType string + +const ( + FilterType_CorrelationFilter = FilterType("CorrelationFilter") + FilterType_SqlFilter = FilterType("SqlFilter") +) + +// Rule filter types +type FilterType_STATUS string + +const ( + FilterType_STATUS_CorrelationFilter = FilterType_STATUS("CorrelationFilter") + FilterType_STATUS_SqlFilter = FilterType_STATUS("SqlFilter") +) + +// Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. +type SqlFilter struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: The SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +var _ genruntime.ARMTransformer = &SqlFilter{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (filter *SqlFilter) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if filter == nil { + return nil, nil + } + result := &SqlFilter_ARM{} + + // Set property "CompatibilityLevel": + if filter.CompatibilityLevel != nil { + compatibilityLevel := *filter.CompatibilityLevel + result.CompatibilityLevel = &compatibilityLevel + } + + // Set property "RequiresPreprocessing": + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + result.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SqlExpression": + if filter.SqlExpression != nil { + sqlExpression := *filter.SqlExpression + result.SqlExpression = &sqlExpression + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (filter *SqlFilter) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SqlFilter_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (filter *SqlFilter) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SqlFilter_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SqlFilter_ARM, got %T", armInput) + } + + // Set property "CompatibilityLevel": + if typedInput.CompatibilityLevel != nil { + compatibilityLevel := *typedInput.CompatibilityLevel + filter.CompatibilityLevel = &compatibilityLevel + } + + // Set property "RequiresPreprocessing": + if typedInput.RequiresPreprocessing != nil { + requiresPreprocessing := *typedInput.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SqlExpression": + if typedInput.SqlExpression != nil { + sqlExpression := *typedInput.SqlExpression + filter.SqlExpression = &sqlExpression + } + + // No error + return nil +} + +// AssignProperties_From_SqlFilter populates our SqlFilter from the provided source SqlFilter +func (filter *SqlFilter) AssignProperties_From_SqlFilter(source *v20221001ps.SqlFilter) error { + + // CompatibilityLevel + filter.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SqlExpression + filter.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // No error + return nil +} + +// AssignProperties_To_SqlFilter populates the provided destination SqlFilter from our SqlFilter +func (filter *SqlFilter) AssignProperties_To_SqlFilter(destination *v20221001ps.SqlFilter) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(filter.CompatibilityLevel) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(filter.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. +type SqlFilter_STATUS struct { + // CompatibilityLevel: This property is reserved for future use. An integer value showing the compatibility level, + // currently hard-coded to 20. + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + + // RequiresPreprocessing: Value that indicates whether the rule action requires preprocessing. + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + + // SqlExpression: The SQL expression. e.g. MyProperty='ABC' + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +var _ genruntime.FromARMConverter = &SqlFilter_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (filter *SqlFilter_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &SqlFilter_STATUS_ARM{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (filter *SqlFilter_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(SqlFilter_STATUS_ARM) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected SqlFilter_STATUS_ARM, got %T", armInput) + } + + // Set property "CompatibilityLevel": + if typedInput.CompatibilityLevel != nil { + compatibilityLevel := *typedInput.CompatibilityLevel + filter.CompatibilityLevel = &compatibilityLevel + } + + // Set property "RequiresPreprocessing": + if typedInput.RequiresPreprocessing != nil { + requiresPreprocessing := *typedInput.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } + + // Set property "SqlExpression": + if typedInput.SqlExpression != nil { + sqlExpression := *typedInput.SqlExpression + filter.SqlExpression = &sqlExpression + } + + // No error + return nil +} + +// AssignProperties_From_SqlFilter_STATUS populates our SqlFilter_STATUS from the provided source SqlFilter_STATUS +func (filter *SqlFilter_STATUS) AssignProperties_From_SqlFilter_STATUS(source *v20221001ps.SqlFilter_STATUS) error { + + // CompatibilityLevel + filter.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SqlExpression + filter.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // No error + return nil +} + +// AssignProperties_To_SqlFilter_STATUS populates the provided destination SqlFilter_STATUS from our SqlFilter_STATUS +func (filter *SqlFilter_STATUS) AssignProperties_To_SqlFilter_STATUS(destination *v20221001ps.SqlFilter_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(filter.CompatibilityLevel) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(filter.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&NamespacesTopicsSubscriptionsRule{}, &NamespacesTopicsSubscriptionsRuleList{}) +} diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_types_gen_test.go new file mode 100644 index 00000000000..5e212f236b2 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscriptions_rule_types_gen_test.go @@ -0,0 +1,1050 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001preview + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" + "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_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesTopicsSubscriptionsRule, NamespacesTopicsSubscriptionsRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesTopicsSubscriptionsRule tests if a specific instance of NamespacesTopicsSubscriptionsRule round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesTopicsSubscriptionsRule(subject NamespacesTopicsSubscriptionsRule) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesTopicsSubscriptionsRule + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesTopicsSubscriptionsRule + 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_NamespacesTopicsSubscriptionsRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscriptionsRule to NamespacesTopicsSubscriptionsRule via AssignProperties_To_NamespacesTopicsSubscriptionsRule & AssignProperties_From_NamespacesTopicsSubscriptionsRule returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule, NamespacesTopicsSubscriptionsRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule tests if a specific instance of NamespacesTopicsSubscriptionsRule can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule(subject NamespacesTopicsSubscriptionsRule) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20221001ps.NamespacesTopicsSubscriptionsRule + err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscriptionsRule + err = actual.AssignProperties_From_NamespacesTopicsSubscriptionsRule(&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_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule, NamespacesTopicsSubscriptionsRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule runs a test to see if a specific instance of NamespacesTopicsSubscriptionsRule round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule(subject NamespacesTopicsSubscriptionsRule) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionsRule + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicsSubscriptionsRule instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionsRuleGenerator() +var namespacesTopicsSubscriptionsRuleGenerator gopter.Gen + +// NamespacesTopicsSubscriptionsRuleGenerator returns a generator of NamespacesTopicsSubscriptionsRule instances for property testing. +func NamespacesTopicsSubscriptionsRuleGenerator() gopter.Gen { + if namespacesTopicsSubscriptionsRuleGenerator != nil { + return namespacesTopicsSubscriptionsRuleGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule(generators) + namespacesTopicsSubscriptionsRuleGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule{}), generators) + + return namespacesTopicsSubscriptionsRuleGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Topics_Subscriptions_Rule_SpecGenerator() + gens["Status"] = Namespaces_Topics_Subscriptions_Rule_STATUSGenerator() +} + +func Test_Namespaces_Topics_Subscriptions_Rule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscriptions_Rule_Spec to Namespaces_Topics_Subscriptions_Rule_Spec via AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec & AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_Spec, Namespaces_Topics_Subscriptions_Rule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_Spec tests if a specific instance of Namespaces_Topics_Subscriptions_Rule_Spec can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_Spec(subject Namespaces_Topics_Subscriptions_Rule_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 v20221001ps.Namespaces_Topics_Subscriptions_Rule_Spec + err := copied.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscriptions_Rule_Spec + err = actual.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec, Namespaces_Topics_Subscriptions_Rule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec runs a test to see if a specific instance of Namespaces_Topics_Subscriptions_Rule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec(subject Namespaces_Topics_Subscriptions_Rule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscriptions_Rule_SpecGenerator() +var namespaces_Topics_Subscriptions_Rule_SpecGenerator gopter.Gen + +// Namespaces_Topics_Subscriptions_Rule_SpecGenerator returns a generator of Namespaces_Topics_Subscriptions_Rule_Spec instances for property testing. +// We first initialize namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_SpecGenerator() gopter.Gen { + if namespaces_Topics_Subscriptions_Rule_SpecGenerator != nil { + return namespaces_Topics_Subscriptions_Rule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(generators) + namespaces_Topics_Subscriptions_Rule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(generators) + namespaces_Topics_Subscriptions_Rule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_Spec{}), generators) + + return namespaces_Topics_Subscriptions_Rule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["FilterType"] = gen.PtrOf(gen.OneConstOf(FilterType_CorrelationFilter, FilterType_SqlFilter)) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(ActionGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilterGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilterGenerator()) +} + +func Test_Namespaces_Topics_Subscriptions_Rule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscriptions_Rule_STATUS to Namespaces_Topics_Subscriptions_Rule_STATUS via AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS & AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_STATUS, Namespaces_Topics_Subscriptions_Rule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_STATUS tests if a specific instance of Namespaces_Topics_Subscriptions_Rule_STATUS can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_STATUS(subject Namespaces_Topics_Subscriptions_Rule_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 v20221001ps.Namespaces_Topics_Subscriptions_Rule_STATUS + err := copied.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscriptions_Rule_STATUS + err = actual.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS, Namespaces_Topics_Subscriptions_Rule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS runs a test to see if a specific instance of Namespaces_Topics_Subscriptions_Rule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS(subject Namespaces_Topics_Subscriptions_Rule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscriptions_Rule_STATUSGenerator() +var namespaces_Topics_Subscriptions_Rule_STATUSGenerator gopter.Gen + +// Namespaces_Topics_Subscriptions_Rule_STATUSGenerator returns a generator of Namespaces_Topics_Subscriptions_Rule_STATUS instances for property testing. +// We first initialize namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUSGenerator() gopter.Gen { + if namespaces_Topics_Subscriptions_Rule_STATUSGenerator != nil { + return namespaces_Topics_Subscriptions_Rule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(generators) + namespaces_Topics_Subscriptions_Rule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(generators) + namespaces_Topics_Subscriptions_Rule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_STATUS{}), generators) + + return namespaces_Topics_Subscriptions_Rule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(gens map[string]gopter.Gen) { + gens["FilterType"] = gen.PtrOf(gen.OneConstOf(FilterType_STATUS_CorrelationFilter, FilterType_STATUS_SqlFilter)) + 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_Topics_Subscriptions_Rule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(Action_STATUSGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilter_STATUSGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilter_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_Action_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Action to Action via AssignProperties_To_Action & AssignProperties_From_Action returns original", + prop.ForAll(RunPropertyAssignmentTestForAction, ActionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAction tests if a specific instance of Action can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForAction(subject Action) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20221001ps.Action + err := copied.AssignProperties_To_Action(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Action + err = actual.AssignProperties_From_Action(&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_Action_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 Action via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAction, ActionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAction runs a test to see if a specific instance of Action round trips to JSON and back losslessly +func RunJSONSerializationTestForAction(subject Action) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Action + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Action instances for property testing - lazily instantiated by ActionGenerator() +var actionGenerator gopter.Gen + +// ActionGenerator returns a generator of Action instances for property testing. +func ActionGenerator() gopter.Gen { + if actionGenerator != nil { + return actionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAction(generators) + actionGenerator = gen.Struct(reflect.TypeOf(Action{}), generators) + + return actionGenerator +} + +// AddIndependentPropertyGeneratorsForAction is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAction(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Action_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Action_STATUS to Action_STATUS via AssignProperties_To_Action_STATUS & AssignProperties_From_Action_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForAction_STATUS, Action_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAction_STATUS tests if a specific instance of Action_STATUS can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForAction_STATUS(subject Action_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 v20221001ps.Action_STATUS + err := copied.AssignProperties_To_Action_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Action_STATUS + err = actual.AssignProperties_From_Action_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_Action_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 Action_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAction_STATUS, Action_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAction_STATUS runs a test to see if a specific instance of Action_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForAction_STATUS(subject Action_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Action_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 Action_STATUS instances for property testing - lazily instantiated by Action_STATUSGenerator() +var action_STATUSGenerator gopter.Gen + +// Action_STATUSGenerator returns a generator of Action_STATUS instances for property testing. +func Action_STATUSGenerator() gopter.Gen { + if action_STATUSGenerator != nil { + return action_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAction_STATUS(generators) + action_STATUSGenerator = gen.Struct(reflect.TypeOf(Action_STATUS{}), generators) + + return action_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForAction_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAction_STATUS(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CorrelationFilter_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CorrelationFilter to CorrelationFilter via AssignProperties_To_CorrelationFilter & AssignProperties_From_CorrelationFilter returns original", + prop.ForAll(RunPropertyAssignmentTestForCorrelationFilter, CorrelationFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCorrelationFilter tests if a specific instance of CorrelationFilter can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForCorrelationFilter(subject CorrelationFilter) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20221001ps.CorrelationFilter + err := copied.AssignProperties_To_CorrelationFilter(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CorrelationFilter + err = actual.AssignProperties_From_CorrelationFilter(&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_CorrelationFilter_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 CorrelationFilter via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCorrelationFilter, CorrelationFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCorrelationFilter runs a test to see if a specific instance of CorrelationFilter round trips to JSON and back losslessly +func RunJSONSerializationTestForCorrelationFilter(subject CorrelationFilter) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CorrelationFilter + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of CorrelationFilter instances for property testing - lazily instantiated by CorrelationFilterGenerator() +var correlationFilterGenerator gopter.Gen + +// CorrelationFilterGenerator returns a generator of CorrelationFilter instances for property testing. +func CorrelationFilterGenerator() gopter.Gen { + if correlationFilterGenerator != nil { + return correlationFilterGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCorrelationFilter(generators) + correlationFilterGenerator = gen.Struct(reflect.TypeOf(CorrelationFilter{}), generators) + + return correlationFilterGenerator +} + +// AddIndependentPropertyGeneratorsForCorrelationFilter is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCorrelationFilter(gens map[string]gopter.Gen) { + gens["ContentType"] = gen.PtrOf(gen.AlphaString()) + gens["CorrelationId"] = gen.PtrOf(gen.AlphaString()) + gens["Label"] = gen.PtrOf(gen.AlphaString()) + gens["MessageId"] = gen.PtrOf(gen.AlphaString()) + gens["Properties"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ReplyTo"] = gen.PtrOf(gen.AlphaString()) + gens["ReplyToSessionId"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SessionId"] = gen.PtrOf(gen.AlphaString()) + gens["To"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CorrelationFilter_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CorrelationFilter_STATUS to CorrelationFilter_STATUS via AssignProperties_To_CorrelationFilter_STATUS & AssignProperties_From_CorrelationFilter_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForCorrelationFilter_STATUS, CorrelationFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCorrelationFilter_STATUS tests if a specific instance of CorrelationFilter_STATUS can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForCorrelationFilter_STATUS(subject CorrelationFilter_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 v20221001ps.CorrelationFilter_STATUS + err := copied.AssignProperties_To_CorrelationFilter_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CorrelationFilter_STATUS + err = actual.AssignProperties_From_CorrelationFilter_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_CorrelationFilter_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 CorrelationFilter_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCorrelationFilter_STATUS, CorrelationFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCorrelationFilter_STATUS runs a test to see if a specific instance of CorrelationFilter_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCorrelationFilter_STATUS(subject CorrelationFilter_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CorrelationFilter_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 CorrelationFilter_STATUS instances for property testing - lazily instantiated by +// CorrelationFilter_STATUSGenerator() +var correlationFilter_STATUSGenerator gopter.Gen + +// CorrelationFilter_STATUSGenerator returns a generator of CorrelationFilter_STATUS instances for property testing. +func CorrelationFilter_STATUSGenerator() gopter.Gen { + if correlationFilter_STATUSGenerator != nil { + return correlationFilter_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS(generators) + correlationFilter_STATUSGenerator = gen.Struct(reflect.TypeOf(CorrelationFilter_STATUS{}), generators) + + return correlationFilter_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS(gens map[string]gopter.Gen) { + gens["ContentType"] = gen.PtrOf(gen.AlphaString()) + gens["CorrelationId"] = gen.PtrOf(gen.AlphaString()) + gens["Label"] = gen.PtrOf(gen.AlphaString()) + gens["MessageId"] = gen.PtrOf(gen.AlphaString()) + gens["Properties"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ReplyTo"] = gen.PtrOf(gen.AlphaString()) + gens["ReplyToSessionId"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SessionId"] = gen.PtrOf(gen.AlphaString()) + gens["To"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SqlFilter_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SqlFilter to SqlFilter via AssignProperties_To_SqlFilter & AssignProperties_From_SqlFilter returns original", + prop.ForAll(RunPropertyAssignmentTestForSqlFilter, SqlFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSqlFilter tests if a specific instance of SqlFilter can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForSqlFilter(subject SqlFilter) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other v20221001ps.SqlFilter + err := copied.AssignProperties_To_SqlFilter(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SqlFilter + err = actual.AssignProperties_From_SqlFilter(&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_SqlFilter_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 SqlFilter via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSqlFilter, SqlFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSqlFilter runs a test to see if a specific instance of SqlFilter round trips to JSON and back losslessly +func RunJSONSerializationTestForSqlFilter(subject SqlFilter) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SqlFilter + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SqlFilter instances for property testing - lazily instantiated by SqlFilterGenerator() +var sqlFilterGenerator gopter.Gen + +// SqlFilterGenerator returns a generator of SqlFilter instances for property testing. +func SqlFilterGenerator() gopter.Gen { + if sqlFilterGenerator != nil { + return sqlFilterGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSqlFilter(generators) + sqlFilterGenerator = gen.Struct(reflect.TypeOf(SqlFilter{}), generators) + + return sqlFilterGenerator +} + +// AddIndependentPropertyGeneratorsForSqlFilter is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSqlFilter(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SqlFilter_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SqlFilter_STATUS to SqlFilter_STATUS via AssignProperties_To_SqlFilter_STATUS & AssignProperties_From_SqlFilter_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSqlFilter_STATUS, SqlFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSqlFilter_STATUS tests if a specific instance of SqlFilter_STATUS can be assigned to v1api20221001previewstorage and back losslessly +func RunPropertyAssignmentTestForSqlFilter_STATUS(subject SqlFilter_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 v20221001ps.SqlFilter_STATUS + err := copied.AssignProperties_To_SqlFilter_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SqlFilter_STATUS + err = actual.AssignProperties_From_SqlFilter_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_SqlFilter_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 SqlFilter_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSqlFilter_STATUS, SqlFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSqlFilter_STATUS runs a test to see if a specific instance of SqlFilter_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSqlFilter_STATUS(subject SqlFilter_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SqlFilter_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 SqlFilter_STATUS instances for property testing - lazily instantiated by SqlFilter_STATUSGenerator() +var sqlFilter_STATUSGenerator gopter.Gen + +// SqlFilter_STATUSGenerator returns a generator of SqlFilter_STATUS instances for property testing. +func SqlFilter_STATUSGenerator() gopter.Gen { + if sqlFilter_STATUSGenerator != nil { + return sqlFilter_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSqlFilter_STATUS(generators) + sqlFilter_STATUSGenerator = gen.Struct(reflect.TypeOf(SqlFilter_STATUS{}), generators) + + return sqlFilter_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSqlFilter_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSqlFilter_STATUS(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/servicebus/v1api20221001preview/structure.txt b/v2/api/servicebus/v1api20221001preview/structure.txt new file mode 100644 index 00000000000..05617c7d2a1 --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/structure.txt @@ -0,0 +1,904 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview +├── APIVersion: Enum (1 value) +│ └── "2022-10-01-preview" +├── Namespace: Resource +│ ├── Owner: github.com/Azure/azure-service-operator/v2/api/resources/v1apiv20191001.ResourceGroup +│ ├── Spec: Object (14 properties) +│ │ ├── AlternateName: *string +│ │ ├── AzureName: string +│ │ ├── 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 +│ │ ├── Location: *string +│ │ ├── MinimumTlsVersion: *Enum (3 values) +│ │ │ ├── "1.0" +│ │ │ ├── "1.1" +│ │ │ └── "1.2" +│ │ ├── OperatorSpec: *Object (1 property) +│ │ │ └── Secrets: *Object (5 properties) +│ │ │ ├── Endpoint: *genruntime.SecretDestination +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PremiumMessagingPartitions: *int +│ │ ├── PublicNetworkAccess: *Enum (3 values) +│ │ │ ├── "Disabled" +│ │ │ ├── "Enabled" +│ │ │ └── "SecuredByPerimeter" +│ │ ├── Sku: *Object (3 properties) +│ │ │ ├── Capacity: *int +│ │ │ ├── Name: *Enum (3 values) +│ │ │ │ ├── "Basic" +│ │ │ │ ├── "Premium" +│ │ │ │ └── "Standard" +│ │ │ └── Tier: *Enum (3 values) +│ │ │ ├── "Basic" +│ │ │ ├── "Premium" +│ │ │ └── "Standard" +│ │ ├── Tags: map[string]string +│ │ └── ZoneRedundant: *bool +│ └── Status: Object (23 properties) +│ ├── AlternateName: *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 +│ ├── Location: *string +│ ├── MetricId: *string +│ ├── MinimumTlsVersion: *Enum (3 values) +│ │ ├── "1.0" +│ │ ├── "1.1" +│ │ └── "1.2" +│ ├── Name: *string +│ ├── PremiumMessagingPartitions: *int +│ ├── 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 (14 properties) +│ │ ├── AlternateName: *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 +│ │ ├── MetricId: *string +│ │ ├── MinimumTlsVersion: *Enum (3 values) +│ │ │ ├── "1.0" +│ │ │ ├── "1.1" +│ │ │ └── "1.2" +│ │ ├── PremiumMessagingPartitions: *int +│ │ ├── 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 (7 properties) +│ │ ├── AlternateName: *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 +│ │ ├── MinimumTlsVersion: *Enum (3 values) +│ │ │ ├── "1.0" +│ │ │ ├── "1.1" +│ │ │ └── "1.2" +│ │ ├── PremiumMessagingPartitions: *int +│ │ ├── 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 (2 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ └── Rule 1: 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 +├── NamespacesQueue: Resource +│ ├── Owner: Namespace +│ ├── Spec: Object (17 properties) +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── AzureName: Validated (1 rule) +│ │ │ └── Rule 0: MinLength: 1 +│ │ ├── DeadLetteringOnMessageExpiration: *bool +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── EnableExpress: *bool +│ │ ├── EnablePartitioning: *bool +│ │ ├── ForwardDeadLetteredMessagesTo: *string +│ │ ├── ForwardTo: *string +│ │ ├── LockDuration: *string +│ │ ├── MaxDeliveryCount: *int +│ │ ├── MaxMessageSizeInKilobytes: *int +│ │ ├── MaxSizeInMegabytes: *int +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── RequiresDuplicateDetection: *bool +│ │ └── RequiresSession: *bool +│ └── Status: Object (28 properties) +│ ├── AccessedAt: *string +│ ├── AutoDeleteOnIdle: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CountDetails: *Object (5 properties) +│ │ ├── ActiveMessageCount: *int +│ │ ├── DeadLetterMessageCount: *int +│ │ ├── ScheduledMessageCount: *int +│ │ ├── TransferDeadLetterMessageCount: *int +│ │ └── TransferMessageCount: *int +│ ├── CreatedAt: *string +│ ├── DeadLetteringOnMessageExpiration: *bool +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── EnableExpress: *bool +│ ├── EnablePartitioning: *bool +│ ├── ForwardDeadLetteredMessagesTo: *string +│ ├── ForwardTo: *string +│ ├── Id: *string +│ ├── Location: *string +│ ├── LockDuration: *string +│ ├── MaxDeliveryCount: *int +│ ├── MaxMessageSizeInKilobytes: *int +│ ├── MaxSizeInMegabytes: *int +│ ├── MessageCount: *int +│ ├── Name: *string +│ ├── RequiresDuplicateDetection: *bool +│ ├── RequiresSession: *bool +│ ├── SizeInBytes: *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 +├── NamespacesTopic: Resource +│ ├── Owner: Namespace +│ ├── Spec: Object (12 properties) +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── AzureName: Validated (1 rule) +│ │ │ └── Rule 0: MinLength: 1 +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── EnableExpress: *bool +│ │ ├── EnablePartitioning: *bool +│ │ ├── MaxMessageSizeInKilobytes: *int +│ │ ├── MaxSizeInMegabytes: *int +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── RequiresDuplicateDetection: *bool +│ │ └── SupportOrdering: *bool +│ └── Status: Object (23 properties) +│ ├── AccessedAt: *string +│ ├── AutoDeleteOnIdle: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CountDetails: *Object (5 properties) +│ │ ├── ActiveMessageCount: *int +│ │ ├── DeadLetterMessageCount: *int +│ │ ├── ScheduledMessageCount: *int +│ │ ├── TransferDeadLetterMessageCount: *int +│ │ └── TransferMessageCount: *int +│ ├── CreatedAt: *string +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── EnableExpress: *bool +│ ├── EnablePartitioning: *bool +│ ├── Id: *string +│ ├── Location: *string +│ ├── MaxMessageSizeInKilobytes: *int +│ ├── MaxSizeInMegabytes: *int +│ ├── Name: *string +│ ├── RequiresDuplicateDetection: *bool +│ ├── SizeInBytes: *int +│ ├── Status: *Enum (9 values) +│ │ ├── "Active" +│ │ ├── "Creating" +│ │ ├── "Deleting" +│ │ ├── "Disabled" +│ │ ├── "ReceiveDisabled" +│ │ ├── "Renaming" +│ │ ├── "Restoring" +│ │ ├── "SendDisabled" +│ │ └── "Unknown" +│ ├── SubscriptionCount: *int +│ ├── SupportOrdering: *bool +│ ├── SystemData: *Object (6 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *Enum (4 values) +│ │ │ ├── "Application" +│ │ │ ├── "Key" +│ │ │ ├── "ManagedIdentity" +│ │ │ └── "User" +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ └── LastModifiedByType: *Enum (4 values) +│ │ ├── "Application" +│ │ ├── "Key" +│ │ ├── "ManagedIdentity" +│ │ └── "User" +│ ├── Type: *string +│ └── UpdatedAt: *string +├── NamespacesTopicsSubscription: Resource +│ ├── Owner: NamespacesTopic +│ ├── Spec: Object (15 properties) +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── AzureName: Validated (2 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ └── Rule 1: MinLength: 1 +│ │ ├── ClientAffineProperties: *Object (3 properties) +│ │ │ ├── ClientId: *string +│ │ │ ├── IsDurable: *bool +│ │ │ └── IsShared: *bool +│ │ ├── DeadLetteringOnFilterEvaluationExceptions: *bool +│ │ ├── DeadLetteringOnMessageExpiration: *bool +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── ForwardDeadLetteredMessagesTo: *string +│ │ ├── ForwardTo: *string +│ │ ├── IsClientAffine: *bool +│ │ ├── LockDuration: *string +│ │ ├── MaxDeliveryCount: *int +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ └── RequiresSession: *bool +│ └── Status: Object (25 properties) +│ ├── AccessedAt: *string +│ ├── AutoDeleteOnIdle: *string +│ ├── ClientAffineProperties: *Object (3 properties) +│ │ ├── ClientId: *string +│ │ ├── IsDurable: *bool +│ │ └── IsShared: *bool +│ ├── Conditions: conditions.Condition[] +│ ├── CountDetails: *Object (5 properties) +│ │ ├── ActiveMessageCount: *int +│ │ ├── DeadLetterMessageCount: *int +│ │ ├── ScheduledMessageCount: *int +│ │ ├── TransferDeadLetterMessageCount: *int +│ │ └── TransferMessageCount: *int +│ ├── CreatedAt: *string +│ ├── DeadLetteringOnFilterEvaluationExceptions: *bool +│ ├── DeadLetteringOnMessageExpiration: *bool +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── ForwardDeadLetteredMessagesTo: *string +│ ├── ForwardTo: *string +│ ├── Id: *string +│ ├── IsClientAffine: *bool +│ ├── Location: *string +│ ├── LockDuration: *string +│ ├── MaxDeliveryCount: *int +│ ├── MessageCount: *int +│ ├── Name: *string +│ ├── RequiresSession: *bool +│ ├── 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 +├── NamespacesTopicsSubscriptionsRule: Resource +│ ├── Owner: NamespacesTopicsSubscription +│ ├── Spec: Object (6 properties) +│ │ ├── Action: *Object (3 properties) +│ │ │ ├── CompatibilityLevel: *int +│ │ │ ├── RequiresPreprocessing: *bool +│ │ │ └── SqlExpression: *string +│ │ ├── AzureName: Validated (2 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ └── Rule 1: MinLength: 1 +│ │ ├── CorrelationFilter: *Object (10 properties) +│ │ │ ├── ContentType: *string +│ │ │ ├── CorrelationId: *string +│ │ │ ├── Label: *string +│ │ │ ├── MessageId: *string +│ │ │ ├── Properties: map[string]string +│ │ │ ├── ReplyTo: *string +│ │ │ ├── ReplyToSessionId: *string +│ │ │ ├── RequiresPreprocessing: *bool +│ │ │ ├── SessionId: *string +│ │ │ └── To: *string +│ │ ├── FilterType: *Enum (2 values) +│ │ │ ├── "CorrelationFilter" +│ │ │ └── "SqlFilter" +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ └── SqlFilter: *Object (3 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *string +│ └── Status: Object (10 properties) +│ ├── Action: *Object (3 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CorrelationFilter: *Object (10 properties) +│ │ ├── ContentType: *string +│ │ ├── CorrelationId: *string +│ │ ├── Label: *string +│ │ ├── MessageId: *string +│ │ ├── Properties: map[string]string +│ │ ├── ReplyTo: *string +│ │ ├── ReplyToSessionId: *string +│ │ ├── RequiresPreprocessing: *bool +│ │ ├── SessionId: *string +│ │ └── To: *string +│ ├── FilterType: *Enum (2 values) +│ │ ├── "CorrelationFilter" +│ │ └── "SqlFilter" +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── SqlFilter: *Object (3 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *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_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_Queue_STATUS_ARM: Object (6 properties) +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Properties: *Object (22 properties) +│ │ ├── AccessedAt: *string +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── CountDetails: *Object (5 properties) +│ │ │ ├── ActiveMessageCount: *int +│ │ │ ├── DeadLetterMessageCount: *int +│ │ │ ├── ScheduledMessageCount: *int +│ │ │ ├── TransferDeadLetterMessageCount: *int +│ │ │ └── TransferMessageCount: *int +│ │ ├── CreatedAt: *string +│ │ ├── DeadLetteringOnMessageExpiration: *bool +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── EnableExpress: *bool +│ │ ├── EnablePartitioning: *bool +│ │ ├── ForwardDeadLetteredMessagesTo: *string +│ │ ├── ForwardTo: *string +│ │ ├── LockDuration: *string +│ │ ├── MaxDeliveryCount: *int +│ │ ├── MaxMessageSizeInKilobytes: *int +│ │ ├── MaxSizeInMegabytes: *int +│ │ ├── MessageCount: *int +│ │ ├── RequiresDuplicateDetection: *bool +│ │ ├── RequiresSession: *bool +│ │ ├── SizeInBytes: *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_Queue_Spec_ARM: Object (2 properties) +│ ├── Name: string +│ └── Properties: *Object (15 properties) +│ ├── AutoDeleteOnIdle: *string +│ ├── DeadLetteringOnMessageExpiration: *bool +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── EnableExpress: *bool +│ ├── EnablePartitioning: *bool +│ ├── ForwardDeadLetteredMessagesTo: *string +│ ├── ForwardTo: *string +│ ├── LockDuration: *string +│ ├── MaxDeliveryCount: *int +│ ├── MaxMessageSizeInKilobytes: *int +│ ├── MaxSizeInMegabytes: *int +│ ├── RequiresDuplicateDetection: *bool +│ └── RequiresSession: *bool +├── Namespaces_Topic_STATUS_ARM: Object (6 properties) +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Properties: *Object (17 properties) +│ │ ├── AccessedAt: *string +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── CountDetails: *Object (5 properties) +│ │ │ ├── ActiveMessageCount: *int +│ │ │ ├── DeadLetterMessageCount: *int +│ │ │ ├── ScheduledMessageCount: *int +│ │ │ ├── TransferDeadLetterMessageCount: *int +│ │ │ └── TransferMessageCount: *int +│ │ ├── CreatedAt: *string +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── EnableExpress: *bool +│ │ ├── EnablePartitioning: *bool +│ │ ├── MaxMessageSizeInKilobytes: *int +│ │ ├── MaxSizeInMegabytes: *int +│ │ ├── RequiresDuplicateDetection: *bool +│ │ ├── SizeInBytes: *int +│ │ ├── Status: *Enum (9 values) +│ │ │ ├── "Active" +│ │ │ ├── "Creating" +│ │ │ ├── "Deleting" +│ │ │ ├── "Disabled" +│ │ │ ├── "ReceiveDisabled" +│ │ │ ├── "Renaming" +│ │ │ ├── "Restoring" +│ │ │ ├── "SendDisabled" +│ │ │ └── "Unknown" +│ │ ├── SubscriptionCount: *int +│ │ ├── SupportOrdering: *bool +│ │ └── 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_Topic_Spec_ARM: Object (2 properties) +│ ├── Name: string +│ └── Properties: *Object (10 properties) +│ ├── AutoDeleteOnIdle: *string +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── EnableExpress: *bool +│ ├── EnablePartitioning: *bool +│ ├── MaxMessageSizeInKilobytes: *int +│ ├── MaxSizeInMegabytes: *int +│ ├── RequiresDuplicateDetection: *bool +│ └── SupportOrdering: *bool +├── Namespaces_Topics_Subscription_STATUS_ARM: Object (6 properties) +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Properties: *Object (19 properties) +│ │ ├── AccessedAt: *string +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── ClientAffineProperties: *Object (3 properties) +│ │ │ ├── ClientId: *string +│ │ │ ├── IsDurable: *bool +│ │ │ └── IsShared: *bool +│ │ ├── CountDetails: *Object (5 properties) +│ │ │ ├── ActiveMessageCount: *int +│ │ │ ├── DeadLetterMessageCount: *int +│ │ │ ├── ScheduledMessageCount: *int +│ │ │ ├── TransferDeadLetterMessageCount: *int +│ │ │ └── TransferMessageCount: *int +│ │ ├── CreatedAt: *string +│ │ ├── DeadLetteringOnFilterEvaluationExceptions: *bool +│ │ ├── DeadLetteringOnMessageExpiration: *bool +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── ForwardDeadLetteredMessagesTo: *string +│ │ ├── ForwardTo: *string +│ │ ├── IsClientAffine: *bool +│ │ ├── LockDuration: *string +│ │ ├── MaxDeliveryCount: *int +│ │ ├── MessageCount: *int +│ │ ├── RequiresSession: *bool +│ │ ├── 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_Topics_Subscription_Spec_ARM: Object (2 properties) +│ ├── Name: string +│ └── Properties: *Object (13 properties) +│ ├── AutoDeleteOnIdle: *string +│ ├── ClientAffineProperties: *Object (3 properties) +│ │ ├── ClientId: *string +│ │ ├── IsDurable: *bool +│ │ └── IsShared: *bool +│ ├── DeadLetteringOnFilterEvaluationExceptions: *bool +│ ├── DeadLetteringOnMessageExpiration: *bool +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── ForwardDeadLetteredMessagesTo: *string +│ ├── ForwardTo: *string +│ ├── IsClientAffine: *bool +│ ├── LockDuration: *string +│ ├── MaxDeliveryCount: *int +│ └── RequiresSession: *bool +├── Namespaces_Topics_Subscriptions_Rule_STATUS_ARM: Object (6 properties) +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── Properties: *Object (4 properties) +│ │ ├── Action: *Object (3 properties) +│ │ │ ├── CompatibilityLevel: *int +│ │ │ ├── RequiresPreprocessing: *bool +│ │ │ └── SqlExpression: *string +│ │ ├── CorrelationFilter: *Object (10 properties) +│ │ │ ├── ContentType: *string +│ │ │ ├── CorrelationId: *string +│ │ │ ├── Label: *string +│ │ │ ├── MessageId: *string +│ │ │ ├── Properties: map[string]string +│ │ │ ├── ReplyTo: *string +│ │ │ ├── ReplyToSessionId: *string +│ │ │ ├── RequiresPreprocessing: *bool +│ │ │ ├── SessionId: *string +│ │ │ └── To: *string +│ │ ├── FilterType: *Enum (2 values) +│ │ │ ├── "CorrelationFilter" +│ │ │ └── "SqlFilter" +│ │ └── SqlFilter: *Object (3 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *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_Topics_Subscriptions_Rule_Spec_ARM: Object (2 properties) + ├── Name: string + └── Properties: *Object (4 properties) + ├── Action: *Object (3 properties) + │ ├── CompatibilityLevel: *int + │ ├── RequiresPreprocessing: *bool + │ └── SqlExpression: *string + ├── CorrelationFilter: *Object (10 properties) + │ ├── ContentType: *string + │ ├── CorrelationId: *string + │ ├── Label: *string + │ ├── MessageId: *string + │ ├── Properties: map[string]string + │ ├── ReplyTo: *string + │ ├── ReplyToSessionId: *string + │ ├── RequiresPreprocessing: *bool + │ ├── SessionId: *string + │ └── To: *string + ├── FilterType: *Enum (2 values) + │ ├── "CorrelationFilter" + │ └── "SqlFilter" + └── SqlFilter: *Object (3 properties) + ├── CompatibilityLevel: *int + ├── RequiresPreprocessing: *bool + └── SqlExpression: *string diff --git a/v2/api/servicebus/v1api20221001preview/zz_generated.deepcopy.go b/v2/api/servicebus/v1api20221001preview/zz_generated.deepcopy.go new file mode 100644 index 00000000000..450cda8275b --- /dev/null +++ b/v2/api/servicebus/v1api20221001preview/zz_generated.deepcopy.go @@ -0,0 +1,4332 @@ +//go:build !ignore_autogenerated + +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1api20221001preview + +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 *Action) DeepCopyInto(out *Action) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action. +func (in *Action) DeepCopy() *Action { + if in == nil { + return nil + } + out := new(Action) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Action_ARM) DeepCopyInto(out *Action_ARM) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action_ARM. +func (in *Action_ARM) DeepCopy() *Action_ARM { + if in == nil { + return nil + } + out := new(Action_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 *Action_STATUS) DeepCopyInto(out *Action_STATUS) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action_STATUS. +func (in *Action_STATUS) DeepCopy() *Action_STATUS { + if in == nil { + return nil + } + out := new(Action_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 *Action_STATUS_ARM) DeepCopyInto(out *Action_STATUS_ARM) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action_STATUS_ARM. +func (in *Action_STATUS_ARM) DeepCopy() *Action_STATUS_ARM { + if in == nil { + return nil + } + out := new(Action_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 *CorrelationFilter) DeepCopyInto(out *CorrelationFilter) { + *out = *in + if in.ContentType != nil { + in, out := &in.ContentType, &out.ContentType + *out = new(string) + **out = **in + } + if in.CorrelationId != nil { + in, out := &in.CorrelationId, &out.CorrelationId + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MessageId != nil { + in, out := &in.MessageId, &out.MessageId + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ReplyTo != nil { + in, out := &in.ReplyTo, &out.ReplyTo + *out = new(string) + **out = **in + } + if in.ReplyToSessionId != nil { + in, out := &in.ReplyToSessionId, &out.ReplyToSessionId + *out = new(string) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SessionId != nil { + in, out := &in.SessionId, &out.SessionId + *out = new(string) + **out = **in + } + if in.To != nil { + in, out := &in.To, &out.To + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelationFilter. +func (in *CorrelationFilter) DeepCopy() *CorrelationFilter { + if in == nil { + return nil + } + out := new(CorrelationFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CorrelationFilter_ARM) DeepCopyInto(out *CorrelationFilter_ARM) { + *out = *in + if in.ContentType != nil { + in, out := &in.ContentType, &out.ContentType + *out = new(string) + **out = **in + } + if in.CorrelationId != nil { + in, out := &in.CorrelationId, &out.CorrelationId + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MessageId != nil { + in, out := &in.MessageId, &out.MessageId + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ReplyTo != nil { + in, out := &in.ReplyTo, &out.ReplyTo + *out = new(string) + **out = **in + } + if in.ReplyToSessionId != nil { + in, out := &in.ReplyToSessionId, &out.ReplyToSessionId + *out = new(string) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SessionId != nil { + in, out := &in.SessionId, &out.SessionId + *out = new(string) + **out = **in + } + if in.To != nil { + in, out := &in.To, &out.To + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelationFilter_ARM. +func (in *CorrelationFilter_ARM) DeepCopy() *CorrelationFilter_ARM { + if in == nil { + return nil + } + out := new(CorrelationFilter_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 *CorrelationFilter_STATUS) DeepCopyInto(out *CorrelationFilter_STATUS) { + *out = *in + if in.ContentType != nil { + in, out := &in.ContentType, &out.ContentType + *out = new(string) + **out = **in + } + if in.CorrelationId != nil { + in, out := &in.CorrelationId, &out.CorrelationId + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MessageId != nil { + in, out := &in.MessageId, &out.MessageId + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ReplyTo != nil { + in, out := &in.ReplyTo, &out.ReplyTo + *out = new(string) + **out = **in + } + if in.ReplyToSessionId != nil { + in, out := &in.ReplyToSessionId, &out.ReplyToSessionId + *out = new(string) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SessionId != nil { + in, out := &in.SessionId, &out.SessionId + *out = new(string) + **out = **in + } + if in.To != nil { + in, out := &in.To, &out.To + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelationFilter_STATUS. +func (in *CorrelationFilter_STATUS) DeepCopy() *CorrelationFilter_STATUS { + if in == nil { + return nil + } + out := new(CorrelationFilter_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 *CorrelationFilter_STATUS_ARM) DeepCopyInto(out *CorrelationFilter_STATUS_ARM) { + *out = *in + if in.ContentType != nil { + in, out := &in.ContentType, &out.ContentType + *out = new(string) + **out = **in + } + if in.CorrelationId != nil { + in, out := &in.CorrelationId, &out.CorrelationId + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MessageId != nil { + in, out := &in.MessageId, &out.MessageId + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ReplyTo != nil { + in, out := &in.ReplyTo, &out.ReplyTo + *out = new(string) + **out = **in + } + if in.ReplyToSessionId != nil { + in, out := &in.ReplyToSessionId, &out.ReplyToSessionId + *out = new(string) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SessionId != nil { + in, out := &in.SessionId, &out.SessionId + *out = new(string) + **out = **in + } + if in.To != nil { + in, out := &in.To, &out.To + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelationFilter_STATUS_ARM. +func (in *CorrelationFilter_STATUS_ARM) DeepCopy() *CorrelationFilter_STATUS_ARM { + if in == nil { + return nil + } + out := new(CorrelationFilter_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 *MessageCountDetails_STATUS) DeepCopyInto(out *MessageCountDetails_STATUS) { + *out = *in + if in.ActiveMessageCount != nil { + in, out := &in.ActiveMessageCount, &out.ActiveMessageCount + *out = new(int) + **out = **in + } + if in.DeadLetterMessageCount != nil { + in, out := &in.DeadLetterMessageCount, &out.DeadLetterMessageCount + *out = new(int) + **out = **in + } + if in.ScheduledMessageCount != nil { + in, out := &in.ScheduledMessageCount, &out.ScheduledMessageCount + *out = new(int) + **out = **in + } + if in.TransferDeadLetterMessageCount != nil { + in, out := &in.TransferDeadLetterMessageCount, &out.TransferDeadLetterMessageCount + *out = new(int) + **out = **in + } + if in.TransferMessageCount != nil { + in, out := &in.TransferMessageCount, &out.TransferMessageCount + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageCountDetails_STATUS. +func (in *MessageCountDetails_STATUS) DeepCopy() *MessageCountDetails_STATUS { + if in == nil { + return nil + } + out := new(MessageCountDetails_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 *MessageCountDetails_STATUS_ARM) DeepCopyInto(out *MessageCountDetails_STATUS_ARM) { + *out = *in + if in.ActiveMessageCount != nil { + in, out := &in.ActiveMessageCount, &out.ActiveMessageCount + *out = new(int) + **out = **in + } + if in.DeadLetterMessageCount != nil { + in, out := &in.DeadLetterMessageCount, &out.DeadLetterMessageCount + *out = new(int) + **out = **in + } + if in.ScheduledMessageCount != nil { + in, out := &in.ScheduledMessageCount, &out.ScheduledMessageCount + *out = new(int) + **out = **in + } + if in.TransferDeadLetterMessageCount != nil { + in, out := &in.TransferDeadLetterMessageCount, &out.TransferDeadLetterMessageCount + *out = new(int) + **out = **in + } + if in.TransferMessageCount != nil { + in, out := &in.TransferMessageCount, &out.TransferMessageCount + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageCountDetails_STATUS_ARM. +func (in *MessageCountDetails_STATUS_ARM) DeepCopy() *MessageCountDetails_STATUS_ARM { + if in == nil { + return nil + } + out := new(MessageCountDetails_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.Endpoint != nil { + in, out := &in.Endpoint, &out.Endpoint + *out = new(genruntime.SecretDestination) + **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_STATUS) DeepCopyInto(out *Namespace_STATUS) { + *out = *in + if in.AlternateName != nil { + in, out := &in.AlternateName, &out.AlternateName + *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.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **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(SBNamespaceProperties_MinimumTlsVersion_STATUS) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PremiumMessagingPartitions != nil { + in, out := &in.PremiumMessagingPartitions, &out.PremiumMessagingPartitions + *out = new(int) + **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(SBNamespaceProperties_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(SBSku_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(SBNamespaceProperties_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(SBSku_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.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.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.MinimumTlsVersion != nil { + in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion + *out = new(SBNamespaceProperties_MinimumTlsVersion) + **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.PremiumMessagingPartitions != nil { + in, out := &in.PremiumMessagingPartitions, &out.PremiumMessagingPartitions + *out = new(int) + **out = **in + } + if in.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(SBNamespaceProperties_PublicNetworkAccess) + **out = **in + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(SBSku) + (*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(SBNamespaceProperties_ARM) + (*in).DeepCopyInto(*out) + } + if in.Sku != nil { + in, out := &in.Sku, &out.Sku + *out = new(SBSku_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 *NamespacesQueue) DeepCopyInto(out *NamespacesQueue) { + *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 NamespacesQueue. +func (in *NamespacesQueue) DeepCopy() *NamespacesQueue { + if in == nil { + return nil + } + out := new(NamespacesQueue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesQueue) 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 *NamespacesQueueList) DeepCopyInto(out *NamespacesQueueList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesQueue, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesQueueList. +func (in *NamespacesQueueList) DeepCopy() *NamespacesQueueList { + if in == nil { + return nil + } + out := new(NamespacesQueueList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesQueueList) 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 *NamespacesTopic) DeepCopyInto(out *NamespacesTopic) { + *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 NamespacesTopic. +func (in *NamespacesTopic) DeepCopy() *NamespacesTopic { + if in == nil { + return nil + } + out := new(NamespacesTopic) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopic) 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 *NamespacesTopicList) DeepCopyInto(out *NamespacesTopicList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesTopic, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicList. +func (in *NamespacesTopicList) DeepCopy() *NamespacesTopicList { + if in == nil { + return nil + } + out := new(NamespacesTopicList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicList) 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 *NamespacesTopicsSubscription) DeepCopyInto(out *NamespacesTopicsSubscription) { + *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 NamespacesTopicsSubscription. +func (in *NamespacesTopicsSubscription) DeepCopy() *NamespacesTopicsSubscription { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscription) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscription) 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 *NamespacesTopicsSubscriptionList) DeepCopyInto(out *NamespacesTopicsSubscriptionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesTopicsSubscription, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicsSubscriptionList. +func (in *NamespacesTopicsSubscriptionList) DeepCopy() *NamespacesTopicsSubscriptionList { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscriptionList) 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 *NamespacesTopicsSubscriptionsRule) DeepCopyInto(out *NamespacesTopicsSubscriptionsRule) { + *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 NamespacesTopicsSubscriptionsRule. +func (in *NamespacesTopicsSubscriptionsRule) DeepCopy() *NamespacesTopicsSubscriptionsRule { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscriptionsRule) 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 *NamespacesTopicsSubscriptionsRuleList) DeepCopyInto(out *NamespacesTopicsSubscriptionsRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesTopicsSubscriptionsRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicsSubscriptionsRuleList. +func (in *NamespacesTopicsSubscriptionsRuleList) DeepCopy() *NamespacesTopicsSubscriptionsRuleList { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscriptionsRuleList) 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_Queue_STATUS) DeepCopyInto(out *Namespaces_Queue_STATUS) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *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.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *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.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.MessageCount != nil { + in, out := &in.MessageCount, &out.MessageCount + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } + if in.SizeInBytes != nil { + in, out := &in.SizeInBytes, &out.SizeInBytes + *out = new(int) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EntityStatus_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_Queue_STATUS. +func (in *Namespaces_Queue_STATUS) DeepCopy() *Namespaces_Queue_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Queue_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_Queue_STATUS_ARM) DeepCopyInto(out *Namespaces_Queue_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(SBQueueProperties_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_Queue_STATUS_ARM. +func (in *Namespaces_Queue_STATUS_ARM) DeepCopy() *Namespaces_Queue_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Queue_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_Queue_Spec) DeepCopyInto(out *Namespaces_Queue_Spec) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Queue_Spec. +func (in *Namespaces_Queue_Spec) DeepCopy() *Namespaces_Queue_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Queue_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_Queue_Spec_ARM) DeepCopyInto(out *Namespaces_Queue_Spec_ARM) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(SBQueueProperties_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Queue_Spec_ARM. +func (in *Namespaces_Queue_Spec_ARM) DeepCopy() *Namespaces_Queue_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Queue_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_Topic_STATUS) DeepCopyInto(out *Namespaces_Topic_STATUS) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *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.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **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.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.SizeInBytes != nil { + in, out := &in.SizeInBytes, &out.SizeInBytes + *out = new(int) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EntityStatus_STATUS) + **out = **in + } + if in.SubscriptionCount != nil { + in, out := &in.SubscriptionCount, &out.SubscriptionCount + *out = new(int) + **out = **in + } + if in.SupportOrdering != nil { + in, out := &in.SupportOrdering, &out.SupportOrdering + *out = new(bool) + **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_Topic_STATUS. +func (in *Namespaces_Topic_STATUS) DeepCopy() *Namespaces_Topic_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Topic_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_Topic_STATUS_ARM) DeepCopyInto(out *Namespaces_Topic_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(SBTopicProperties_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_Topic_STATUS_ARM. +func (in *Namespaces_Topic_STATUS_ARM) DeepCopy() *Namespaces_Topic_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Topic_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_Topic_Spec) DeepCopyInto(out *Namespaces_Topic_Spec) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.SupportOrdering != nil { + in, out := &in.SupportOrdering, &out.SupportOrdering + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topic_Spec. +func (in *Namespaces_Topic_Spec) DeepCopy() *Namespaces_Topic_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Topic_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_Topic_Spec_ARM) DeepCopyInto(out *Namespaces_Topic_Spec_ARM) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(SBTopicProperties_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topic_Spec_ARM. +func (in *Namespaces_Topic_Spec_ARM) DeepCopy() *Namespaces_Topic_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Topic_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_Topics_Subscription_STATUS) DeepCopyInto(out *Namespaces_Topics_Subscription_STATUS) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.ClientAffineProperties != nil { + in, out := &in.ClientAffineProperties, &out.ClientAffineProperties + *out = new(SBClientAffineProperties_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.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DeadLetteringOnFilterEvaluationExceptions != nil { + in, out := &in.DeadLetteringOnFilterEvaluationExceptions, &out.DeadLetteringOnFilterEvaluationExceptions + *out = new(bool) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + if in.IsClientAffine != nil { + in, out := &in.IsClientAffine, &out.IsClientAffine + *out = new(bool) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MessageCount != nil { + in, out := &in.MessageCount, &out.MessageCount + *out = new(int) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EntityStatus_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_Topics_Subscription_STATUS. +func (in *Namespaces_Topics_Subscription_STATUS) DeepCopy() *Namespaces_Topics_Subscription_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS_ARM) DeepCopyInto(out *Namespaces_Topics_Subscription_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(SBSubscriptionProperties_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_Topics_Subscription_STATUS_ARM. +func (in *Namespaces_Topics_Subscription_STATUS_ARM) DeepCopy() *Namespaces_Topics_Subscription_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscription_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_Topics_Subscription_Spec) DeepCopyInto(out *Namespaces_Topics_Subscription_Spec) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.ClientAffineProperties != nil { + in, out := &in.ClientAffineProperties, &out.ClientAffineProperties + *out = new(SBClientAffineProperties) + (*in).DeepCopyInto(*out) + } + if in.DeadLetteringOnFilterEvaluationExceptions != nil { + in, out := &in.DeadLetteringOnFilterEvaluationExceptions, &out.DeadLetteringOnFilterEvaluationExceptions + *out = new(bool) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.IsClientAffine != nil { + in, out := &in.IsClientAffine, &out.IsClientAffine + *out = new(bool) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topics_Subscription_Spec. +func (in *Namespaces_Topics_Subscription_Spec) DeepCopy() *Namespaces_Topics_Subscription_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscription_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_Topics_Subscription_Spec_ARM) DeepCopyInto(out *Namespaces_Topics_Subscription_Spec_ARM) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(SBSubscriptionProperties_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topics_Subscription_Spec_ARM. +func (in *Namespaces_Topics_Subscription_Spec_ARM) DeepCopy() *Namespaces_Topics_Subscription_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscription_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_Topics_Subscriptions_Rule_STATUS) DeepCopyInto(out *Namespaces_Topics_Subscriptions_Rule_STATUS) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(Action_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.CorrelationFilter != nil { + in, out := &in.CorrelationFilter, &out.CorrelationFilter + *out = new(CorrelationFilter_STATUS) + (*in).DeepCopyInto(*out) + } + if in.FilterType != nil { + in, out := &in.FilterType, &out.FilterType + *out = new(FilterType_STATUS) + **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.SqlFilter != nil { + in, out := &in.SqlFilter, &out.SqlFilter + *out = new(SqlFilter_STATUS) + (*in).DeepCopyInto(*out) + } + 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_Topics_Subscriptions_Rule_STATUS. +func (in *Namespaces_Topics_Subscriptions_Rule_STATUS) DeepCopy() *Namespaces_Topics_Subscriptions_Rule_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS_ARM) DeepCopyInto(out *Namespaces_Topics_Subscriptions_Rule_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(Ruleproperties_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_Topics_Subscriptions_Rule_STATUS_ARM. +func (in *Namespaces_Topics_Subscriptions_Rule_STATUS_ARM) DeepCopy() *Namespaces_Topics_Subscriptions_Rule_STATUS_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec) DeepCopyInto(out *Namespaces_Topics_Subscriptions_Rule_Spec) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(Action) + (*in).DeepCopyInto(*out) + } + if in.CorrelationFilter != nil { + in, out := &in.CorrelationFilter, &out.CorrelationFilter + *out = new(CorrelationFilter) + (*in).DeepCopyInto(*out) + } + if in.FilterType != nil { + in, out := &in.FilterType, &out.FilterType + *out = new(FilterType) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.SqlFilter != nil { + in, out := &in.SqlFilter, &out.SqlFilter + *out = new(SqlFilter) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topics_Subscriptions_Rule_Spec. +func (in *Namespaces_Topics_Subscriptions_Rule_Spec) DeepCopy() *Namespaces_Topics_Subscriptions_Rule_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec_ARM) DeepCopyInto(out *Namespaces_Topics_Subscriptions_Rule_Spec_ARM) { + *out = *in + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = new(Ruleproperties_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topics_Subscriptions_Rule_Spec_ARM. +func (in *Namespaces_Topics_Subscriptions_Rule_Spec_ARM) DeepCopy() *Namespaces_Topics_Subscriptions_Rule_Spec_ARM { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscriptions_Rule_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 *Ruleproperties_ARM) DeepCopyInto(out *Ruleproperties_ARM) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(Action_ARM) + (*in).DeepCopyInto(*out) + } + if in.CorrelationFilter != nil { + in, out := &in.CorrelationFilter, &out.CorrelationFilter + *out = new(CorrelationFilter_ARM) + (*in).DeepCopyInto(*out) + } + if in.FilterType != nil { + in, out := &in.FilterType, &out.FilterType + *out = new(FilterType) + **out = **in + } + if in.SqlFilter != nil { + in, out := &in.SqlFilter, &out.SqlFilter + *out = new(SqlFilter_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ruleproperties_ARM. +func (in *Ruleproperties_ARM) DeepCopy() *Ruleproperties_ARM { + if in == nil { + return nil + } + out := new(Ruleproperties_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 *Ruleproperties_STATUS_ARM) DeepCopyInto(out *Ruleproperties_STATUS_ARM) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(Action_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.CorrelationFilter != nil { + in, out := &in.CorrelationFilter, &out.CorrelationFilter + *out = new(CorrelationFilter_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.FilterType != nil { + in, out := &in.FilterType, &out.FilterType + *out = new(FilterType_STATUS) + **out = **in + } + if in.SqlFilter != nil { + in, out := &in.SqlFilter, &out.SqlFilter + *out = new(SqlFilter_STATUS_ARM) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ruleproperties_STATUS_ARM. +func (in *Ruleproperties_STATUS_ARM) DeepCopy() *Ruleproperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(Ruleproperties_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 *SBClientAffineProperties) DeepCopyInto(out *SBClientAffineProperties) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.IsDurable != nil { + in, out := &in.IsDurable, &out.IsDurable + *out = new(bool) + **out = **in + } + if in.IsShared != nil { + in, out := &in.IsShared, &out.IsShared + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBClientAffineProperties. +func (in *SBClientAffineProperties) DeepCopy() *SBClientAffineProperties { + if in == nil { + return nil + } + out := new(SBClientAffineProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SBClientAffineProperties_ARM) DeepCopyInto(out *SBClientAffineProperties_ARM) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.IsDurable != nil { + in, out := &in.IsDurable, &out.IsDurable + *out = new(bool) + **out = **in + } + if in.IsShared != nil { + in, out := &in.IsShared, &out.IsShared + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBClientAffineProperties_ARM. +func (in *SBClientAffineProperties_ARM) DeepCopy() *SBClientAffineProperties_ARM { + if in == nil { + return nil + } + out := new(SBClientAffineProperties_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 *SBClientAffineProperties_STATUS) DeepCopyInto(out *SBClientAffineProperties_STATUS) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.IsDurable != nil { + in, out := &in.IsDurable, &out.IsDurable + *out = new(bool) + **out = **in + } + if in.IsShared != nil { + in, out := &in.IsShared, &out.IsShared + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBClientAffineProperties_STATUS. +func (in *SBClientAffineProperties_STATUS) DeepCopy() *SBClientAffineProperties_STATUS { + if in == nil { + return nil + } + out := new(SBClientAffineProperties_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 *SBClientAffineProperties_STATUS_ARM) DeepCopyInto(out *SBClientAffineProperties_STATUS_ARM) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.IsDurable != nil { + in, out := &in.IsDurable, &out.IsDurable + *out = new(bool) + **out = **in + } + if in.IsShared != nil { + in, out := &in.IsShared, &out.IsShared + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBClientAffineProperties_STATUS_ARM. +func (in *SBClientAffineProperties_STATUS_ARM) DeepCopy() *SBClientAffineProperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(SBClientAffineProperties_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 *SBNamespaceProperties_ARM) DeepCopyInto(out *SBNamespaceProperties_ARM) { + *out = *in + if in.AlternateName != nil { + in, out := &in.AlternateName, &out.AlternateName + *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.MinimumTlsVersion != nil { + in, out := &in.MinimumTlsVersion, &out.MinimumTlsVersion + *out = new(SBNamespaceProperties_MinimumTlsVersion) + **out = **in + } + if in.PremiumMessagingPartitions != nil { + in, out := &in.PremiumMessagingPartitions, &out.PremiumMessagingPartitions + *out = new(int) + **out = **in + } + if in.PublicNetworkAccess != nil { + in, out := &in.PublicNetworkAccess, &out.PublicNetworkAccess + *out = new(SBNamespaceProperties_PublicNetworkAccess) + **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 SBNamespaceProperties_ARM. +func (in *SBNamespaceProperties_ARM) DeepCopy() *SBNamespaceProperties_ARM { + if in == nil { + return nil + } + out := new(SBNamespaceProperties_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 *SBNamespaceProperties_STATUS_ARM) DeepCopyInto(out *SBNamespaceProperties_STATUS_ARM) { + *out = *in + if in.AlternateName != nil { + in, out := &in.AlternateName, &out.AlternateName + *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.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(SBNamespaceProperties_MinimumTlsVersion_STATUS) + **out = **in + } + if in.PremiumMessagingPartitions != nil { + in, out := &in.PremiumMessagingPartitions, &out.PremiumMessagingPartitions + *out = new(int) + **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(SBNamespaceProperties_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 SBNamespaceProperties_STATUS_ARM. +func (in *SBNamespaceProperties_STATUS_ARM) DeepCopy() *SBNamespaceProperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(SBNamespaceProperties_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 *SBQueueProperties_ARM) DeepCopyInto(out *SBQueueProperties_ARM) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBQueueProperties_ARM. +func (in *SBQueueProperties_ARM) DeepCopy() *SBQueueProperties_ARM { + if in == nil { + return nil + } + out := new(SBQueueProperties_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 *SBQueueProperties_STATUS_ARM) DeepCopyInto(out *SBQueueProperties_STATUS_ARM) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.MessageCount != nil { + in, out := &in.MessageCount, &out.MessageCount + *out = new(int) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } + if in.SizeInBytes != nil { + in, out := &in.SizeInBytes, &out.SizeInBytes + *out = new(int) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EntityStatus_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 SBQueueProperties_STATUS_ARM. +func (in *SBQueueProperties_STATUS_ARM) DeepCopy() *SBQueueProperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(SBQueueProperties_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 *SBSku) DeepCopyInto(out *SBSku) { + *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(SBSku_Name) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(SBSku_Tier) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBSku. +func (in *SBSku) DeepCopy() *SBSku { + if in == nil { + return nil + } + out := new(SBSku) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SBSku_ARM) DeepCopyInto(out *SBSku_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(SBSku_Name) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(SBSku_Tier) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBSku_ARM. +func (in *SBSku_ARM) DeepCopy() *SBSku_ARM { + if in == nil { + return nil + } + out := new(SBSku_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 *SBSku_STATUS) DeepCopyInto(out *SBSku_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(SBSku_Name_STATUS) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(SBSku_Tier_STATUS) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBSku_STATUS. +func (in *SBSku_STATUS) DeepCopy() *SBSku_STATUS { + if in == nil { + return nil + } + out := new(SBSku_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 *SBSku_STATUS_ARM) DeepCopyInto(out *SBSku_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(SBSku_Name_STATUS) + **out = **in + } + if in.Tier != nil { + in, out := &in.Tier, &out.Tier + *out = new(SBSku_Tier_STATUS) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBSku_STATUS_ARM. +func (in *SBSku_STATUS_ARM) DeepCopy() *SBSku_STATUS_ARM { + if in == nil { + return nil + } + out := new(SBSku_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 *SBSubscriptionProperties_ARM) DeepCopyInto(out *SBSubscriptionProperties_ARM) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.ClientAffineProperties != nil { + in, out := &in.ClientAffineProperties, &out.ClientAffineProperties + *out = new(SBClientAffineProperties_ARM) + (*in).DeepCopyInto(*out) + } + if in.DeadLetteringOnFilterEvaluationExceptions != nil { + in, out := &in.DeadLetteringOnFilterEvaluationExceptions, &out.DeadLetteringOnFilterEvaluationExceptions + *out = new(bool) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.IsClientAffine != nil { + in, out := &in.IsClientAffine, &out.IsClientAffine + *out = new(bool) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBSubscriptionProperties_ARM. +func (in *SBSubscriptionProperties_ARM) DeepCopy() *SBSubscriptionProperties_ARM { + if in == nil { + return nil + } + out := new(SBSubscriptionProperties_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 *SBSubscriptionProperties_STATUS_ARM) DeepCopyInto(out *SBSubscriptionProperties_STATUS_ARM) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.ClientAffineProperties != nil { + in, out := &in.ClientAffineProperties, &out.ClientAffineProperties + *out = new(SBClientAffineProperties_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DeadLetteringOnFilterEvaluationExceptions != nil { + in, out := &in.DeadLetteringOnFilterEvaluationExceptions, &out.DeadLetteringOnFilterEvaluationExceptions + *out = new(bool) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.IsClientAffine != nil { + in, out := &in.IsClientAffine, &out.IsClientAffine + *out = new(bool) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MessageCount != nil { + in, out := &in.MessageCount, &out.MessageCount + *out = new(int) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EntityStatus_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 SBSubscriptionProperties_STATUS_ARM. +func (in *SBSubscriptionProperties_STATUS_ARM) DeepCopy() *SBSubscriptionProperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(SBSubscriptionProperties_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 *SBTopicProperties_ARM) DeepCopyInto(out *SBTopicProperties_ARM) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.SupportOrdering != nil { + in, out := &in.SupportOrdering, &out.SupportOrdering + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBTopicProperties_ARM. +func (in *SBTopicProperties_ARM) DeepCopy() *SBTopicProperties_ARM { + if in == nil { + return nil + } + out := new(SBTopicProperties_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 *SBTopicProperties_STATUS_ARM) DeepCopyInto(out *SBTopicProperties_STATUS_ARM) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS_ARM) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.SizeInBytes != nil { + in, out := &in.SizeInBytes, &out.SizeInBytes + *out = new(int) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(EntityStatus_STATUS) + **out = **in + } + if in.SubscriptionCount != nil { + in, out := &in.SubscriptionCount, &out.SubscriptionCount + *out = new(int) + **out = **in + } + if in.SupportOrdering != nil { + in, out := &in.SupportOrdering, &out.SupportOrdering + *out = new(bool) + **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 SBTopicProperties_STATUS_ARM. +func (in *SBTopicProperties_STATUS_ARM) DeepCopy() *SBTopicProperties_STATUS_ARM { + if in == nil { + return nil + } + out := new(SBTopicProperties_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 *SqlFilter) DeepCopyInto(out *SqlFilter) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SqlFilter. +func (in *SqlFilter) DeepCopy() *SqlFilter { + if in == nil { + return nil + } + out := new(SqlFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SqlFilter_ARM) DeepCopyInto(out *SqlFilter_ARM) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SqlFilter_ARM. +func (in *SqlFilter_ARM) DeepCopy() *SqlFilter_ARM { + if in == nil { + return nil + } + out := new(SqlFilter_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 *SqlFilter_STATUS) DeepCopyInto(out *SqlFilter_STATUS) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SqlFilter_STATUS. +func (in *SqlFilter_STATUS) DeepCopy() *SqlFilter_STATUS { + if in == nil { + return nil + } + out := new(SqlFilter_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 *SqlFilter_STATUS_ARM) DeepCopyInto(out *SqlFilter_STATUS_ARM) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *out = new(int) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SqlFilter_STATUS_ARM. +func (in *SqlFilter_STATUS_ARM) DeepCopy() *SqlFilter_STATUS_ARM { + if in == nil { + return nil + } + out := new(SqlFilter_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/servicebus/v1api20221001previewstorage/groupversion_info_gen.go b/v2/api/servicebus/v1api20221001previewstorage/groupversion_info_gen.go new file mode 100644 index 00000000000..1486455012a --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/groupversion_info_gen.go @@ -0,0 +1,31 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package v1api20221001previewstorage contains API Schema definitions for the servicebus v1api20221001previewstorage API group +// +kubebuilder:object:generate=true +// All object properties are optional by default, this will be overridden when needed: +// +kubebuilder:validation:Optional +// +groupName=servicebus.azure.com +package v1api20221001previewstorage + +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: "servicebus.azure.com", Version: "v1api20221001previewstorage"} + + // 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/servicebus/v1api20221001previewstorage/namespace_types_gen.go b/v2/api/servicebus/v1api20221001previewstorage/namespace_types_gen.go new file mode 100644 index 00000000000..941728fcd38 --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/namespace_types_gen.go @@ -0,0 +1,2576 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001previewstorage + +import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Storage version of v1api20221001preview.Namespace +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/namespace-preview.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.(*v20211101s.Namespace) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/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.(*v20211101s.Namespace) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/Namespace but received %T instead", hub) + } + + return namespace.AssignProperties_To_Namespace(destination) +} + +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 "2022-10-01-preview" +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 +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces" +func (namespace *Namespace) GetType() string { + return "Microsoft.ServiceBus/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 &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: namespace.Spec.Owner.Name, + } +} + +// 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 +} + +// AssignProperties_From_Namespace populates our Namespace from the provided source Namespace +func (namespace *Namespace) AssignProperties_From_Namespace(source *v20211101s.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 *v20211101s.Namespace) error { + + // ObjectMeta + destination.ObjectMeta = *namespace.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.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 v20211101s.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 { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: namespace.Spec.OriginalVersion, + Kind: "Namespace", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20221001preview.Namespace +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/namespace-preview.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName} +type NamespaceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Namespace `json:"items"` +} + +// Storage version of v1api20221001preview.APIVersion +// +kubebuilder:validation:Enum={"2022-10-01-preview"} +type APIVersion string + +const APIVersion_Value = APIVersion("2022-10-01-preview") + +type augmentConversionForNamespace interface { + AssignPropertiesFrom(src *v20211101s.Namespace) error + AssignPropertiesTo(dst *v20211101s.Namespace) error +} + +// Storage version of v1api20221001preview.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"` + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + Encryption *Encryption `json:"encryption,omitempty"` + Identity *Identity `json:"identity,omitempty"` + Location *string `json:"location,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"` + PremiumMessagingPartitions *int `json:"premiumMessagingPartitions,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` + Sku *SBSku `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 { + src, ok := source.(*v20211101s.Namespace_Spec) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.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.(*v20211101s.Namespace_Spec) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.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 *v20211101s.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 + + // 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 + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // MinimumTlsVersion + if propertyBag.Contains("MinimumTlsVersion") { + var minimumTlsVersion string + err := propertyBag.Pull("MinimumTlsVersion", &minimumTlsVersion) + if err != nil { + return errors.Wrap(err, "pulling 'MinimumTlsVersion' from propertyBag") + } + + 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 + } + + // OriginalVersion + namespace.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + namespace.Owner = &owner + } else { + namespace.Owner = nil + } + + // PremiumMessagingPartitions + if propertyBag.Contains("PremiumMessagingPartitions") { + var premiumMessagingPartition int + err := propertyBag.Pull("PremiumMessagingPartitions", &premiumMessagingPartition) + if err != nil { + return errors.Wrap(err, "pulling 'PremiumMessagingPartitions' from propertyBag") + } + + namespace.PremiumMessagingPartitions = &premiumMessagingPartition + } else { + namespace.PremiumMessagingPartitions = 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") + } + + namespace.PublicNetworkAccess = &publicNetworkAccess + } else { + namespace.PublicNetworkAccess = nil + } + + // Sku + if source.Sku != nil { + var sku SBSku + err := sku.AssignProperties_From_SBSku(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBSku() 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 *v20211101s.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 + + // DisableLocalAuth + if namespace.DisableLocalAuth != nil { + disableLocalAuth := *namespace.DisableLocalAuth + destination.DisableLocalAuth = &disableLocalAuth + } else { + destination.DisableLocalAuth = nil + } + + // Encryption + if namespace.Encryption != nil { + var encryption v20211101s.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 v20211101s.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 + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // MinimumTlsVersion + if namespace.MinimumTlsVersion != nil { + propertyBag.Add("MinimumTlsVersion", *namespace.MinimumTlsVersion) + } else { + propertyBag.Remove("MinimumTlsVersion") + } + + // 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 + + // Owner + if namespace.Owner != nil { + owner := namespace.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // PremiumMessagingPartitions + if namespace.PremiumMessagingPartitions != nil { + propertyBag.Add("PremiumMessagingPartitions", *namespace.PremiumMessagingPartitions) + } else { + propertyBag.Remove("PremiumMessagingPartitions") + } + + // PublicNetworkAccess + if namespace.PublicNetworkAccess != nil { + propertyBag.Add("PublicNetworkAccess", *namespace.PublicNetworkAccess) + } else { + propertyBag.Remove("PublicNetworkAccess") + } + + // Sku + if namespace.Sku != nil { + var sku v20211101s.SBSku + err := namespace.Sku.AssignProperties_To_SBSku(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBSku() 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") + } + } + + // No error + return nil +} + +// Storage version of v1api20221001preview.Namespace_STATUS +type Namespace_STATUS struct { + AlternateName *string `json:"alternateName,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"` + Location *string `json:"location,omitempty"` + MetricId *string `json:"metricId,omitempty"` + MinimumTlsVersion *string `json:"minimumTlsVersion,omitempty"` + Name *string `json:"name,omitempty"` + PremiumMessagingPartitions *int `json:"premiumMessagingPartitions,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 *SBSku_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 { + src, ok := source.(*v20211101s.Namespace_STATUS) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.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.(*v20211101s.Namespace_STATUS) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.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 +} + +// AssignProperties_From_Namespace_STATUS populates our Namespace_STATUS from the provided source Namespace_STATUS +func (namespace *Namespace_STATUS) AssignProperties_From_Namespace_STATUS(source *v20211101s.Namespace_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AlternateName + namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) + + // 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 + } + + // Location + namespace.Location = genruntime.ClonePointerToString(source.Location) + + // MetricId + namespace.MetricId = genruntime.ClonePointerToString(source.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") + } + + namespace.MinimumTlsVersion = &minimumTlsVersion + } else { + namespace.MinimumTlsVersion = nil + } + + // Name + namespace.Name = genruntime.ClonePointerToString(source.Name) + + // PremiumMessagingPartitions + if propertyBag.Contains("PremiumMessagingPartitions") { + var premiumMessagingPartition int + err := propertyBag.Pull("PremiumMessagingPartitions", &premiumMessagingPartition) + if err != nil { + return errors.Wrap(err, "pulling 'PremiumMessagingPartitions' from propertyBag") + } + + namespace.PremiumMessagingPartitions = &premiumMessagingPartition + } else { + namespace.PremiumMessagingPartitions = nil + } + + // 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 propertyBag.Contains("PublicNetworkAccess") { + var publicNetworkAccess string + err := propertyBag.Pull("PublicNetworkAccess", &publicNetworkAccess) + if err != nil { + return errors.Wrap(err, "pulling 'PublicNetworkAccess' from propertyBag") + } + + namespace.PublicNetworkAccess = &publicNetworkAccess + } else { + namespace.PublicNetworkAccess = nil + } + + // ServiceBusEndpoint + namespace.ServiceBusEndpoint = genruntime.ClonePointerToString(source.ServiceBusEndpoint) + + // Sku + if source.Sku != nil { + var sku SBSku_STATUS + err := sku.AssignProperties_From_SBSku_STATUS(source.Sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBSku_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 *v20211101s.Namespace_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(namespace.PropertyBag) + + // AlternateName + destination.AlternateName = genruntime.ClonePointerToString(namespace.AlternateName) + + // 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 v20211101s.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 v20211101s.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 + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // MetricId + destination.MetricId = genruntime.ClonePointerToString(namespace.MetricId) + + // MinimumTlsVersion + if namespace.MinimumTlsVersion != nil { + propertyBag.Add("MinimumTlsVersion", *namespace.MinimumTlsVersion) + } else { + propertyBag.Remove("MinimumTlsVersion") + } + + // Name + destination.Name = genruntime.ClonePointerToString(namespace.Name) + + // PremiumMessagingPartitions + if namespace.PremiumMessagingPartitions != nil { + propertyBag.Add("PremiumMessagingPartitions", *namespace.PremiumMessagingPartitions) + } else { + propertyBag.Remove("PremiumMessagingPartitions") + } + + // PrivateEndpointConnections + if namespace.PrivateEndpointConnections != nil { + privateEndpointConnectionList := make([]v20211101s.PrivateEndpointConnection_STATUS, len(namespace.PrivateEndpointConnections)) + for privateEndpointConnectionIndex, privateEndpointConnectionItem := range namespace.PrivateEndpointConnections { + // Shadow the loop variable to avoid aliasing + privateEndpointConnectionItem := privateEndpointConnectionItem + var privateEndpointConnection v20211101s.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 { + propertyBag.Add("PublicNetworkAccess", *namespace.PublicNetworkAccess) + } else { + propertyBag.Remove("PublicNetworkAccess") + } + + // ServiceBusEndpoint + destination.ServiceBusEndpoint = genruntime.ClonePointerToString(namespace.ServiceBusEndpoint) + + // Sku + if namespace.Sku != nil { + var sku v20211101s.SBSku_STATUS + err := namespace.Sku.AssignProperties_To_SBSku_STATUS(&sku) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBSku_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 v20211101s.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 *v20211101s.Namespace_Spec) error + AssignPropertiesTo(dst *v20211101s.Namespace_Spec) error +} + +type augmentConversionForNamespace_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Namespace_STATUS) error + AssignPropertiesTo(dst *v20211101s.Namespace_STATUS) error +} + +// Storage version of v1api20221001preview.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 *v20211101s.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 *v20211101s.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([]v20211101s.KeyVaultProperties, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty v20211101s.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 v1api20221001preview.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 *v20211101s.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 *v20211101s.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([]v20211101s.KeyVaultProperties_STATUS, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty v20211101s.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 v1api20221001preview.Identity +// Properties to configure User Assigned Identities 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 *v20211101s.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 *v20211101s.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([]v20211101s.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities)) + for userAssignedIdentityIndex, userAssignedIdentityItem := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityItem := userAssignedIdentityItem + var userAssignedIdentity v20211101s.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 v1api20221001preview.Identity_STATUS +// Properties to configure User Assigned Identities 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 *v20211101s.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 *v20211101s.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]v20211101s.UserAssignedIdentity_STATUS, len(identity.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + var userAssignedIdentity v20211101s.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 v1api20221001preview.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 *v20211101s.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 *v20211101s.NamespaceOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // 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 + } + + // 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 v1api20221001preview.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 *v20211101s.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 *v20211101s.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 v1api20221001preview.SBSku +// SKU of the namespace. +type SBSku struct { + Capacity *int `json:"capacity,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Tier *string `json:"tier,omitempty"` +} + +// AssignProperties_From_SBSku populates our SBSku from the provided source SBSku +func (sbSku *SBSku) AssignProperties_From_SBSku(source *v20211101s.SBSku) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Capacity + sbSku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + sbSku.Name = genruntime.ClonePointerToString(source.Name) + + // Tier + sbSku.Tier = genruntime.ClonePointerToString(source.Tier) + + // Update the property bag + if len(propertyBag) > 0 { + sbSku.PropertyBag = propertyBag + } else { + sbSku.PropertyBag = nil + } + + // Invoke the augmentConversionForSBSku interface (if implemented) to customize the conversion + var sbSkuAsAny any = sbSku + if augmentedSbSku, ok := sbSkuAsAny.(augmentConversionForSBSku); ok { + err := augmentedSbSku.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_SBSku populates the provided destination SBSku from our SBSku +func (sbSku *SBSku) AssignProperties_To_SBSku(destination *v20211101s.SBSku) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(sbSku.PropertyBag) + + // Capacity + destination.Capacity = genruntime.ClonePointerToInt(sbSku.Capacity) + + // Name + destination.Name = genruntime.ClonePointerToString(sbSku.Name) + + // Tier + destination.Tier = genruntime.ClonePointerToString(sbSku.Tier) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForSBSku interface (if implemented) to customize the conversion + var sbSkuAsAny any = sbSku + if augmentedSbSku, ok := sbSkuAsAny.(augmentConversionForSBSku); ok { + err := augmentedSbSku.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20221001preview.SBSku_STATUS +// SKU of the namespace. +type SBSku_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_SBSku_STATUS populates our SBSku_STATUS from the provided source SBSku_STATUS +func (sbSku *SBSku_STATUS) AssignProperties_From_SBSku_STATUS(source *v20211101s.SBSku_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Capacity + sbSku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + sbSku.Name = genruntime.ClonePointerToString(source.Name) + + // Tier + sbSku.Tier = genruntime.ClonePointerToString(source.Tier) + + // Update the property bag + if len(propertyBag) > 0 { + sbSku.PropertyBag = propertyBag + } else { + sbSku.PropertyBag = nil + } + + // Invoke the augmentConversionForSBSku_STATUS interface (if implemented) to customize the conversion + var sbSkuAsAny any = sbSku + if augmentedSbSku, ok := sbSkuAsAny.(augmentConversionForSBSku_STATUS); ok { + err := augmentedSbSku.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_SBSku_STATUS populates the provided destination SBSku_STATUS from our SBSku_STATUS +func (sbSku *SBSku_STATUS) AssignProperties_To_SBSku_STATUS(destination *v20211101s.SBSku_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(sbSku.PropertyBag) + + // Capacity + destination.Capacity = genruntime.ClonePointerToInt(sbSku.Capacity) + + // Name + destination.Name = genruntime.ClonePointerToString(sbSku.Name) + + // Tier + destination.Tier = genruntime.ClonePointerToString(sbSku.Tier) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForSBSku_STATUS interface (if implemented) to customize the conversion + var sbSkuAsAny any = sbSku + if augmentedSbSku, ok := sbSkuAsAny.(augmentConversionForSBSku_STATUS); ok { + err := augmentedSbSku.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20221001preview.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 *v20211101s.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 *v20211101s.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 *v20211101s.Encryption) error + AssignPropertiesTo(dst *v20211101s.Encryption) error +} + +type augmentConversionForEncryption_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Encryption_STATUS) error + AssignPropertiesTo(dst *v20211101s.Encryption_STATUS) error +} + +type augmentConversionForIdentity interface { + AssignPropertiesFrom(src *v20211101s.Identity) error + AssignPropertiesTo(dst *v20211101s.Identity) error +} + +type augmentConversionForIdentity_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Identity_STATUS) error + AssignPropertiesTo(dst *v20211101s.Identity_STATUS) error +} + +type augmentConversionForNamespaceOperatorSpec interface { + AssignPropertiesFrom(src *v20211101s.NamespaceOperatorSpec) error + AssignPropertiesTo(dst *v20211101s.NamespaceOperatorSpec) error +} + +type augmentConversionForPrivateEndpointConnection_STATUS interface { + AssignPropertiesFrom(src *v20211101s.PrivateEndpointConnection_STATUS) error + AssignPropertiesTo(dst *v20211101s.PrivateEndpointConnection_STATUS) error +} + +type augmentConversionForSBSku interface { + AssignPropertiesFrom(src *v20211101s.SBSku) error + AssignPropertiesTo(dst *v20211101s.SBSku) error +} + +type augmentConversionForSBSku_STATUS interface { + AssignPropertiesFrom(src *v20211101s.SBSku_STATUS) error + AssignPropertiesTo(dst *v20211101s.SBSku_STATUS) error +} + +type augmentConversionForSystemData_STATUS interface { + AssignPropertiesFrom(src *v20211101s.SystemData_STATUS) error + AssignPropertiesTo(dst *v20211101s.SystemData_STATUS) error +} + +// Storage version of v1api20221001preview.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 *v20211101s.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 *v20211101s.KeyVaultProperties) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) + + // Identity + if properties.Identity != nil { + var identity v20211101s.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 v1api20221001preview.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 *v20211101s.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 *v20211101s.KeyVaultProperties_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) + + // Identity + if properties.Identity != nil { + var identity v20211101s.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 v1api20221001preview.NamespaceOperatorSecrets +type NamespaceOperatorSecrets struct { + Endpoint *genruntime.SecretDestination `json:"endpoint,omitempty"` + 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 *v20211101s.NamespaceOperatorSecrets) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Endpoint + if source.Endpoint != nil { + endpoint := source.Endpoint.Copy() + secrets.Endpoint = &endpoint + } else { + secrets.Endpoint = nil + } + + // 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 *v20211101s.NamespaceOperatorSecrets) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(secrets.PropertyBag) + + // Endpoint + if secrets.Endpoint != nil { + endpoint := secrets.Endpoint.Copy() + destination.Endpoint = &endpoint + } else { + destination.Endpoint = nil + } + + // 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 v1api20221001preview.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 *v20211101s.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 *v20211101s.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 v1api20221001preview.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 *v20211101s.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 *v20211101s.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 *v20211101s.KeyVaultProperties) error + AssignPropertiesTo(dst *v20211101s.KeyVaultProperties) error +} + +type augmentConversionForKeyVaultProperties_STATUS interface { + AssignPropertiesFrom(src *v20211101s.KeyVaultProperties_STATUS) error + AssignPropertiesTo(dst *v20211101s.KeyVaultProperties_STATUS) error +} + +type augmentConversionForNamespaceOperatorSecrets interface { + AssignPropertiesFrom(src *v20211101s.NamespaceOperatorSecrets) error + AssignPropertiesTo(dst *v20211101s.NamespaceOperatorSecrets) error +} + +type augmentConversionForUserAssignedIdentity_STATUS interface { + AssignPropertiesFrom(src *v20211101s.UserAssignedIdentity_STATUS) error + AssignPropertiesTo(dst *v20211101s.UserAssignedIdentity_STATUS) error +} + +type augmentConversionForUserAssignedIdentityDetails interface { + AssignPropertiesFrom(src *v20211101s.UserAssignedIdentityDetails) error + AssignPropertiesTo(dst *v20211101s.UserAssignedIdentityDetails) error +} + +// Storage version of v1api20221001preview.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 *v20211101s.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 *v20211101s.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 v1api20221001preview.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 *v20211101s.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 *v20211101s.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 *v20211101s.UserAssignedIdentityProperties) error + AssignPropertiesTo(dst *v20211101s.UserAssignedIdentityProperties) error +} + +type augmentConversionForUserAssignedIdentityProperties_STATUS interface { + AssignPropertiesFrom(src *v20211101s.UserAssignedIdentityProperties_STATUS) error + AssignPropertiesTo(dst *v20211101s.UserAssignedIdentityProperties_STATUS) error +} + +func init() { + SchemeBuilder.Register(&Namespace{}, &NamespaceList{}) +} diff --git a/v2/api/servicebus/v1api20221001previewstorage/namespace_types_gen_test.go b/v2/api/servicebus/v1api20221001previewstorage/namespace_types_gen_test.go new file mode 100644 index 00000000000..d0dfbd90c1c --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/namespace_types_gen_test.go @@ -0,0 +1,2153 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001previewstorage + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MinimumTlsVersion"] = gen.PtrOf(gen.AlphaString()) + gens["OriginalVersion"] = gen.AlphaString() + gens["PremiumMessagingPartitions"] = gen.PtrOf(gen.Int()) + 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(SBSkuGenerator()) +} + +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 v1api20211101storage 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 v20211101s.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["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DisableLocalAuth"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MetricId"] = gen.PtrOf(gen.AlphaString()) + gens["MinimumTlsVersion"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["PremiumMessagingPartitions"] = gen.PtrOf(gen.Int()) + 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(SBSku_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 v1api20211101storage 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 v20211101s.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.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_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 v1api20211101storage 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 v20211101s.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.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_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 v1api20211101storage 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 v20211101s.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.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_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 v1api20211101storage 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 v20211101s.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.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_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 v1api20211101storage 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() + 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 v1api20211101storage 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 v20211101s.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_SBSku_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBSku to SBSku via AssignProperties_To_SBSku & AssignProperties_From_SBSku returns original", + prop.ForAll(RunPropertyAssignmentTestForSBSku, SBSkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBSku tests if a specific instance of SBSku can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSBSku(subject SBSku) 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.SBSku + err := copied.AssignProperties_To_SBSku(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBSku + err = actual.AssignProperties_From_SBSku(&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_SBSku_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 SBSku via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSku, SBSkuGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSku runs a test to see if a specific instance of SBSku round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSku(subject SBSku) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSku + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SBSku instances for property testing - lazily instantiated by SBSkuGenerator() +var sbSkuGenerator gopter.Gen + +// SBSkuGenerator returns a generator of SBSku instances for property testing. +func SBSkuGenerator() gopter.Gen { + if sbSkuGenerator != nil { + return sbSkuGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSku(generators) + sbSkuGenerator = gen.Struct(reflect.TypeOf(SBSku{}), generators) + + return sbSkuGenerator +} + +// AddIndependentPropertyGeneratorsForSBSku is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSku(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_SBSku_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBSku_STATUS to SBSku_STATUS via AssignProperties_To_SBSku_STATUS & AssignProperties_From_SBSku_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSBSku_STATUS, SBSku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBSku_STATUS tests if a specific instance of SBSku_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSBSku_STATUS(subject SBSku_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 v20211101s.SBSku_STATUS + err := copied.AssignProperties_To_SBSku_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBSku_STATUS + err = actual.AssignProperties_From_SBSku_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_SBSku_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 SBSku_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSku_STATUS, SBSku_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSku_STATUS runs a test to see if a specific instance of SBSku_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSku_STATUS(subject SBSku_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSku_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 SBSku_STATUS instances for property testing - lazily instantiated by SBSku_STATUSGenerator() +var sbSku_STATUSGenerator gopter.Gen + +// SBSku_STATUSGenerator returns a generator of SBSku_STATUS instances for property testing. +func SBSku_STATUSGenerator() gopter.Gen { + if sbSku_STATUSGenerator != nil { + return sbSku_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSku_STATUS(generators) + sbSku_STATUSGenerator = gen.Struct(reflect.TypeOf(SBSku_STATUS{}), generators) + + return sbSku_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSBSku_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSku_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_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 v1api20211101storage 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 v20211101s.SystemData_STATUS + err := copied.AssignProperties_To_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SystemData_STATUS + err = actual.AssignProperties_From_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_SystemData_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemData_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemData_STATUS, SystemData_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemData_STATUS runs a test to see if a specific instance of SystemData_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemData_STATUS(subject SystemData_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SystemData_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SystemData_STATUS instances for property testing - lazily instantiated by SystemData_STATUSGenerator() +var systemData_STATUSGenerator gopter.Gen + +// SystemData_STATUSGenerator returns a generator of SystemData_STATUS instances for property testing. +func SystemData_STATUSGenerator() gopter.Gen { + if systemData_STATUSGenerator != nil { + return systemData_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemData_STATUS(generators) + systemData_STATUSGenerator = gen.Struct(reflect.TypeOf(SystemData_STATUS{}), generators) + + return systemData_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSystemData_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedByType"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedByType"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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() + 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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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/servicebus/v1api20221001previewstorage/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20221001previewstorage/namespaces_authorization_rule_types_gen.go new file mode 100644 index 00000000000..b6e6623dda2 --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/namespaces_authorization_rule_types_gen.go @@ -0,0 +1,804 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001previewstorage + +import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Storage version of v1api20221001preview.NamespacesAuthorizationRule +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/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.(*v20211101s.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/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.(*v20211101s.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) +} + +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 "2022-10-01-preview" +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 +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/AuthorizationRules" +func (rule *NamespacesAuthorizationRule) GetType() string { + return "Microsoft.ServiceBus/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 &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: rule.Spec.Owner.Name, + } +} + +// 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 +} + +// AssignProperties_From_NamespacesAuthorizationRule populates our NamespacesAuthorizationRule from the provided source NamespacesAuthorizationRule +func (rule *NamespacesAuthorizationRule) AssignProperties_From_NamespacesAuthorizationRule(source *v20211101s.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 *v20211101s.NamespacesAuthorizationRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.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 v20211101s.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 { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: rule.Spec.OriginalVersion, + Kind: "NamespacesAuthorizationRule", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20221001preview.NamespacesAuthorizationRule +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/AuthorizationRules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName} +type NamespacesAuthorizationRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesAuthorizationRule `json:"items"` +} + +type augmentConversionForNamespacesAuthorizationRule interface { + AssignPropertiesFrom(src *v20211101s.NamespacesAuthorizationRule) error + AssignPropertiesTo(dst *v20211101s.NamespacesAuthorizationRule) error +} + +// Storage version of v1api20221001preview.Namespaces_AuthorizationRule_Spec +type Namespaces_AuthorizationRule_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"` + 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 servicebus.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"servicebus.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 { + src, ok := source.(*v20211101s.Namespaces_AuthorizationRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.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.(*v20211101s.Namespaces_AuthorizationRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_AuthorizationRule_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.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 *v20211101s.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 *v20211101s.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 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 + + // 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 v1api20221001preview.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 { + src, ok := source.(*v20211101s.Namespaces_AuthorizationRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.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.(*v20211101s.Namespaces_AuthorizationRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.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 *v20211101s.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 *v20211101s.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 v20211101s.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 *v20211101s.Namespaces_AuthorizationRule_Spec) error + AssignPropertiesTo(dst *v20211101s.Namespaces_AuthorizationRule_Spec) error +} + +type augmentConversionForNamespaces_AuthorizationRule_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_AuthorizationRule_STATUS) error + AssignPropertiesTo(dst *v20211101s.Namespaces_AuthorizationRule_STATUS) error +} + +// Storage version of v1api20221001preview.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 *v20211101s.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 *v20211101s.NamespacesAuthorizationRuleOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // 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 + } + + // 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 *v20211101s.NamespacesAuthorizationRuleOperatorSpec) error + AssignPropertiesTo(dst *v20211101s.NamespacesAuthorizationRuleOperatorSpec) error +} + +// Storage version of v1api20221001preview.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 *v20211101s.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 *v20211101s.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 *v20211101s.NamespacesAuthorizationRuleOperatorSecrets) error + AssignPropertiesTo(dst *v20211101s.NamespacesAuthorizationRuleOperatorSecrets) error +} + +func init() { + SchemeBuilder.Register(&NamespacesAuthorizationRule{}, &NamespacesAuthorizationRuleList{}) +} diff --git a/v2/api/servicebus/v1api20221001previewstorage/namespaces_authorization_rule_types_gen_test.go b/v2/api/servicebus/v1api20221001previewstorage/namespaces_authorization_rule_types_gen_test.go new file mode 100644 index 00000000000..212d2164c67 --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/namespaces_authorization_rule_types_gen_test.go @@ -0,0 +1,606 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001previewstorage + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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 v20211101s.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 v1api20211101storage 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 v20211101s.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 v1api20211101storage 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 v20211101s.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["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_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 v1api20211101storage 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 v20211101s.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.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_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 v1api20211101storage 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 v1api20211101storage 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/servicebus/v1api20221001previewstorage/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20221001previewstorage/namespaces_queue_types_gen.go new file mode 100644 index 00000000000..5b65be3c2d4 --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/namespaces_queue_types_gen.go @@ -0,0 +1,1044 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001previewstorage + +import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Storage version of v1api20221001preview.NamespacesQueue +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/Queue.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName} +type NamespacesQueue struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Queue_Spec `json:"spec,omitempty"` + Status Namespaces_Queue_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesQueue{} + +// GetConditions returns the conditions of the resource +func (queue *NamespacesQueue) GetConditions() conditions.Conditions { + return queue.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (queue *NamespacesQueue) SetConditions(conditions conditions.Conditions) { + queue.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesQueue{} + +// ConvertFrom populates our NamespacesQueue from the provided hub NamespacesQueue +func (queue *NamespacesQueue) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20211101s.NamespacesQueue) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesQueue but received %T instead", hub) + } + + return queue.AssignProperties_From_NamespacesQueue(source) +} + +// ConvertTo populates the provided hub NamespacesQueue from our NamespacesQueue +func (queue *NamespacesQueue) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20211101s.NamespacesQueue) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesQueue but received %T instead", hub) + } + + return queue.AssignProperties_To_NamespacesQueue(destination) +} + +var _ genruntime.KubernetesResource = &NamespacesQueue{} + +// AzureName returns the Azure name of the resource +func (queue *NamespacesQueue) AzureName() string { + return queue.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2022-10-01-preview" +func (queue NamespacesQueue) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (queue *NamespacesQueue) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (queue *NamespacesQueue) GetSpec() genruntime.ConvertibleSpec { + return &queue.Spec +} + +// GetStatus returns the status of this resource +func (queue *NamespacesQueue) GetStatus() genruntime.ConvertibleStatus { + return &queue.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/queues" +func (queue *NamespacesQueue) GetType() string { + return "Microsoft.ServiceBus/namespaces/queues" +} + +// NewEmptyStatus returns a new empty (blank) status +func (queue *NamespacesQueue) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Queue_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (queue *NamespacesQueue) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: queue.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (queue *NamespacesQueue) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Queue_STATUS); ok { + queue.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Queue_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + queue.Status = st + return nil +} + +// AssignProperties_From_NamespacesQueue populates our NamespacesQueue from the provided source NamespacesQueue +func (queue *NamespacesQueue) AssignProperties_From_NamespacesQueue(source *v20211101s.NamespacesQueue) error { + + // ObjectMeta + queue.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Queue_Spec + err := spec.AssignProperties_From_Namespaces_Queue_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Queue_Spec() to populate field Spec") + } + queue.Spec = spec + + // Status + var status Namespaces_Queue_STATUS + err = status.AssignProperties_From_Namespaces_Queue_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Queue_STATUS() to populate field Status") + } + queue.Status = status + + // Invoke the augmentConversionForNamespacesQueue interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespacesQueue); ok { + err := augmentedQueue.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesQueue populates the provided destination NamespacesQueue from our NamespacesQueue +func (queue *NamespacesQueue) AssignProperties_To_NamespacesQueue(destination *v20211101s.NamespacesQueue) error { + + // ObjectMeta + destination.ObjectMeta = *queue.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.Namespaces_Queue_Spec + err := queue.Spec.AssignProperties_To_Namespaces_Queue_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Queue_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20211101s.Namespaces_Queue_STATUS + err = queue.Status.AssignProperties_To_Namespaces_Queue_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Queue_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForNamespacesQueue interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespacesQueue); ok { + err := augmentedQueue.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 (queue *NamespacesQueue) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: queue.Spec.OriginalVersion, + Kind: "NamespacesQueue", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20221001preview.NamespacesQueue +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/Queue.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/queues/{queueName} +type NamespacesQueueList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesQueue `json:"items"` +} + +type augmentConversionForNamespacesQueue interface { + AssignPropertiesFrom(src *v20211101s.NamespacesQueue) error + AssignPropertiesTo(dst *v20211101s.NamespacesQueue) error +} + +// Storage version of v1api20221001preview.Namespaces_Queue_Spec +type Namespaces_Queue_Spec struct { + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // +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"` + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + EnableExpress *bool `json:"enableExpress,omitempty"` + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + ForwardTo *string `json:"forwardTo,omitempty"` + LockDuration *string `json:"lockDuration,omitempty"` + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,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 servicebus.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"Namespace"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + RequiresSession *bool `json:"requiresSession,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Queue_Spec{} + +// ConvertSpecFrom populates our Namespaces_Queue_Spec from the provided source +func (queue *Namespaces_Queue_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20211101s.Namespaces_Queue_Spec) + if ok { + // Populate our instance from source + return queue.AssignProperties_From_Namespaces_Queue_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Queue_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = queue.AssignProperties_From_Namespaces_Queue_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_Queue_Spec +func (queue *Namespaces_Queue_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20211101s.Namespaces_Queue_Spec) + if ok { + // Populate destination from our instance + return queue.AssignProperties_To_Namespaces_Queue_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Queue_Spec{} + err := queue.AssignProperties_To_Namespaces_Queue_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_Queue_Spec populates our Namespaces_Queue_Spec from the provided source Namespaces_Queue_Spec +func (queue *Namespaces_Queue_Spec) AssignProperties_From_Namespaces_Queue_Spec(source *v20211101s.Namespaces_Queue_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AutoDeleteOnIdle + queue.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // AzureName + queue.AzureName = source.AzureName + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + queue.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + queue.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + queue.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + queue.EnableBatchedOperations = &enableBatchedOperation + } else { + queue.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + queue.EnableExpress = &enableExpress + } else { + queue.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + queue.EnablePartitioning = &enablePartitioning + } else { + queue.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + queue.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + queue.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // LockDuration + queue.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + queue.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + queue.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + queue.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // OriginalVersion + queue.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + queue.Owner = &owner + } else { + queue.Owner = nil + } + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + queue.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + queue.RequiresDuplicateDetection = nil + } + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + queue.RequiresSession = &requiresSession + } else { + queue.RequiresSession = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + queue.PropertyBag = propertyBag + } else { + queue.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Queue_Spec interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespaces_Queue_Spec); ok { + err := augmentedQueue.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Queue_Spec populates the provided destination Namespaces_Queue_Spec from our Namespaces_Queue_Spec +func (queue *Namespaces_Queue_Spec) AssignProperties_To_Namespaces_Queue_Spec(destination *v20211101s.Namespaces_Queue_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(queue.PropertyBag) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(queue.AutoDeleteOnIdle) + + // AzureName + destination.AzureName = queue.AzureName + + // DeadLetteringOnMessageExpiration + if queue.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *queue.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(queue.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(queue.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if queue.EnableBatchedOperations != nil { + enableBatchedOperation := *queue.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if queue.EnableExpress != nil { + enableExpress := *queue.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if queue.EnablePartitioning != nil { + enablePartitioning := *queue.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(queue.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(queue.ForwardTo) + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(queue.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(queue.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + destination.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(queue.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(queue.MaxSizeInMegabytes) + + // OriginalVersion + destination.OriginalVersion = queue.OriginalVersion + + // Owner + if queue.Owner != nil { + owner := queue.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // RequiresDuplicateDetection + if queue.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *queue.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // RequiresSession + if queue.RequiresSession != nil { + requiresSession := *queue.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Queue_Spec interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespaces_Queue_Spec); ok { + err := augmentedQueue.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20221001preview.Namespaces_Queue_STATUS +type Namespaces_Queue_STATUS struct { + AccessedAt *string `json:"accessedAt,omitempty"` + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + Conditions []conditions.Condition `json:"conditions,omitempty"` + CountDetails *MessageCountDetails_STATUS `json:"countDetails,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + EnableExpress *bool `json:"enableExpress,omitempty"` + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + ForwardTo *string `json:"forwardTo,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + LockDuration *string `json:"lockDuration,omitempty"` + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + MessageCount *int `json:"messageCount,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + RequiresSession *bool `json:"requiresSession,omitempty"` + SizeInBytes *int `json:"sizeInBytes,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_Queue_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Queue_STATUS from the provided source +func (queue *Namespaces_Queue_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20211101s.Namespaces_Queue_STATUS) + if ok { + // Populate our instance from source + return queue.AssignProperties_From_Namespaces_Queue_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Queue_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = queue.AssignProperties_From_Namespaces_Queue_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_Queue_STATUS +func (queue *Namespaces_Queue_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20211101s.Namespaces_Queue_STATUS) + if ok { + // Populate destination from our instance + return queue.AssignProperties_To_Namespaces_Queue_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Queue_STATUS{} + err := queue.AssignProperties_To_Namespaces_Queue_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_Queue_STATUS populates our Namespaces_Queue_STATUS from the provided source Namespaces_Queue_STATUS +func (queue *Namespaces_Queue_STATUS) AssignProperties_From_Namespaces_Queue_STATUS(source *v20211101s.Namespaces_Queue_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AccessedAt + queue.AccessedAt = genruntime.ClonePointerToString(source.AccessedAt) + + // AutoDeleteOnIdle + queue.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // Conditions + queue.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CountDetails + if source.CountDetails != nil { + var countDetail MessageCountDetails_STATUS + err := countDetail.AssignProperties_From_MessageCountDetails_STATUS(source.CountDetails) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_MessageCountDetails_STATUS() to populate field CountDetails") + } + queue.CountDetails = &countDetail + } else { + queue.CountDetails = nil + } + + // CreatedAt + queue.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + queue.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + queue.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + queue.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + queue.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + queue.EnableBatchedOperations = &enableBatchedOperation + } else { + queue.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + queue.EnableExpress = &enableExpress + } else { + queue.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + queue.EnablePartitioning = &enablePartitioning + } else { + queue.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + queue.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + queue.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // Id + queue.Id = genruntime.ClonePointerToString(source.Id) + + // Location + queue.Location = genruntime.ClonePointerToString(source.Location) + + // LockDuration + queue.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + queue.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + queue.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + queue.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // MessageCount + queue.MessageCount = genruntime.ClonePointerToInt(source.MessageCount) + + // Name + queue.Name = genruntime.ClonePointerToString(source.Name) + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + queue.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + queue.RequiresDuplicateDetection = nil + } + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + queue.RequiresSession = &requiresSession + } else { + queue.RequiresSession = nil + } + + // SizeInBytes + queue.SizeInBytes = genruntime.ClonePointerToInt(source.SizeInBytes) + + // Status + queue.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") + } + queue.SystemData = &systemDatum + } else { + queue.SystemData = nil + } + + // Type + queue.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + queue.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + queue.PropertyBag = propertyBag + } else { + queue.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Queue_STATUS interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespaces_Queue_STATUS); ok { + err := augmentedQueue.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Queue_STATUS populates the provided destination Namespaces_Queue_STATUS from our Namespaces_Queue_STATUS +func (queue *Namespaces_Queue_STATUS) AssignProperties_To_Namespaces_Queue_STATUS(destination *v20211101s.Namespaces_Queue_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(queue.PropertyBag) + + // AccessedAt + destination.AccessedAt = genruntime.ClonePointerToString(queue.AccessedAt) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(queue.AutoDeleteOnIdle) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(queue.Conditions) + + // CountDetails + if queue.CountDetails != nil { + var countDetail v20211101s.MessageCountDetails_STATUS + err := queue.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_MessageCountDetails_STATUS() to populate field CountDetails") + } + destination.CountDetails = &countDetail + } else { + destination.CountDetails = nil + } + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(queue.CreatedAt) + + // DeadLetteringOnMessageExpiration + if queue.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *queue.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(queue.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(queue.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if queue.EnableBatchedOperations != nil { + enableBatchedOperation := *queue.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if queue.EnableExpress != nil { + enableExpress := *queue.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if queue.EnablePartitioning != nil { + enablePartitioning := *queue.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(queue.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(queue.ForwardTo) + + // Id + destination.Id = genruntime.ClonePointerToString(queue.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(queue.Location) + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(queue.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(queue.MaxDeliveryCount) + + // MaxMessageSizeInKilobytes + destination.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(queue.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(queue.MaxSizeInMegabytes) + + // MessageCount + destination.MessageCount = genruntime.ClonePointerToInt(queue.MessageCount) + + // Name + destination.Name = genruntime.ClonePointerToString(queue.Name) + + // RequiresDuplicateDetection + if queue.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *queue.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // RequiresSession + if queue.RequiresSession != nil { + requiresSession := *queue.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // SizeInBytes + destination.SizeInBytes = genruntime.ClonePointerToInt(queue.SizeInBytes) + + // Status + destination.Status = genruntime.ClonePointerToString(queue.Status) + + // SystemData + if queue.SystemData != nil { + var systemDatum v20211101s.SystemData_STATUS + err := queue.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(queue.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(queue.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Queue_STATUS interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespaces_Queue_STATUS); ok { + err := augmentedQueue.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespaces_Queue_Spec interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Queue_Spec) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Queue_Spec) error +} + +type augmentConversionForNamespaces_Queue_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Queue_STATUS) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Queue_STATUS) error +} + +// Storage version of v1api20221001preview.MessageCountDetails_STATUS +// Message Count Details. +type MessageCountDetails_STATUS struct { + ActiveMessageCount *int `json:"activeMessageCount,omitempty"` + DeadLetterMessageCount *int `json:"deadLetterMessageCount,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ScheduledMessageCount *int `json:"scheduledMessageCount,omitempty"` + TransferDeadLetterMessageCount *int `json:"transferDeadLetterMessageCount,omitempty"` + TransferMessageCount *int `json:"transferMessageCount,omitempty"` +} + +// AssignProperties_From_MessageCountDetails_STATUS populates our MessageCountDetails_STATUS from the provided source MessageCountDetails_STATUS +func (details *MessageCountDetails_STATUS) AssignProperties_From_MessageCountDetails_STATUS(source *v20211101s.MessageCountDetails_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ActiveMessageCount + details.ActiveMessageCount = genruntime.ClonePointerToInt(source.ActiveMessageCount) + + // DeadLetterMessageCount + details.DeadLetterMessageCount = genruntime.ClonePointerToInt(source.DeadLetterMessageCount) + + // ScheduledMessageCount + details.ScheduledMessageCount = genruntime.ClonePointerToInt(source.ScheduledMessageCount) + + // TransferDeadLetterMessageCount + details.TransferDeadLetterMessageCount = genruntime.ClonePointerToInt(source.TransferDeadLetterMessageCount) + + // TransferMessageCount + details.TransferMessageCount = genruntime.ClonePointerToInt(source.TransferMessageCount) + + // Update the property bag + if len(propertyBag) > 0 { + details.PropertyBag = propertyBag + } else { + details.PropertyBag = nil + } + + // Invoke the augmentConversionForMessageCountDetails_STATUS interface (if implemented) to customize the conversion + var detailsAsAny any = details + if augmentedDetails, ok := detailsAsAny.(augmentConversionForMessageCountDetails_STATUS); ok { + err := augmentedDetails.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_MessageCountDetails_STATUS populates the provided destination MessageCountDetails_STATUS from our MessageCountDetails_STATUS +func (details *MessageCountDetails_STATUS) AssignProperties_To_MessageCountDetails_STATUS(destination *v20211101s.MessageCountDetails_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(details.PropertyBag) + + // ActiveMessageCount + destination.ActiveMessageCount = genruntime.ClonePointerToInt(details.ActiveMessageCount) + + // DeadLetterMessageCount + destination.DeadLetterMessageCount = genruntime.ClonePointerToInt(details.DeadLetterMessageCount) + + // ScheduledMessageCount + destination.ScheduledMessageCount = genruntime.ClonePointerToInt(details.ScheduledMessageCount) + + // TransferDeadLetterMessageCount + destination.TransferDeadLetterMessageCount = genruntime.ClonePointerToInt(details.TransferDeadLetterMessageCount) + + // TransferMessageCount + destination.TransferMessageCount = genruntime.ClonePointerToInt(details.TransferMessageCount) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForMessageCountDetails_STATUS interface (if implemented) to customize the conversion + var detailsAsAny any = details + if augmentedDetails, ok := detailsAsAny.(augmentConversionForMessageCountDetails_STATUS); ok { + err := augmentedDetails.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForMessageCountDetails_STATUS interface { + AssignPropertiesFrom(src *v20211101s.MessageCountDetails_STATUS) error + AssignPropertiesTo(dst *v20211101s.MessageCountDetails_STATUS) error +} + +func init() { + SchemeBuilder.Register(&NamespacesQueue{}, &NamespacesQueueList{}) +} diff --git a/v2/api/servicebus/v1api20221001previewstorage/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1api20221001previewstorage/namespaces_queue_types_gen_test.go new file mode 100644 index 00000000000..d821ef567a9 --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/namespaces_queue_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 v1api20221001previewstorage + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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_NamespacesQueue_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 NamespacesQueue to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesQueue, NamespacesQueueGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesQueue tests if a specific instance of NamespacesQueue round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesQueue(subject NamespacesQueue) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesQueue + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesQueue + 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_NamespacesQueue_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesQueue to NamespacesQueue via AssignProperties_To_NamespacesQueue & AssignProperties_From_NamespacesQueue returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesQueue, NamespacesQueueGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesQueue tests if a specific instance of NamespacesQueue can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespacesQueue(subject NamespacesQueue) 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.NamespacesQueue + err := copied.AssignProperties_To_NamespacesQueue(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesQueue + err = actual.AssignProperties_From_NamespacesQueue(&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_NamespacesQueue_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 NamespacesQueue via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesQueue, NamespacesQueueGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesQueue runs a test to see if a specific instance of NamespacesQueue round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesQueue(subject NamespacesQueue) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesQueue + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesQueue instances for property testing - lazily instantiated by NamespacesQueueGenerator() +var namespacesQueueGenerator gopter.Gen + +// NamespacesQueueGenerator returns a generator of NamespacesQueue instances for property testing. +func NamespacesQueueGenerator() gopter.Gen { + if namespacesQueueGenerator != nil { + return namespacesQueueGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesQueue(generators) + namespacesQueueGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue{}), generators) + + return namespacesQueueGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesQueue is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesQueue(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Queue_SpecGenerator() + gens["Status"] = Namespaces_Queue_STATUSGenerator() +} + +func Test_Namespaces_Queue_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Queue_Spec to Namespaces_Queue_Spec via AssignProperties_To_Namespaces_Queue_Spec & AssignProperties_From_Namespaces_Queue_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Queue_Spec, Namespaces_Queue_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Queue_Spec tests if a specific instance of Namespaces_Queue_Spec can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Queue_Spec(subject Namespaces_Queue_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 v20211101s.Namespaces_Queue_Spec + err := copied.AssignProperties_To_Namespaces_Queue_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Queue_Spec + err = actual.AssignProperties_From_Namespaces_Queue_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_Queue_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_Queue_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Queue_Spec, Namespaces_Queue_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Queue_Spec runs a test to see if a specific instance of Namespaces_Queue_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Queue_Spec(subject Namespaces_Queue_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Queue_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_Queue_Spec instances for property testing - lazily instantiated by +// Namespaces_Queue_SpecGenerator() +var namespaces_Queue_SpecGenerator gopter.Gen + +// Namespaces_Queue_SpecGenerator returns a generator of Namespaces_Queue_Spec instances for property testing. +func Namespaces_Queue_SpecGenerator() gopter.Gen { + if namespaces_Queue_SpecGenerator != nil { + return namespaces_Queue_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec(generators) + namespaces_Queue_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_Spec{}), generators) + + return namespaces_Queue_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Queue_Spec(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["OriginalVersion"] = gen.AlphaString() + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) +} + +func Test_Namespaces_Queue_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Queue_STATUS to Namespaces_Queue_STATUS via AssignProperties_To_Namespaces_Queue_STATUS & AssignProperties_From_Namespaces_Queue_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Queue_STATUS, Namespaces_Queue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Queue_STATUS tests if a specific instance of Namespaces_Queue_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Queue_STATUS(subject Namespaces_Queue_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 v20211101s.Namespaces_Queue_STATUS + err := copied.AssignProperties_To_Namespaces_Queue_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Queue_STATUS + err = actual.AssignProperties_From_Namespaces_Queue_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_Queue_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_Queue_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Queue_STATUS, Namespaces_Queue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Queue_STATUS runs a test to see if a specific instance of Namespaces_Queue_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Queue_STATUS(subject Namespaces_Queue_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Queue_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_Queue_STATUS instances for property testing - lazily instantiated by +// Namespaces_Queue_STATUSGenerator() +var namespaces_Queue_STATUSGenerator gopter.Gen + +// Namespaces_Queue_STATUSGenerator returns a generator of Namespaces_Queue_STATUS instances for property testing. +// We first initialize namespaces_Queue_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_Queue_STATUSGenerator() gopter.Gen { + if namespaces_Queue_STATUSGenerator != nil { + return namespaces_Queue_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS(generators) + namespaces_Queue_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS(generators) + namespaces_Queue_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Queue_STATUS{}), generators) + + return namespaces_Queue_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Queue_STATUS(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["MessageCount"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) + gens["SizeInBytes"] = gen.PtrOf(gen.Int()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Queue_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_MessageCountDetails_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from MessageCountDetails_STATUS to MessageCountDetails_STATUS via AssignProperties_To_MessageCountDetails_STATUS & AssignProperties_From_MessageCountDetails_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForMessageCountDetails_STATUS, MessageCountDetails_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForMessageCountDetails_STATUS tests if a specific instance of MessageCountDetails_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForMessageCountDetails_STATUS(subject MessageCountDetails_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 v20211101s.MessageCountDetails_STATUS + err := copied.AssignProperties_To_MessageCountDetails_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual MessageCountDetails_STATUS + err = actual.AssignProperties_From_MessageCountDetails_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_MessageCountDetails_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 MessageCountDetails_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForMessageCountDetails_STATUS, MessageCountDetails_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForMessageCountDetails_STATUS runs a test to see if a specific instance of MessageCountDetails_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForMessageCountDetails_STATUS(subject MessageCountDetails_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual MessageCountDetails_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 MessageCountDetails_STATUS instances for property testing - lazily instantiated by +// MessageCountDetails_STATUSGenerator() +var messageCountDetails_STATUSGenerator gopter.Gen + +// MessageCountDetails_STATUSGenerator returns a generator of MessageCountDetails_STATUS instances for property testing. +func MessageCountDetails_STATUSGenerator() gopter.Gen { + if messageCountDetails_STATUSGenerator != nil { + return messageCountDetails_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS(generators) + messageCountDetails_STATUSGenerator = gen.Struct(reflect.TypeOf(MessageCountDetails_STATUS{}), generators) + + return messageCountDetails_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS(gens map[string]gopter.Gen) { + gens["ActiveMessageCount"] = gen.PtrOf(gen.Int()) + gens["DeadLetterMessageCount"] = gen.PtrOf(gen.Int()) + gens["ScheduledMessageCount"] = gen.PtrOf(gen.Int()) + gens["TransferDeadLetterMessageCount"] = gen.PtrOf(gen.Int()) + gens["TransferMessageCount"] = gen.PtrOf(gen.Int()) +} diff --git a/v2/api/servicebus/v1api20221001previewstorage/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20221001previewstorage/namespaces_topic_types_gen.go new file mode 100644 index 00000000000..ad1f298ef3f --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/namespaces_topic_types_gen.go @@ -0,0 +1,858 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001previewstorage + +import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Storage version of v1api20221001preview.NamespacesTopic +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/topics.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName} +type NamespacesTopic struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Topic_Spec `json:"spec,omitempty"` + Status Namespaces_Topic_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesTopic{} + +// GetConditions returns the conditions of the resource +func (topic *NamespacesTopic) GetConditions() conditions.Conditions { + return topic.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (topic *NamespacesTopic) SetConditions(conditions conditions.Conditions) { + topic.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesTopic{} + +// ConvertFrom populates our NamespacesTopic from the provided hub NamespacesTopic +func (topic *NamespacesTopic) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20211101s.NamespacesTopic) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopic but received %T instead", hub) + } + + return topic.AssignProperties_From_NamespacesTopic(source) +} + +// ConvertTo populates the provided hub NamespacesTopic from our NamespacesTopic +func (topic *NamespacesTopic) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20211101s.NamespacesTopic) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopic but received %T instead", hub) + } + + return topic.AssignProperties_To_NamespacesTopic(destination) +} + +var _ genruntime.KubernetesResource = &NamespacesTopic{} + +// AzureName returns the Azure name of the resource +func (topic *NamespacesTopic) AzureName() string { + return topic.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2022-10-01-preview" +func (topic NamespacesTopic) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (topic *NamespacesTopic) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (topic *NamespacesTopic) GetSpec() genruntime.ConvertibleSpec { + return &topic.Spec +} + +// GetStatus returns the status of this resource +func (topic *NamespacesTopic) GetStatus() genruntime.ConvertibleStatus { + return &topic.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics" +func (topic *NamespacesTopic) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics" +} + +// NewEmptyStatus returns a new empty (blank) status +func (topic *NamespacesTopic) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Topic_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (topic *NamespacesTopic) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: topic.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (topic *NamespacesTopic) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Topic_STATUS); ok { + topic.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Topic_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + topic.Status = st + return nil +} + +// AssignProperties_From_NamespacesTopic populates our NamespacesTopic from the provided source NamespacesTopic +func (topic *NamespacesTopic) AssignProperties_From_NamespacesTopic(source *v20211101s.NamespacesTopic) error { + + // ObjectMeta + topic.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Topic_Spec + err := spec.AssignProperties_From_Namespaces_Topic_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topic_Spec() to populate field Spec") + } + topic.Spec = spec + + // Status + var status Namespaces_Topic_STATUS + err = status.AssignProperties_From_Namespaces_Topic_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topic_STATUS() to populate field Status") + } + topic.Status = status + + // Invoke the augmentConversionForNamespacesTopic interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespacesTopic); ok { + err := augmentedTopic.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopic populates the provided destination NamespacesTopic from our NamespacesTopic +func (topic *NamespacesTopic) AssignProperties_To_NamespacesTopic(destination *v20211101s.NamespacesTopic) error { + + // ObjectMeta + destination.ObjectMeta = *topic.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.Namespaces_Topic_Spec + err := topic.Spec.AssignProperties_To_Namespaces_Topic_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topic_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20211101s.Namespaces_Topic_STATUS + err = topic.Status.AssignProperties_To_Namespaces_Topic_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topic_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForNamespacesTopic interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespacesTopic); ok { + err := augmentedTopic.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 (topic *NamespacesTopic) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: topic.Spec.OriginalVersion, + Kind: "NamespacesTopic", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20221001preview.NamespacesTopic +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/topics.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName} +type NamespacesTopicList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesTopic `json:"items"` +} + +type augmentConversionForNamespacesTopic interface { + AssignPropertiesFrom(src *v20211101s.NamespacesTopic) error + AssignPropertiesTo(dst *v20211101s.NamespacesTopic) error +} + +// Storage version of v1api20221001preview.Namespaces_Topic_Spec +type Namespaces_Topic_Spec struct { + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // +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"` + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + EnableExpress *bool `json:"enableExpress,omitempty"` + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,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 servicebus.azure.com/Namespace resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"Namespace"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + SupportOrdering *bool `json:"supportOrdering,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Topic_Spec{} + +// ConvertSpecFrom populates our Namespaces_Topic_Spec from the provided source +func (topic *Namespaces_Topic_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20211101s.Namespaces_Topic_Spec) + if ok { + // Populate our instance from source + return topic.AssignProperties_From_Namespaces_Topic_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topic_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = topic.AssignProperties_From_Namespaces_Topic_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_Topic_Spec +func (topic *Namespaces_Topic_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20211101s.Namespaces_Topic_Spec) + if ok { + // Populate destination from our instance + return topic.AssignProperties_To_Namespaces_Topic_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topic_Spec{} + err := topic.AssignProperties_To_Namespaces_Topic_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_Topic_Spec populates our Namespaces_Topic_Spec from the provided source Namespaces_Topic_Spec +func (topic *Namespaces_Topic_Spec) AssignProperties_From_Namespaces_Topic_Spec(source *v20211101s.Namespaces_Topic_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AutoDeleteOnIdle + topic.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // AzureName + topic.AzureName = source.AzureName + + // DefaultMessageTimeToLive + topic.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + topic.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + topic.EnableBatchedOperations = &enableBatchedOperation + } else { + topic.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + topic.EnableExpress = &enableExpress + } else { + topic.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + topic.EnablePartitioning = &enablePartitioning + } else { + topic.EnablePartitioning = nil + } + + // MaxMessageSizeInKilobytes + topic.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + topic.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // OriginalVersion + topic.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + topic.Owner = &owner + } else { + topic.Owner = nil + } + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + topic.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + topic.RequiresDuplicateDetection = nil + } + + // SupportOrdering + if source.SupportOrdering != nil { + supportOrdering := *source.SupportOrdering + topic.SupportOrdering = &supportOrdering + } else { + topic.SupportOrdering = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + topic.PropertyBag = propertyBag + } else { + topic.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topic_Spec interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespaces_Topic_Spec); ok { + err := augmentedTopic.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topic_Spec populates the provided destination Namespaces_Topic_Spec from our Namespaces_Topic_Spec +func (topic *Namespaces_Topic_Spec) AssignProperties_To_Namespaces_Topic_Spec(destination *v20211101s.Namespaces_Topic_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(topic.PropertyBag) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(topic.AutoDeleteOnIdle) + + // AzureName + destination.AzureName = topic.AzureName + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(topic.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(topic.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if topic.EnableBatchedOperations != nil { + enableBatchedOperation := *topic.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if topic.EnableExpress != nil { + enableExpress := *topic.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if topic.EnablePartitioning != nil { + enablePartitioning := *topic.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // MaxMessageSizeInKilobytes + destination.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(topic.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(topic.MaxSizeInMegabytes) + + // OriginalVersion + destination.OriginalVersion = topic.OriginalVersion + + // Owner + if topic.Owner != nil { + owner := topic.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // RequiresDuplicateDetection + if topic.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *topic.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // SupportOrdering + if topic.SupportOrdering != nil { + supportOrdering := *topic.SupportOrdering + destination.SupportOrdering = &supportOrdering + } else { + destination.SupportOrdering = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topic_Spec interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespaces_Topic_Spec); ok { + err := augmentedTopic.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20221001preview.Namespaces_Topic_STATUS +type Namespaces_Topic_STATUS struct { + AccessedAt *string `json:"accessedAt,omitempty"` + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + Conditions []conditions.Condition `json:"conditions,omitempty"` + CountDetails *MessageCountDetails_STATUS `json:"countDetails,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + EnableExpress *bool `json:"enableExpress,omitempty"` + EnablePartitioning *bool `json:"enablePartitioning,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + MaxMessageSizeInKilobytes *int `json:"maxMessageSizeInKilobytes,omitempty"` + MaxSizeInMegabytes *int `json:"maxSizeInMegabytes,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + SizeInBytes *int `json:"sizeInBytes,omitempty"` + Status *string `json:"status,omitempty"` + SubscriptionCount *int `json:"subscriptionCount,omitempty"` + SupportOrdering *bool `json:"supportOrdering,omitempty"` + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` + UpdatedAt *string `json:"updatedAt,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespaces_Topic_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Topic_STATUS from the provided source +func (topic *Namespaces_Topic_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20211101s.Namespaces_Topic_STATUS) + if ok { + // Populate our instance from source + return topic.AssignProperties_From_Namespaces_Topic_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topic_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = topic.AssignProperties_From_Namespaces_Topic_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_Topic_STATUS +func (topic *Namespaces_Topic_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20211101s.Namespaces_Topic_STATUS) + if ok { + // Populate destination from our instance + return topic.AssignProperties_To_Namespaces_Topic_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topic_STATUS{} + err := topic.AssignProperties_To_Namespaces_Topic_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_Topic_STATUS populates our Namespaces_Topic_STATUS from the provided source Namespaces_Topic_STATUS +func (topic *Namespaces_Topic_STATUS) AssignProperties_From_Namespaces_Topic_STATUS(source *v20211101s.Namespaces_Topic_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AccessedAt + topic.AccessedAt = genruntime.ClonePointerToString(source.AccessedAt) + + // AutoDeleteOnIdle + topic.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // Conditions + topic.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CountDetails + if source.CountDetails != nil { + var countDetail MessageCountDetails_STATUS + err := countDetail.AssignProperties_From_MessageCountDetails_STATUS(source.CountDetails) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_MessageCountDetails_STATUS() to populate field CountDetails") + } + topic.CountDetails = &countDetail + } else { + topic.CountDetails = nil + } + + // CreatedAt + topic.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DefaultMessageTimeToLive + topic.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + topic.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + topic.EnableBatchedOperations = &enableBatchedOperation + } else { + topic.EnableBatchedOperations = nil + } + + // EnableExpress + if source.EnableExpress != nil { + enableExpress := *source.EnableExpress + topic.EnableExpress = &enableExpress + } else { + topic.EnableExpress = nil + } + + // EnablePartitioning + if source.EnablePartitioning != nil { + enablePartitioning := *source.EnablePartitioning + topic.EnablePartitioning = &enablePartitioning + } else { + topic.EnablePartitioning = nil + } + + // Id + topic.Id = genruntime.ClonePointerToString(source.Id) + + // Location + topic.Location = genruntime.ClonePointerToString(source.Location) + + // MaxMessageSizeInKilobytes + topic.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(source.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + topic.MaxSizeInMegabytes = genruntime.ClonePointerToInt(source.MaxSizeInMegabytes) + + // Name + topic.Name = genruntime.ClonePointerToString(source.Name) + + // RequiresDuplicateDetection + if source.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *source.RequiresDuplicateDetection + topic.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + topic.RequiresDuplicateDetection = nil + } + + // SizeInBytes + topic.SizeInBytes = genruntime.ClonePointerToInt(source.SizeInBytes) + + // Status + topic.Status = genruntime.ClonePointerToString(source.Status) + + // SubscriptionCount + topic.SubscriptionCount = genruntime.ClonePointerToInt(source.SubscriptionCount) + + // SupportOrdering + if source.SupportOrdering != nil { + supportOrdering := *source.SupportOrdering + topic.SupportOrdering = &supportOrdering + } else { + topic.SupportOrdering = 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") + } + topic.SystemData = &systemDatum + } else { + topic.SystemData = nil + } + + // Type + topic.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + topic.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + topic.PropertyBag = propertyBag + } else { + topic.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topic_STATUS interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespaces_Topic_STATUS); ok { + err := augmentedTopic.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topic_STATUS populates the provided destination Namespaces_Topic_STATUS from our Namespaces_Topic_STATUS +func (topic *Namespaces_Topic_STATUS) AssignProperties_To_Namespaces_Topic_STATUS(destination *v20211101s.Namespaces_Topic_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(topic.PropertyBag) + + // AccessedAt + destination.AccessedAt = genruntime.ClonePointerToString(topic.AccessedAt) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(topic.AutoDeleteOnIdle) + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(topic.Conditions) + + // CountDetails + if topic.CountDetails != nil { + var countDetail v20211101s.MessageCountDetails_STATUS + err := topic.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_MessageCountDetails_STATUS() to populate field CountDetails") + } + destination.CountDetails = &countDetail + } else { + destination.CountDetails = nil + } + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(topic.CreatedAt) + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(topic.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(topic.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if topic.EnableBatchedOperations != nil { + enableBatchedOperation := *topic.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // EnableExpress + if topic.EnableExpress != nil { + enableExpress := *topic.EnableExpress + destination.EnableExpress = &enableExpress + } else { + destination.EnableExpress = nil + } + + // EnablePartitioning + if topic.EnablePartitioning != nil { + enablePartitioning := *topic.EnablePartitioning + destination.EnablePartitioning = &enablePartitioning + } else { + destination.EnablePartitioning = nil + } + + // Id + destination.Id = genruntime.ClonePointerToString(topic.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(topic.Location) + + // MaxMessageSizeInKilobytes + destination.MaxMessageSizeInKilobytes = genruntime.ClonePointerToInt(topic.MaxMessageSizeInKilobytes) + + // MaxSizeInMegabytes + destination.MaxSizeInMegabytes = genruntime.ClonePointerToInt(topic.MaxSizeInMegabytes) + + // Name + destination.Name = genruntime.ClonePointerToString(topic.Name) + + // RequiresDuplicateDetection + if topic.RequiresDuplicateDetection != nil { + requiresDuplicateDetection := *topic.RequiresDuplicateDetection + destination.RequiresDuplicateDetection = &requiresDuplicateDetection + } else { + destination.RequiresDuplicateDetection = nil + } + + // SizeInBytes + destination.SizeInBytes = genruntime.ClonePointerToInt(topic.SizeInBytes) + + // Status + destination.Status = genruntime.ClonePointerToString(topic.Status) + + // SubscriptionCount + destination.SubscriptionCount = genruntime.ClonePointerToInt(topic.SubscriptionCount) + + // SupportOrdering + if topic.SupportOrdering != nil { + supportOrdering := *topic.SupportOrdering + destination.SupportOrdering = &supportOrdering + } else { + destination.SupportOrdering = nil + } + + // SystemData + if topic.SystemData != nil { + var systemDatum v20211101s.SystemData_STATUS + err := topic.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(topic.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(topic.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topic_STATUS interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespaces_Topic_STATUS); ok { + err := augmentedTopic.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespaces_Topic_Spec interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Topic_Spec) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Topic_Spec) error +} + +type augmentConversionForNamespaces_Topic_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Topic_STATUS) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Topic_STATUS) error +} + +func init() { + SchemeBuilder.Register(&NamespacesTopic{}, &NamespacesTopicList{}) +} diff --git a/v2/api/servicebus/v1api20221001previewstorage/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1api20221001previewstorage/namespaces_topic_types_gen_test.go new file mode 100644 index 00000000000..45bc2db4322 --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/namespaces_topic_types_gen_test.go @@ -0,0 +1,416 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001previewstorage + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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_NamespacesTopic_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 NamespacesTopic to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesTopic, NamespacesTopicGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesTopic tests if a specific instance of NamespacesTopic round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesTopic(subject NamespacesTopic) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesTopic + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesTopic + 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_NamespacesTopic_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopic to NamespacesTopic via AssignProperties_To_NamespacesTopic & AssignProperties_From_NamespacesTopic returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopic, NamespacesTopicGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopic tests if a specific instance of NamespacesTopic can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopic(subject NamespacesTopic) 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.NamespacesTopic + err := copied.AssignProperties_To_NamespacesTopic(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopic + err = actual.AssignProperties_From_NamespacesTopic(&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_NamespacesTopic_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 NamespacesTopic via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopic, NamespacesTopicGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopic runs a test to see if a specific instance of NamespacesTopic round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopic(subject NamespacesTopic) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopic + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopic instances for property testing - lazily instantiated by NamespacesTopicGenerator() +var namespacesTopicGenerator gopter.Gen + +// NamespacesTopicGenerator returns a generator of NamespacesTopic instances for property testing. +func NamespacesTopicGenerator() gopter.Gen { + if namespacesTopicGenerator != nil { + return namespacesTopicGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesTopic(generators) + namespacesTopicGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic{}), generators) + + return namespacesTopicGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesTopic is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopic(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Topic_SpecGenerator() + gens["Status"] = Namespaces_Topic_STATUSGenerator() +} + +func Test_Namespaces_Topic_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topic_Spec to Namespaces_Topic_Spec via AssignProperties_To_Namespaces_Topic_Spec & AssignProperties_From_Namespaces_Topic_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topic_Spec, Namespaces_Topic_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topic_Spec tests if a specific instance of Namespaces_Topic_Spec can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topic_Spec(subject Namespaces_Topic_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 v20211101s.Namespaces_Topic_Spec + err := copied.AssignProperties_To_Namespaces_Topic_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topic_Spec + err = actual.AssignProperties_From_Namespaces_Topic_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_Topic_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_Topic_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topic_Spec, Namespaces_Topic_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topic_Spec runs a test to see if a specific instance of Namespaces_Topic_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topic_Spec(subject Namespaces_Topic_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topic_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_Topic_Spec instances for property testing - lazily instantiated by +// Namespaces_Topic_SpecGenerator() +var namespaces_Topic_SpecGenerator gopter.Gen + +// Namespaces_Topic_SpecGenerator returns a generator of Namespaces_Topic_Spec instances for property testing. +func Namespaces_Topic_SpecGenerator() gopter.Gen { + if namespaces_Topic_SpecGenerator != nil { + return namespaces_Topic_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec(generators) + namespaces_Topic_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_Spec{}), generators) + + return namespaces_Topic_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topic_Spec(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["OriginalVersion"] = gen.AlphaString() + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["SupportOrdering"] = gen.PtrOf(gen.Bool()) +} + +func Test_Namespaces_Topic_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topic_STATUS to Namespaces_Topic_STATUS via AssignProperties_To_Namespaces_Topic_STATUS & AssignProperties_From_Namespaces_Topic_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topic_STATUS, Namespaces_Topic_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topic_STATUS tests if a specific instance of Namespaces_Topic_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topic_STATUS(subject Namespaces_Topic_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 v20211101s.Namespaces_Topic_STATUS + err := copied.AssignProperties_To_Namespaces_Topic_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topic_STATUS + err = actual.AssignProperties_From_Namespaces_Topic_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_Topic_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_Topic_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topic_STATUS, Namespaces_Topic_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topic_STATUS runs a test to see if a specific instance of Namespaces_Topic_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topic_STATUS(subject Namespaces_Topic_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topic_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_Topic_STATUS instances for property testing - lazily instantiated by +// Namespaces_Topic_STATUSGenerator() +var namespaces_Topic_STATUSGenerator gopter.Gen + +// Namespaces_Topic_STATUSGenerator returns a generator of Namespaces_Topic_STATUS instances for property testing. +// We first initialize namespaces_Topic_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_Topic_STATUSGenerator() gopter.Gen { + if namespaces_Topic_STATUSGenerator != nil { + return namespaces_Topic_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS(generators) + namespaces_Topic_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS(generators) + namespaces_Topic_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topic_STATUS{}), generators) + + return namespaces_Topic_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topic_STATUS(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["EnableExpress"] = gen.PtrOf(gen.Bool()) + gens["EnablePartitioning"] = gen.PtrOf(gen.Bool()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["MaxMessageSizeInKilobytes"] = gen.PtrOf(gen.Int()) + gens["MaxSizeInMegabytes"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresDuplicateDetection"] = gen.PtrOf(gen.Bool()) + gens["SizeInBytes"] = gen.PtrOf(gen.Int()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) + gens["SubscriptionCount"] = gen.PtrOf(gen.Int()) + gens["SupportOrdering"] = gen.PtrOf(gen.Bool()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topic_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} diff --git a/v2/api/servicebus/v1api20221001previewstorage/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20221001previewstorage/namespaces_topics_subscription_types_gen.go new file mode 100644 index 00000000000..5885f7fe365 --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/namespaces_topics_subscription_types_gen.go @@ -0,0 +1,1134 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001previewstorage + +import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Storage version of v1api20221001preview.NamespacesTopicsSubscription +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/subscriptions.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName} +type NamespacesTopicsSubscription struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Topics_Subscription_Spec `json:"spec,omitempty"` + Status Namespaces_Topics_Subscription_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesTopicsSubscription{} + +// GetConditions returns the conditions of the resource +func (subscription *NamespacesTopicsSubscription) GetConditions() conditions.Conditions { + return subscription.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (subscription *NamespacesTopicsSubscription) SetConditions(conditions conditions.Conditions) { + subscription.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesTopicsSubscription{} + +// ConvertFrom populates our NamespacesTopicsSubscription from the provided hub NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20211101s.NamespacesTopicsSubscription) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopicsSubscription but received %T instead", hub) + } + + return subscription.AssignProperties_From_NamespacesTopicsSubscription(source) +} + +// ConvertTo populates the provided hub NamespacesTopicsSubscription from our NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20211101s.NamespacesTopicsSubscription) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopicsSubscription but received %T instead", hub) + } + + return subscription.AssignProperties_To_NamespacesTopicsSubscription(destination) +} + +var _ genruntime.KubernetesResource = &NamespacesTopicsSubscription{} + +// AzureName returns the Azure name of the resource +func (subscription *NamespacesTopicsSubscription) AzureName() string { + return subscription.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2022-10-01-preview" +func (subscription NamespacesTopicsSubscription) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (subscription *NamespacesTopicsSubscription) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (subscription *NamespacesTopicsSubscription) GetSpec() genruntime.ConvertibleSpec { + return &subscription.Spec +} + +// GetStatus returns the status of this resource +func (subscription *NamespacesTopicsSubscription) GetStatus() genruntime.ConvertibleStatus { + return &subscription.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions" +func (subscription *NamespacesTopicsSubscription) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions" +} + +// NewEmptyStatus returns a new empty (blank) status +func (subscription *NamespacesTopicsSubscription) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Topics_Subscription_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (subscription *NamespacesTopicsSubscription) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: subscription.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (subscription *NamespacesTopicsSubscription) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Topics_Subscription_STATUS); ok { + subscription.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Topics_Subscription_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + subscription.Status = st + return nil +} + +// AssignProperties_From_NamespacesTopicsSubscription populates our NamespacesTopicsSubscription from the provided source NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) AssignProperties_From_NamespacesTopicsSubscription(source *v20211101s.NamespacesTopicsSubscription) error { + + // ObjectMeta + subscription.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Topics_Subscription_Spec + err := spec.AssignProperties_From_Namespaces_Topics_Subscription_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscription_Spec() to populate field Spec") + } + subscription.Spec = spec + + // Status + var status Namespaces_Topics_Subscription_STATUS + err = status.AssignProperties_From_Namespaces_Topics_Subscription_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscription_STATUS() to populate field Status") + } + subscription.Status = status + + // Invoke the augmentConversionForNamespacesTopicsSubscription interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespacesTopicsSubscription); ok { + err := augmentedSubscription.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscription populates the provided destination NamespacesTopicsSubscription from our NamespacesTopicsSubscription +func (subscription *NamespacesTopicsSubscription) AssignProperties_To_NamespacesTopicsSubscription(destination *v20211101s.NamespacesTopicsSubscription) error { + + // ObjectMeta + destination.ObjectMeta = *subscription.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.Namespaces_Topics_Subscription_Spec + err := subscription.Spec.AssignProperties_To_Namespaces_Topics_Subscription_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscription_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20211101s.Namespaces_Topics_Subscription_STATUS + err = subscription.Status.AssignProperties_To_Namespaces_Topics_Subscription_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscription_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForNamespacesTopicsSubscription interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespacesTopicsSubscription); ok { + err := augmentedSubscription.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 (subscription *NamespacesTopicsSubscription) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: subscription.Spec.OriginalVersion, + Kind: "NamespacesTopicsSubscription", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20221001preview.NamespacesTopicsSubscription +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/subscriptions.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName} +type NamespacesTopicsSubscriptionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesTopicsSubscription `json:"items"` +} + +type augmentConversionForNamespacesTopicsSubscription interface { + AssignPropertiesFrom(src *v20211101s.NamespacesTopicsSubscription) error + AssignPropertiesTo(dst *v20211101s.NamespacesTopicsSubscription) error +} + +// Storage version of v1api20221001preview.Namespaces_Topics_Subscription_Spec +type Namespaces_Topics_Subscription_Spec struct { + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + + // +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"` + ClientAffineProperties *SBClientAffineProperties `json:"clientAffineProperties,omitempty"` + DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"` + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + ForwardTo *string `json:"forwardTo,omitempty"` + IsClientAffine *bool `json:"isClientAffine,omitempty"` + LockDuration *string `json:"lockDuration,omitempty"` + MaxDeliveryCount *int `json:"maxDeliveryCount,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 servicebus.azure.com/NamespacesTopic resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"NamespacesTopic"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresSession *bool `json:"requiresSession,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Topics_Subscription_Spec{} + +// ConvertSpecFrom populates our Namespaces_Topics_Subscription_Spec from the provided source +func (subscription *Namespaces_Topics_Subscription_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20211101s.Namespaces_Topics_Subscription_Spec) + if ok { + // Populate our instance from source + return subscription.AssignProperties_From_Namespaces_Topics_Subscription_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topics_Subscription_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = subscription.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_Spec +func (subscription *Namespaces_Topics_Subscription_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20211101s.Namespaces_Topics_Subscription_Spec) + if ok { + // Populate destination from our instance + return subscription.AssignProperties_To_Namespaces_Topics_Subscription_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topics_Subscription_Spec{} + err := subscription.AssignProperties_To_Namespaces_Topics_Subscription_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_Topics_Subscription_Spec populates our Namespaces_Topics_Subscription_Spec from the provided source Namespaces_Topics_Subscription_Spec +func (subscription *Namespaces_Topics_Subscription_Spec) AssignProperties_From_Namespaces_Topics_Subscription_Spec(source *v20211101s.Namespaces_Topics_Subscription_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AutoDeleteOnIdle + subscription.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // AzureName + subscription.AzureName = source.AzureName + + // ClientAffineProperties + if source.ClientAffineProperties != nil { + var clientAffineProperty SBClientAffineProperties + err := clientAffineProperty.AssignProperties_From_SBClientAffineProperties(source.ClientAffineProperties) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBClientAffineProperties() to populate field ClientAffineProperties") + } + subscription.ClientAffineProperties = &clientAffineProperty + } else { + subscription.ClientAffineProperties = nil + } + + // DeadLetteringOnFilterEvaluationExceptions + if source.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *source.DeadLetteringOnFilterEvaluationExceptions + subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + subscription.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + subscription.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + subscription.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + subscription.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + subscription.EnableBatchedOperations = &enableBatchedOperation + } else { + subscription.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + subscription.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + subscription.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // IsClientAffine + if source.IsClientAffine != nil { + isClientAffine := *source.IsClientAffine + subscription.IsClientAffine = &isClientAffine + } else { + subscription.IsClientAffine = nil + } + + // LockDuration + subscription.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + subscription.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // OriginalVersion + subscription.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + subscription.Owner = &owner + } else { + subscription.Owner = nil + } + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + subscription.RequiresSession = &requiresSession + } else { + subscription.RequiresSession = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + subscription.PropertyBag = propertyBag + } else { + subscription.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topics_Subscription_Spec interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespaces_Topics_Subscription_Spec); ok { + err := augmentedSubscription.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topics_Subscription_Spec populates the provided destination Namespaces_Topics_Subscription_Spec from our Namespaces_Topics_Subscription_Spec +func (subscription *Namespaces_Topics_Subscription_Spec) AssignProperties_To_Namespaces_Topics_Subscription_Spec(destination *v20211101s.Namespaces_Topics_Subscription_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(subscription.PropertyBag) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(subscription.AutoDeleteOnIdle) + + // AzureName + destination.AzureName = subscription.AzureName + + // ClientAffineProperties + if subscription.ClientAffineProperties != nil { + var clientAffineProperty v20211101s.SBClientAffineProperties + err := subscription.ClientAffineProperties.AssignProperties_To_SBClientAffineProperties(&clientAffineProperty) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBClientAffineProperties() to populate field ClientAffineProperties") + } + destination.ClientAffineProperties = &clientAffineProperty + } else { + destination.ClientAffineProperties = nil + } + + // DeadLetteringOnFilterEvaluationExceptions + if subscription.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *subscription.DeadLetteringOnFilterEvaluationExceptions + destination.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + destination.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if subscription.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *subscription.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(subscription.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(subscription.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if subscription.EnableBatchedOperations != nil { + enableBatchedOperation := *subscription.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(subscription.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(subscription.ForwardTo) + + // IsClientAffine + if subscription.IsClientAffine != nil { + isClientAffine := *subscription.IsClientAffine + destination.IsClientAffine = &isClientAffine + } else { + destination.IsClientAffine = nil + } + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(subscription.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(subscription.MaxDeliveryCount) + + // OriginalVersion + destination.OriginalVersion = subscription.OriginalVersion + + // Owner + if subscription.Owner != nil { + owner := subscription.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // RequiresSession + if subscription.RequiresSession != nil { + requiresSession := *subscription.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topics_Subscription_Spec interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespaces_Topics_Subscription_Spec); ok { + err := augmentedSubscription.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20221001preview.Namespaces_Topics_Subscription_STATUS +type Namespaces_Topics_Subscription_STATUS struct { + AccessedAt *string `json:"accessedAt,omitempty"` + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` + ClientAffineProperties *SBClientAffineProperties_STATUS `json:"clientAffineProperties,omitempty"` + Conditions []conditions.Condition `json:"conditions,omitempty"` + CountDetails *MessageCountDetails_STATUS `json:"countDetails,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` + DeadLetteringOnFilterEvaluationExceptions *bool `json:"deadLetteringOnFilterEvaluationExceptions,omitempty"` + DeadLetteringOnMessageExpiration *bool `json:"deadLetteringOnMessageExpiration,omitempty"` + DefaultMessageTimeToLive *string `json:"defaultMessageTimeToLive,omitempty"` + DuplicateDetectionHistoryTimeWindow *string `json:"duplicateDetectionHistoryTimeWindow,omitempty"` + EnableBatchedOperations *bool `json:"enableBatchedOperations,omitempty"` + ForwardDeadLetteredMessagesTo *string `json:"forwardDeadLetteredMessagesTo,omitempty"` + ForwardTo *string `json:"forwardTo,omitempty"` + Id *string `json:"id,omitempty"` + IsClientAffine *bool `json:"isClientAffine,omitempty"` + Location *string `json:"location,omitempty"` + LockDuration *string `json:"lockDuration,omitempty"` + MaxDeliveryCount *int `json:"maxDeliveryCount,omitempty"` + MessageCount *int `json:"messageCount,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresSession *bool `json:"requiresSession,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_Topics_Subscription_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Topics_Subscription_STATUS from the provided source +func (subscription *Namespaces_Topics_Subscription_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20211101s.Namespaces_Topics_Subscription_STATUS) + if ok { + // Populate our instance from source + return subscription.AssignProperties_From_Namespaces_Topics_Subscription_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topics_Subscription_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = subscription.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS +func (subscription *Namespaces_Topics_Subscription_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20211101s.Namespaces_Topics_Subscription_STATUS) + if ok { + // Populate destination from our instance + return subscription.AssignProperties_To_Namespaces_Topics_Subscription_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topics_Subscription_STATUS{} + err := subscription.AssignProperties_To_Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS populates our Namespaces_Topics_Subscription_STATUS from the provided source Namespaces_Topics_Subscription_STATUS +func (subscription *Namespaces_Topics_Subscription_STATUS) AssignProperties_From_Namespaces_Topics_Subscription_STATUS(source *v20211101s.Namespaces_Topics_Subscription_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // AccessedAt + subscription.AccessedAt = genruntime.ClonePointerToString(source.AccessedAt) + + // AutoDeleteOnIdle + subscription.AutoDeleteOnIdle = genruntime.ClonePointerToString(source.AutoDeleteOnIdle) + + // ClientAffineProperties + if source.ClientAffineProperties != nil { + var clientAffineProperty SBClientAffineProperties_STATUS + err := clientAffineProperty.AssignProperties_From_SBClientAffineProperties_STATUS(source.ClientAffineProperties) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SBClientAffineProperties_STATUS() to populate field ClientAffineProperties") + } + subscription.ClientAffineProperties = &clientAffineProperty + } else { + subscription.ClientAffineProperties = nil + } + + // Conditions + subscription.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CountDetails + if source.CountDetails != nil { + var countDetail MessageCountDetails_STATUS + err := countDetail.AssignProperties_From_MessageCountDetails_STATUS(source.CountDetails) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_MessageCountDetails_STATUS() to populate field CountDetails") + } + subscription.CountDetails = &countDetail + } else { + subscription.CountDetails = nil + } + + // CreatedAt + subscription.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // DeadLetteringOnFilterEvaluationExceptions + if source.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *source.DeadLetteringOnFilterEvaluationExceptions + subscription.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + subscription.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if source.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *source.DeadLetteringOnMessageExpiration + subscription.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + subscription.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + subscription.DefaultMessageTimeToLive = genruntime.ClonePointerToString(source.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + subscription.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(source.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if source.EnableBatchedOperations != nil { + enableBatchedOperation := *source.EnableBatchedOperations + subscription.EnableBatchedOperations = &enableBatchedOperation + } else { + subscription.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + subscription.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(source.ForwardDeadLetteredMessagesTo) + + // ForwardTo + subscription.ForwardTo = genruntime.ClonePointerToString(source.ForwardTo) + + // Id + subscription.Id = genruntime.ClonePointerToString(source.Id) + + // IsClientAffine + if source.IsClientAffine != nil { + isClientAffine := *source.IsClientAffine + subscription.IsClientAffine = &isClientAffine + } else { + subscription.IsClientAffine = nil + } + + // Location + subscription.Location = genruntime.ClonePointerToString(source.Location) + + // LockDuration + subscription.LockDuration = genruntime.ClonePointerToString(source.LockDuration) + + // MaxDeliveryCount + subscription.MaxDeliveryCount = genruntime.ClonePointerToInt(source.MaxDeliveryCount) + + // MessageCount + subscription.MessageCount = genruntime.ClonePointerToInt(source.MessageCount) + + // Name + subscription.Name = genruntime.ClonePointerToString(source.Name) + + // RequiresSession + if source.RequiresSession != nil { + requiresSession := *source.RequiresSession + subscription.RequiresSession = &requiresSession + } else { + subscription.RequiresSession = nil + } + + // Status + subscription.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") + } + subscription.SystemData = &systemDatum + } else { + subscription.SystemData = nil + } + + // Type + subscription.Type = genruntime.ClonePointerToString(source.Type) + + // UpdatedAt + subscription.UpdatedAt = genruntime.ClonePointerToString(source.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + subscription.PropertyBag = propertyBag + } else { + subscription.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topics_Subscription_STATUS interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespaces_Topics_Subscription_STATUS); ok { + err := augmentedSubscription.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Namespaces_Topics_Subscription_STATUS populates the provided destination Namespaces_Topics_Subscription_STATUS from our Namespaces_Topics_Subscription_STATUS +func (subscription *Namespaces_Topics_Subscription_STATUS) AssignProperties_To_Namespaces_Topics_Subscription_STATUS(destination *v20211101s.Namespaces_Topics_Subscription_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(subscription.PropertyBag) + + // AccessedAt + destination.AccessedAt = genruntime.ClonePointerToString(subscription.AccessedAt) + + // AutoDeleteOnIdle + destination.AutoDeleteOnIdle = genruntime.ClonePointerToString(subscription.AutoDeleteOnIdle) + + // ClientAffineProperties + if subscription.ClientAffineProperties != nil { + var clientAffineProperty v20211101s.SBClientAffineProperties_STATUS + err := subscription.ClientAffineProperties.AssignProperties_To_SBClientAffineProperties_STATUS(&clientAffineProperty) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SBClientAffineProperties_STATUS() to populate field ClientAffineProperties") + } + destination.ClientAffineProperties = &clientAffineProperty + } else { + destination.ClientAffineProperties = nil + } + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(subscription.Conditions) + + // CountDetails + if subscription.CountDetails != nil { + var countDetail v20211101s.MessageCountDetails_STATUS + err := subscription.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_MessageCountDetails_STATUS() to populate field CountDetails") + } + destination.CountDetails = &countDetail + } else { + destination.CountDetails = nil + } + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(subscription.CreatedAt) + + // DeadLetteringOnFilterEvaluationExceptions + if subscription.DeadLetteringOnFilterEvaluationExceptions != nil { + deadLetteringOnFilterEvaluationException := *subscription.DeadLetteringOnFilterEvaluationExceptions + destination.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringOnFilterEvaluationException + } else { + destination.DeadLetteringOnFilterEvaluationExceptions = nil + } + + // DeadLetteringOnMessageExpiration + if subscription.DeadLetteringOnMessageExpiration != nil { + deadLetteringOnMessageExpiration := *subscription.DeadLetteringOnMessageExpiration + destination.DeadLetteringOnMessageExpiration = &deadLetteringOnMessageExpiration + } else { + destination.DeadLetteringOnMessageExpiration = nil + } + + // DefaultMessageTimeToLive + destination.DefaultMessageTimeToLive = genruntime.ClonePointerToString(subscription.DefaultMessageTimeToLive) + + // DuplicateDetectionHistoryTimeWindow + destination.DuplicateDetectionHistoryTimeWindow = genruntime.ClonePointerToString(subscription.DuplicateDetectionHistoryTimeWindow) + + // EnableBatchedOperations + if subscription.EnableBatchedOperations != nil { + enableBatchedOperation := *subscription.EnableBatchedOperations + destination.EnableBatchedOperations = &enableBatchedOperation + } else { + destination.EnableBatchedOperations = nil + } + + // ForwardDeadLetteredMessagesTo + destination.ForwardDeadLetteredMessagesTo = genruntime.ClonePointerToString(subscription.ForwardDeadLetteredMessagesTo) + + // ForwardTo + destination.ForwardTo = genruntime.ClonePointerToString(subscription.ForwardTo) + + // Id + destination.Id = genruntime.ClonePointerToString(subscription.Id) + + // IsClientAffine + if subscription.IsClientAffine != nil { + isClientAffine := *subscription.IsClientAffine + destination.IsClientAffine = &isClientAffine + } else { + destination.IsClientAffine = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(subscription.Location) + + // LockDuration + destination.LockDuration = genruntime.ClonePointerToString(subscription.LockDuration) + + // MaxDeliveryCount + destination.MaxDeliveryCount = genruntime.ClonePointerToInt(subscription.MaxDeliveryCount) + + // MessageCount + destination.MessageCount = genruntime.ClonePointerToInt(subscription.MessageCount) + + // Name + destination.Name = genruntime.ClonePointerToString(subscription.Name) + + // RequiresSession + if subscription.RequiresSession != nil { + requiresSession := *subscription.RequiresSession + destination.RequiresSession = &requiresSession + } else { + destination.RequiresSession = nil + } + + // Status + destination.Status = genruntime.ClonePointerToString(subscription.Status) + + // SystemData + if subscription.SystemData != nil { + var systemDatum v20211101s.SystemData_STATUS + err := subscription.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(subscription.Type) + + // UpdatedAt + destination.UpdatedAt = genruntime.ClonePointerToString(subscription.UpdatedAt) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topics_Subscription_STATUS interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespaces_Topics_Subscription_STATUS); ok { + err := augmentedSubscription.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespaces_Topics_Subscription_Spec interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Topics_Subscription_Spec) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Topics_Subscription_Spec) error +} + +type augmentConversionForNamespaces_Topics_Subscription_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Topics_Subscription_STATUS) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Topics_Subscription_STATUS) error +} + +// Storage version of v1api20221001preview.SBClientAffineProperties +// Properties specific to client affine subscriptions. +type SBClientAffineProperties struct { + ClientId *string `json:"clientId,omitempty"` + IsDurable *bool `json:"isDurable,omitempty"` + IsShared *bool `json:"isShared,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_SBClientAffineProperties populates our SBClientAffineProperties from the provided source SBClientAffineProperties +func (properties *SBClientAffineProperties) AssignProperties_From_SBClientAffineProperties(source *v20211101s.SBClientAffineProperties) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ClientId + properties.ClientId = genruntime.ClonePointerToString(source.ClientId) + + // IsDurable + if source.IsDurable != nil { + isDurable := *source.IsDurable + properties.IsDurable = &isDurable + } else { + properties.IsDurable = nil + } + + // IsShared + if source.IsShared != nil { + isShared := *source.IsShared + properties.IsShared = &isShared + } else { + properties.IsShared = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + properties.PropertyBag = propertyBag + } else { + properties.PropertyBag = nil + } + + // Invoke the augmentConversionForSBClientAffineProperties interface (if implemented) to customize the conversion + var propertiesAsAny any = properties + if augmentedProperties, ok := propertiesAsAny.(augmentConversionForSBClientAffineProperties); ok { + err := augmentedProperties.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_SBClientAffineProperties populates the provided destination SBClientAffineProperties from our SBClientAffineProperties +func (properties *SBClientAffineProperties) AssignProperties_To_SBClientAffineProperties(destination *v20211101s.SBClientAffineProperties) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) + + // ClientId + destination.ClientId = genruntime.ClonePointerToString(properties.ClientId) + + // IsDurable + if properties.IsDurable != nil { + isDurable := *properties.IsDurable + destination.IsDurable = &isDurable + } else { + destination.IsDurable = nil + } + + // IsShared + if properties.IsShared != nil { + isShared := *properties.IsShared + destination.IsShared = &isShared + } else { + destination.IsShared = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForSBClientAffineProperties interface (if implemented) to customize the conversion + var propertiesAsAny any = properties + if augmentedProperties, ok := propertiesAsAny.(augmentConversionForSBClientAffineProperties); ok { + err := augmentedProperties.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20221001preview.SBClientAffineProperties_STATUS +// Properties specific to client affine subscriptions. +type SBClientAffineProperties_STATUS struct { + ClientId *string `json:"clientId,omitempty"` + IsDurable *bool `json:"isDurable,omitempty"` + IsShared *bool `json:"isShared,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// AssignProperties_From_SBClientAffineProperties_STATUS populates our SBClientAffineProperties_STATUS from the provided source SBClientAffineProperties_STATUS +func (properties *SBClientAffineProperties_STATUS) AssignProperties_From_SBClientAffineProperties_STATUS(source *v20211101s.SBClientAffineProperties_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ClientId + properties.ClientId = genruntime.ClonePointerToString(source.ClientId) + + // IsDurable + if source.IsDurable != nil { + isDurable := *source.IsDurable + properties.IsDurable = &isDurable + } else { + properties.IsDurable = nil + } + + // IsShared + if source.IsShared != nil { + isShared := *source.IsShared + properties.IsShared = &isShared + } else { + properties.IsShared = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + properties.PropertyBag = propertyBag + } else { + properties.PropertyBag = nil + } + + // Invoke the augmentConversionForSBClientAffineProperties_STATUS interface (if implemented) to customize the conversion + var propertiesAsAny any = properties + if augmentedProperties, ok := propertiesAsAny.(augmentConversionForSBClientAffineProperties_STATUS); ok { + err := augmentedProperties.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_SBClientAffineProperties_STATUS populates the provided destination SBClientAffineProperties_STATUS from our SBClientAffineProperties_STATUS +func (properties *SBClientAffineProperties_STATUS) AssignProperties_To_SBClientAffineProperties_STATUS(destination *v20211101s.SBClientAffineProperties_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) + + // ClientId + destination.ClientId = genruntime.ClonePointerToString(properties.ClientId) + + // IsDurable + if properties.IsDurable != nil { + isDurable := *properties.IsDurable + destination.IsDurable = &isDurable + } else { + destination.IsDurable = nil + } + + // IsShared + if properties.IsShared != nil { + isShared := *properties.IsShared + destination.IsShared = &isShared + } else { + destination.IsShared = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForSBClientAffineProperties_STATUS interface (if implemented) to customize the conversion + var propertiesAsAny any = properties + if augmentedProperties, ok := propertiesAsAny.(augmentConversionForSBClientAffineProperties_STATUS); ok { + err := augmentedProperties.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForSBClientAffineProperties interface { + AssignPropertiesFrom(src *v20211101s.SBClientAffineProperties) error + AssignPropertiesTo(dst *v20211101s.SBClientAffineProperties) error +} + +type augmentConversionForSBClientAffineProperties_STATUS interface { + AssignPropertiesFrom(src *v20211101s.SBClientAffineProperties_STATUS) error + AssignPropertiesTo(dst *v20211101s.SBClientAffineProperties_STATUS) error +} + +func init() { + SchemeBuilder.Register(&NamespacesTopicsSubscription{}, &NamespacesTopicsSubscriptionList{}) +} diff --git a/v2/api/servicebus/v1api20221001previewstorage/namespaces_topics_subscription_types_gen_test.go b/v2/api/servicebus/v1api20221001previewstorage/namespaces_topics_subscription_types_gen_test.go new file mode 100644 index 00000000000..75c2a49eeed --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/namespaces_topics_subscription_types_gen_test.go @@ -0,0 +1,645 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001previewstorage + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesTopicsSubscription, NamespacesTopicsSubscriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesTopicsSubscription tests if a specific instance of NamespacesTopicsSubscription round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesTopicsSubscription(subject NamespacesTopicsSubscription) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesTopicsSubscription + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesTopicsSubscription + 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_NamespacesTopicsSubscription_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscription to NamespacesTopicsSubscription via AssignProperties_To_NamespacesTopicsSubscription & AssignProperties_From_NamespacesTopicsSubscription returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscription, NamespacesTopicsSubscriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscription tests if a specific instance of NamespacesTopicsSubscription can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscription(subject NamespacesTopicsSubscription) 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.NamespacesTopicsSubscription + err := copied.AssignProperties_To_NamespacesTopicsSubscription(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscription + err = actual.AssignProperties_From_NamespacesTopicsSubscription(&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_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscription, NamespacesTopicsSubscriptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscription runs a test to see if a specific instance of NamespacesTopicsSubscription round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscription(subject NamespacesTopicsSubscription) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscription + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicsSubscription instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionGenerator() +var namespacesTopicsSubscriptionGenerator gopter.Gen + +// NamespacesTopicsSubscriptionGenerator returns a generator of NamespacesTopicsSubscription instances for property testing. +func NamespacesTopicsSubscriptionGenerator() gopter.Gen { + if namespacesTopicsSubscriptionGenerator != nil { + return namespacesTopicsSubscriptionGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription(generators) + namespacesTopicsSubscriptionGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription{}), generators) + + return namespacesTopicsSubscriptionGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Topics_Subscription_SpecGenerator() + gens["Status"] = Namespaces_Topics_Subscription_STATUSGenerator() +} + +func Test_Namespaces_Topics_Subscription_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscription_Spec to Namespaces_Topics_Subscription_Spec via AssignProperties_To_Namespaces_Topics_Subscription_Spec & AssignProperties_From_Namespaces_Topics_Subscription_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscription_Spec, Namespaces_Topics_Subscription_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscription_Spec tests if a specific instance of Namespaces_Topics_Subscription_Spec can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscription_Spec(subject Namespaces_Topics_Subscription_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 v20211101s.Namespaces_Topics_Subscription_Spec + err := copied.AssignProperties_To_Namespaces_Topics_Subscription_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscription_Spec + err = actual.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_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_Topics_Subscription_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec, Namespaces_Topics_Subscription_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec runs a test to see if a specific instance of Namespaces_Topics_Subscription_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscription_Spec(subject Namespaces_Topics_Subscription_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscription_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_Topics_Subscription_Spec instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscription_SpecGenerator() +var namespaces_Topics_Subscription_SpecGenerator gopter.Gen + +// Namespaces_Topics_Subscription_SpecGenerator returns a generator of Namespaces_Topics_Subscription_Spec instances for property testing. +// We first initialize namespaces_Topics_Subscription_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_Topics_Subscription_SpecGenerator() gopter.Gen { + if namespaces_Topics_Subscription_SpecGenerator != nil { + return namespaces_Topics_Subscription_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(generators) + namespaces_Topics_Subscription_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(generators) + namespaces_Topics_Subscription_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_Spec{}), generators) + + return namespaces_Topics_Subscription_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(gens map[string]gopter.Gen) { + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["AzureName"] = gen.AlphaString() + gens["DeadLetteringOnFilterEvaluationExceptions"] = gen.PtrOf(gen.Bool()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["IsClientAffine"] = gen.PtrOf(gen.Bool()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["OriginalVersion"] = gen.AlphaString() + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_Spec(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffinePropertiesGenerator()) +} + +func Test_Namespaces_Topics_Subscription_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscription_STATUS to Namespaces_Topics_Subscription_STATUS via AssignProperties_To_Namespaces_Topics_Subscription_STATUS & AssignProperties_From_Namespaces_Topics_Subscription_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscription_STATUS, Namespaces_Topics_Subscription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscription_STATUS tests if a specific instance of Namespaces_Topics_Subscription_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscription_STATUS(subject Namespaces_Topics_Subscription_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 v20211101s.Namespaces_Topics_Subscription_STATUS + err := copied.AssignProperties_To_Namespaces_Topics_Subscription_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscription_STATUS + err = actual.AssignProperties_From_Namespaces_Topics_Subscription_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_Topics_Subscription_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_Topics_Subscription_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS, Namespaces_Topics_Subscription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS runs a test to see if a specific instance of Namespaces_Topics_Subscription_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscription_STATUS(subject Namespaces_Topics_Subscription_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscription_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_Topics_Subscription_STATUS instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscription_STATUSGenerator() +var namespaces_Topics_Subscription_STATUSGenerator gopter.Gen + +// Namespaces_Topics_Subscription_STATUSGenerator returns a generator of Namespaces_Topics_Subscription_STATUS instances for property testing. +// We first initialize namespaces_Topics_Subscription_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_Topics_Subscription_STATUSGenerator() gopter.Gen { + if namespaces_Topics_Subscription_STATUSGenerator != nil { + return namespaces_Topics_Subscription_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(generators) + namespaces_Topics_Subscription_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(generators) + namespaces_Topics_Subscription_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscription_STATUS{}), generators) + + return namespaces_Topics_Subscription_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(gens map[string]gopter.Gen) { + gens["AccessedAt"] = gen.PtrOf(gen.AlphaString()) + gens["AutoDeleteOnIdle"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["DeadLetteringOnFilterEvaluationExceptions"] = gen.PtrOf(gen.Bool()) + gens["DeadLetteringOnMessageExpiration"] = gen.PtrOf(gen.Bool()) + gens["DefaultMessageTimeToLive"] = gen.PtrOf(gen.AlphaString()) + gens["DuplicateDetectionHistoryTimeWindow"] = gen.PtrOf(gen.AlphaString()) + gens["EnableBatchedOperations"] = gen.PtrOf(gen.Bool()) + gens["ForwardDeadLetteredMessagesTo"] = gen.PtrOf(gen.AlphaString()) + gens["ForwardTo"] = gen.PtrOf(gen.AlphaString()) + gens["Id"] = gen.PtrOf(gen.AlphaString()) + gens["IsClientAffine"] = gen.PtrOf(gen.Bool()) + gens["Location"] = gen.PtrOf(gen.AlphaString()) + gens["LockDuration"] = gen.PtrOf(gen.AlphaString()) + gens["MaxDeliveryCount"] = gen.PtrOf(gen.Int()) + gens["MessageCount"] = gen.PtrOf(gen.Int()) + gens["Name"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresSession"] = gen.PtrOf(gen.Bool()) + gens["Status"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.AlphaString()) + gens["UpdatedAt"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscription_STATUS(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffineProperties_STATUSGenerator()) + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_SBClientAffineProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBClientAffineProperties to SBClientAffineProperties via AssignProperties_To_SBClientAffineProperties & AssignProperties_From_SBClientAffineProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForSBClientAffineProperties, SBClientAffinePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBClientAffineProperties tests if a specific instance of SBClientAffineProperties can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSBClientAffineProperties(subject SBClientAffineProperties) 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.SBClientAffineProperties + err := copied.AssignProperties_To_SBClientAffineProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBClientAffineProperties + err = actual.AssignProperties_From_SBClientAffineProperties(&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_SBClientAffineProperties_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 SBClientAffineProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBClientAffineProperties, SBClientAffinePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBClientAffineProperties runs a test to see if a specific instance of SBClientAffineProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForSBClientAffineProperties(subject SBClientAffineProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBClientAffineProperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SBClientAffineProperties instances for property testing - lazily instantiated by +// SBClientAffinePropertiesGenerator() +var sbClientAffinePropertiesGenerator gopter.Gen + +// SBClientAffinePropertiesGenerator returns a generator of SBClientAffineProperties instances for property testing. +func SBClientAffinePropertiesGenerator() gopter.Gen { + if sbClientAffinePropertiesGenerator != nil { + return sbClientAffinePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBClientAffineProperties(generators) + sbClientAffinePropertiesGenerator = gen.Struct(reflect.TypeOf(SBClientAffineProperties{}), generators) + + return sbClientAffinePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForSBClientAffineProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBClientAffineProperties(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["IsDurable"] = gen.PtrOf(gen.Bool()) + gens["IsShared"] = gen.PtrOf(gen.Bool()) +} + +func Test_SBClientAffineProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SBClientAffineProperties_STATUS to SBClientAffineProperties_STATUS via AssignProperties_To_SBClientAffineProperties_STATUS & AssignProperties_From_SBClientAffineProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSBClientAffineProperties_STATUS, SBClientAffineProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSBClientAffineProperties_STATUS tests if a specific instance of SBClientAffineProperties_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSBClientAffineProperties_STATUS(subject SBClientAffineProperties_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 v20211101s.SBClientAffineProperties_STATUS + err := copied.AssignProperties_To_SBClientAffineProperties_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SBClientAffineProperties_STATUS + err = actual.AssignProperties_From_SBClientAffineProperties_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_SBClientAffineProperties_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 SBClientAffineProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBClientAffineProperties_STATUS, SBClientAffineProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBClientAffineProperties_STATUS runs a test to see if a specific instance of SBClientAffineProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSBClientAffineProperties_STATUS(subject SBClientAffineProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBClientAffineProperties_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 SBClientAffineProperties_STATUS instances for property testing - lazily instantiated by +// SBClientAffineProperties_STATUSGenerator() +var sbClientAffineProperties_STATUSGenerator gopter.Gen + +// SBClientAffineProperties_STATUSGenerator returns a generator of SBClientAffineProperties_STATUS instances for property testing. +func SBClientAffineProperties_STATUSGenerator() gopter.Gen { + if sbClientAffineProperties_STATUSGenerator != nil { + return sbClientAffineProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS(generators) + sbClientAffineProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(SBClientAffineProperties_STATUS{}), generators) + + return sbClientAffineProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBClientAffineProperties_STATUS(gens map[string]gopter.Gen) { + gens["ClientId"] = gen.PtrOf(gen.AlphaString()) + gens["IsDurable"] = gen.PtrOf(gen.Bool()) + gens["IsShared"] = gen.PtrOf(gen.Bool()) +} diff --git a/v2/api/servicebus/v1api20221001previewstorage/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20221001previewstorage/namespaces_topics_subscriptions_rule_types_gen.go new file mode 100644 index 00000000000..5ac3c2024fc --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/namespaces_topics_subscriptions_rule_types_gen.go @@ -0,0 +1,1368 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001previewstorage + +import ( + "fmt" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Storage version of v1api20221001preview.NamespacesTopicsSubscriptionsRule +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/Rules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName} +type NamespacesTopicsSubscriptionsRule struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec Namespaces_Topics_Subscriptions_Rule_Spec `json:"spec,omitempty"` + Status Namespaces_Topics_Subscriptions_Rule_STATUS `json:"status,omitempty"` +} + +var _ conditions.Conditioner = &NamespacesTopicsSubscriptionsRule{} + +// GetConditions returns the conditions of the resource +func (rule *NamespacesTopicsSubscriptionsRule) GetConditions() conditions.Conditions { + return rule.Status.Conditions +} + +// SetConditions sets the conditions on the resource status +func (rule *NamespacesTopicsSubscriptionsRule) SetConditions(conditions conditions.Conditions) { + rule.Status.Conditions = conditions +} + +var _ conversion.Convertible = &NamespacesTopicsSubscriptionsRule{} + +// ConvertFrom populates our NamespacesTopicsSubscriptionsRule from the provided hub NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) ConvertFrom(hub conversion.Hub) error { + source, ok := hub.(*v20211101s.NamespacesTopicsSubscriptionsRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + } + + return rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule(source) +} + +// ConvertTo populates the provided hub NamespacesTopicsSubscriptionsRule from our NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*v20211101s.NamespacesTopicsSubscriptionsRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20211101storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(destination) +} + +var _ genruntime.KubernetesResource = &NamespacesTopicsSubscriptionsRule{} + +// AzureName returns the Azure name of the resource +func (rule *NamespacesTopicsSubscriptionsRule) AzureName() string { + return rule.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2022-10-01-preview" +func (rule NamespacesTopicsSubscriptionsRule) GetAPIVersion() string { + return string(APIVersion_Value) +} + +// GetResourceScope returns the scope of the resource +func (rule *NamespacesTopicsSubscriptionsRule) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (rule *NamespacesTopicsSubscriptionsRule) GetSpec() genruntime.ConvertibleSpec { + return &rule.Spec +} + +// GetStatus returns the status of this resource +func (rule *NamespacesTopicsSubscriptionsRule) GetStatus() genruntime.ConvertibleStatus { + return &rule.Status +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +func (rule *NamespacesTopicsSubscriptionsRule) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +} + +// NewEmptyStatus returns a new empty (blank) status +func (rule *NamespacesTopicsSubscriptionsRule) NewEmptyStatus() genruntime.ConvertibleStatus { + return &Namespaces_Topics_Subscriptions_Rule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *NamespacesTopicsSubscriptionsRule) Owner() *genruntime.ResourceReference { + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return &genruntime.ResourceReference{ + Group: group, + Kind: kind, + Name: rule.Spec.Owner.Name, + } +} + +// SetStatus sets the status of this resource +func (rule *NamespacesTopicsSubscriptionsRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespaces_Topics_Subscriptions_Rule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st Namespaces_Topics_Subscriptions_Rule_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return errors.Wrap(err, "failed to convert status") + } + + rule.Status = st + return nil +} + +// AssignProperties_From_NamespacesTopicsSubscriptionsRule populates our NamespacesTopicsSubscriptionsRule from the provided source NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) AssignProperties_From_NamespacesTopicsSubscriptionsRule(source *v20211101s.NamespacesTopicsSubscriptionsRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec Namespaces_Topics_Subscriptions_Rule_Spec + err := spec.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec(&source.Spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status Namespaces_Topics_Subscriptions_Rule_STATUS + err = status.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS(&source.Status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS() to populate field Status") + } + rule.Status = status + + // Invoke the augmentConversionForNamespacesTopicsSubscriptionsRule interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesTopicsSubscriptionsRule); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscriptionsRule populates the provided destination NamespacesTopicsSubscriptionsRule from our NamespacesTopicsSubscriptionsRule +func (rule *NamespacesTopicsSubscriptionsRule) AssignProperties_To_NamespacesTopicsSubscriptionsRule(destination *v20211101s.NamespacesTopicsSubscriptionsRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec + err := rule.Spec.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(&spec) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS + err = rule.Status.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(&status) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS() to populate field Status") + } + destination.Status = status + + // Invoke the augmentConversionForNamespacesTopicsSubscriptionsRule interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesTopicsSubscriptionsRule); 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 *NamespacesTopicsSubscriptionsRule) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: rule.Spec.OriginalVersion, + Kind: "NamespacesTopicsSubscriptionsRule", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20221001preview.NamespacesTopicsSubscriptionsRule +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/Rules.json +// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/subscriptions/{subscriptionName}/rules/{ruleName} +type NamespacesTopicsSubscriptionsRuleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespacesTopicsSubscriptionsRule `json:"items"` +} + +type augmentConversionForNamespacesTopicsSubscriptionsRule interface { + AssignPropertiesFrom(src *v20211101s.NamespacesTopicsSubscriptionsRule) error + AssignPropertiesTo(dst *v20211101s.NamespacesTopicsSubscriptionsRule) error +} + +// Storage version of v1api20221001preview.Namespaces_Topics_Subscriptions_Rule_Spec +type Namespaces_Topics_Subscriptions_Rule_Spec struct { + Action *Action `json:"action,omitempty"` + + // +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"` + CorrelationFilter *CorrelationFilter `json:"correlationFilter,omitempty"` + FilterType *string `json:"filterType,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 servicebus.azure.com/NamespacesTopicsSubscription resource + Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"NamespacesTopicsSubscription"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SqlFilter *SqlFilter `json:"sqlFilter,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &Namespaces_Topics_Subscriptions_Rule_Spec{} + +// ConvertSpecFrom populates our Namespaces_Topics_Subscriptions_Rule_Spec from the provided source +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec{} + err := rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec populates our Namespaces_Topics_Subscriptions_Rule_Spec from the provided source Namespaces_Topics_Subscriptions_Rule_Spec +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec(source *v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Action + if source.Action != nil { + var action Action + err := action.AssignProperties_From_Action(source.Action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Action() to populate field Action") + } + rule.Action = &action + } else { + rule.Action = nil + } + + // AzureName + rule.AzureName = source.AzureName + + // CorrelationFilter + if source.CorrelationFilter != nil { + var correlationFilter CorrelationFilter + err := correlationFilter.AssignProperties_From_CorrelationFilter(source.CorrelationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CorrelationFilter() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil + } + + // FilterType + rule.FilterType = genruntime.ClonePointerToString(source.FilterType) + + // OriginalVersion + rule.OriginalVersion = source.OriginalVersion + + // Owner + if source.Owner != nil { + owner := source.Owner.Copy() + rule.Owner = &owner + } else { + rule.Owner = nil + } + + // SqlFilter + if source.SqlFilter != nil { + var sqlFilter SqlFilter + err := sqlFilter.AssignProperties_From_SqlFilter(source.SqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SqlFilter() to populate field SqlFilter") + } + rule.SqlFilter = &sqlFilter + } else { + rule.SqlFilter = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + rule.PropertyBag = propertyBag + } else { + rule.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topics_Subscriptions_Rule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec populates the provided destination Namespaces_Topics_Subscriptions_Rule_Spec from our Namespaces_Topics_Subscriptions_Rule_Spec +func (rule *Namespaces_Topics_Subscriptions_Rule_Spec) AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(destination *v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) + + // Action + if rule.Action != nil { + var action v20211101s.Action + err := rule.Action.AssignProperties_To_Action(&action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Action() to populate field Action") + } + destination.Action = &action + } else { + destination.Action = nil + } + + // AzureName + destination.AzureName = rule.AzureName + + // CorrelationFilter + if rule.CorrelationFilter != nil { + var correlationFilter v20211101s.CorrelationFilter + err := rule.CorrelationFilter.AssignProperties_To_CorrelationFilter(&correlationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CorrelationFilter() to populate field CorrelationFilter") + } + destination.CorrelationFilter = &correlationFilter + } else { + destination.CorrelationFilter = nil + } + + // FilterType + destination.FilterType = genruntime.ClonePointerToString(rule.FilterType) + + // OriginalVersion + destination.OriginalVersion = rule.OriginalVersion + + // Owner + if rule.Owner != nil { + owner := rule.Owner.Copy() + destination.Owner = &owner + } else { + destination.Owner = nil + } + + // SqlFilter + if rule.SqlFilter != nil { + var sqlFilter v20211101s.SqlFilter + err := rule.SqlFilter.AssignProperties_To_SqlFilter(&sqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SqlFilter() to populate field SqlFilter") + } + destination.SqlFilter = &sqlFilter + } else { + destination.SqlFilter = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topics_Subscriptions_Rule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Topics_Subscriptions_Rule_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 v1api20221001preview.Namespaces_Topics_Subscriptions_Rule_STATUS +type Namespaces_Topics_Subscriptions_Rule_STATUS struct { + Action *Action_STATUS `json:"action,omitempty"` + Conditions []conditions.Condition `json:"conditions,omitempty"` + CorrelationFilter *CorrelationFilter_STATUS `json:"correlationFilter,omitempty"` + FilterType *string `json:"filterType,omitempty"` + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SqlFilter *SqlFilter_STATUS `json:"sqlFilter,omitempty"` + SystemData *SystemData_STATUS `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ genruntime.ConvertibleStatus = &Namespaces_Topics_Subscriptions_Rule_STATUS{} + +// ConvertStatusFrom populates our Namespaces_Topics_Subscriptions_Rule_STATUS from the provided source +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS(src) + } + + // Convert to an intermediate form + src = &v20211101s.Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS{} + err := rule.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS populates our Namespaces_Topics_Subscriptions_Rule_STATUS from the provided source Namespaces_Topics_Subscriptions_Rule_STATUS +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS(source *v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // Action + if source.Action != nil { + var action Action_STATUS + err := action.AssignProperties_From_Action_STATUS(source.Action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_Action_STATUS() to populate field Action") + } + rule.Action = &action + } else { + rule.Action = nil + } + + // Conditions + rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions) + + // CorrelationFilter + if source.CorrelationFilter != nil { + var correlationFilter CorrelationFilter_STATUS + err := correlationFilter.AssignProperties_From_CorrelationFilter_STATUS(source.CorrelationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_CorrelationFilter_STATUS() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil + } + + // FilterType + rule.FilterType = genruntime.ClonePointerToString(source.FilterType) + + // Id + rule.Id = genruntime.ClonePointerToString(source.Id) + + // Location + rule.Location = genruntime.ClonePointerToString(source.Location) + + // Name + rule.Name = genruntime.ClonePointerToString(source.Name) + + // SqlFilter + if source.SqlFilter != nil { + var sqlFilter SqlFilter_STATUS + err := sqlFilter.AssignProperties_From_SqlFilter_STATUS(source.SqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_From_SqlFilter_STATUS() to populate field SqlFilter") + } + rule.SqlFilter = &sqlFilter + } else { + rule.SqlFilter = 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) + + // Update the property bag + if len(propertyBag) > 0 { + rule.PropertyBag = propertyBag + } else { + rule.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespaces_Topics_Subscriptions_Rule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS populates the provided destination Namespaces_Topics_Subscriptions_Rule_STATUS from our Namespaces_Topics_Subscriptions_Rule_STATUS +func (rule *Namespaces_Topics_Subscriptions_Rule_STATUS) AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(destination *v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) + + // Action + if rule.Action != nil { + var action v20211101s.Action_STATUS + err := rule.Action.AssignProperties_To_Action_STATUS(&action) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_Action_STATUS() to populate field Action") + } + destination.Action = &action + } else { + destination.Action = nil + } + + // Conditions + destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions) + + // CorrelationFilter + if rule.CorrelationFilter != nil { + var correlationFilter v20211101s.CorrelationFilter_STATUS + err := rule.CorrelationFilter.AssignProperties_To_CorrelationFilter_STATUS(&correlationFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_CorrelationFilter_STATUS() to populate field CorrelationFilter") + } + destination.CorrelationFilter = &correlationFilter + } else { + destination.CorrelationFilter = nil + } + + // FilterType + destination.FilterType = genruntime.ClonePointerToString(rule.FilterType) + + // Id + destination.Id = genruntime.ClonePointerToString(rule.Id) + + // Location + destination.Location = genruntime.ClonePointerToString(rule.Location) + + // Name + destination.Name = genruntime.ClonePointerToString(rule.Name) + + // SqlFilter + if rule.SqlFilter != nil { + var sqlFilter v20211101s.SqlFilter_STATUS + err := rule.SqlFilter.AssignProperties_To_SqlFilter_STATUS(&sqlFilter) + if err != nil { + return errors.Wrap(err, "calling AssignProperties_To_SqlFilter_STATUS() to populate field SqlFilter") + } + destination.SqlFilter = &sqlFilter + } else { + destination.SqlFilter = nil + } + + // SystemData + if rule.SystemData != nil { + var systemDatum v20211101s.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_Topics_Subscriptions_Rule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_Topics_Subscriptions_Rule_STATUS); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20221001preview.Action +// Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter +// expression. +type Action struct { + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +// AssignProperties_From_Action populates our Action from the provided source Action +func (action *Action) AssignProperties_From_Action(source *v20211101s.Action) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CompatibilityLevel + action.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + action.RequiresPreprocessing = &requiresPreprocessing + } else { + action.RequiresPreprocessing = nil + } + + // SqlExpression + action.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + action.PropertyBag = propertyBag + } else { + action.PropertyBag = nil + } + + // Invoke the augmentConversionForAction interface (if implemented) to customize the conversion + var actionAsAny any = action + if augmentedAction, ok := actionAsAny.(augmentConversionForAction); ok { + err := augmentedAction.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Action populates the provided destination Action from our Action +func (action *Action) AssignProperties_To_Action(destination *v20211101s.Action) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(action.PropertyBag) + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(action.CompatibilityLevel) + + // RequiresPreprocessing + if action.RequiresPreprocessing != nil { + requiresPreprocessing := *action.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(action.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForAction interface (if implemented) to customize the conversion + var actionAsAny any = action + if augmentedAction, ok := actionAsAny.(augmentConversionForAction); ok { + err := augmentedAction.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20221001preview.Action_STATUS +// Represents the filter actions which are allowed for the transformation of a message that have been matched by a filter +// expression. +type Action_STATUS struct { + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +// AssignProperties_From_Action_STATUS populates our Action_STATUS from the provided source Action_STATUS +func (action *Action_STATUS) AssignProperties_From_Action_STATUS(source *v20211101s.Action_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CompatibilityLevel + action.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + action.RequiresPreprocessing = &requiresPreprocessing + } else { + action.RequiresPreprocessing = nil + } + + // SqlExpression + action.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + action.PropertyBag = propertyBag + } else { + action.PropertyBag = nil + } + + // Invoke the augmentConversionForAction_STATUS interface (if implemented) to customize the conversion + var actionAsAny any = action + if augmentedAction, ok := actionAsAny.(augmentConversionForAction_STATUS); ok { + err := augmentedAction.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_Action_STATUS populates the provided destination Action_STATUS from our Action_STATUS +func (action *Action_STATUS) AssignProperties_To_Action_STATUS(destination *v20211101s.Action_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(action.PropertyBag) + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(action.CompatibilityLevel) + + // RequiresPreprocessing + if action.RequiresPreprocessing != nil { + requiresPreprocessing := *action.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(action.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForAction_STATUS interface (if implemented) to customize the conversion + var actionAsAny any = action + if augmentedAction, ok := actionAsAny.(augmentConversionForAction_STATUS); ok { + err := augmentedAction.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespaces_Topics_Subscriptions_Rule_Spec interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec) error +} + +type augmentConversionForNamespaces_Topics_Subscriptions_Rule_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) error + AssignPropertiesTo(dst *v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS) error +} + +// Storage version of v1api20221001preview.CorrelationFilter +// Represents the correlation filter expression. +type CorrelationFilter struct { + ContentType *string `json:"contentType,omitempty"` + CorrelationId *string `json:"correlationId,omitempty"` + Label *string `json:"label,omitempty"` + MessageId *string `json:"messageId,omitempty"` + Properties map[string]string `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ReplyTo *string `json:"replyTo,omitempty"` + ReplyToSessionId *string `json:"replyToSessionId,omitempty"` + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + SessionId *string `json:"sessionId,omitempty"` + To *string `json:"to,omitempty"` +} + +// AssignProperties_From_CorrelationFilter populates our CorrelationFilter from the provided source CorrelationFilter +func (filter *CorrelationFilter) AssignProperties_From_CorrelationFilter(source *v20211101s.CorrelationFilter) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ContentType + filter.ContentType = genruntime.ClonePointerToString(source.ContentType) + + // CorrelationId + filter.CorrelationId = genruntime.ClonePointerToString(source.CorrelationId) + + // Label + filter.Label = genruntime.ClonePointerToString(source.Label) + + // MessageId + filter.MessageId = genruntime.ClonePointerToString(source.MessageId) + + // Properties + filter.Properties = genruntime.CloneMapOfStringToString(source.Properties) + + // ReplyTo + filter.ReplyTo = genruntime.ClonePointerToString(source.ReplyTo) + + // ReplyToSessionId + filter.ReplyToSessionId = genruntime.ClonePointerToString(source.ReplyToSessionId) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SessionId + filter.SessionId = genruntime.ClonePointerToString(source.SessionId) + + // To + filter.To = genruntime.ClonePointerToString(source.To) + + // Update the property bag + if len(propertyBag) > 0 { + filter.PropertyBag = propertyBag + } else { + filter.PropertyBag = nil + } + + // Invoke the augmentConversionForCorrelationFilter interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForCorrelationFilter); ok { + err := augmentedFilter.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_CorrelationFilter populates the provided destination CorrelationFilter from our CorrelationFilter +func (filter *CorrelationFilter) AssignProperties_To_CorrelationFilter(destination *v20211101s.CorrelationFilter) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(filter.PropertyBag) + + // ContentType + destination.ContentType = genruntime.ClonePointerToString(filter.ContentType) + + // CorrelationId + destination.CorrelationId = genruntime.ClonePointerToString(filter.CorrelationId) + + // Label + destination.Label = genruntime.ClonePointerToString(filter.Label) + + // MessageId + destination.MessageId = genruntime.ClonePointerToString(filter.MessageId) + + // Properties + destination.Properties = genruntime.CloneMapOfStringToString(filter.Properties) + + // ReplyTo + destination.ReplyTo = genruntime.ClonePointerToString(filter.ReplyTo) + + // ReplyToSessionId + destination.ReplyToSessionId = genruntime.ClonePointerToString(filter.ReplyToSessionId) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SessionId + destination.SessionId = genruntime.ClonePointerToString(filter.SessionId) + + // To + destination.To = genruntime.ClonePointerToString(filter.To) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForCorrelationFilter interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForCorrelationFilter); ok { + err := augmentedFilter.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20221001preview.CorrelationFilter_STATUS +// Represents the correlation filter expression. +type CorrelationFilter_STATUS struct { + ContentType *string `json:"contentType,omitempty"` + CorrelationId *string `json:"correlationId,omitempty"` + Label *string `json:"label,omitempty"` + MessageId *string `json:"messageId,omitempty"` + Properties map[string]string `json:"properties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + ReplyTo *string `json:"replyTo,omitempty"` + ReplyToSessionId *string `json:"replyToSessionId,omitempty"` + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + SessionId *string `json:"sessionId,omitempty"` + To *string `json:"to,omitempty"` +} + +// AssignProperties_From_CorrelationFilter_STATUS populates our CorrelationFilter_STATUS from the provided source CorrelationFilter_STATUS +func (filter *CorrelationFilter_STATUS) AssignProperties_From_CorrelationFilter_STATUS(source *v20211101s.CorrelationFilter_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ContentType + filter.ContentType = genruntime.ClonePointerToString(source.ContentType) + + // CorrelationId + filter.CorrelationId = genruntime.ClonePointerToString(source.CorrelationId) + + // Label + filter.Label = genruntime.ClonePointerToString(source.Label) + + // MessageId + filter.MessageId = genruntime.ClonePointerToString(source.MessageId) + + // Properties + filter.Properties = genruntime.CloneMapOfStringToString(source.Properties) + + // ReplyTo + filter.ReplyTo = genruntime.ClonePointerToString(source.ReplyTo) + + // ReplyToSessionId + filter.ReplyToSessionId = genruntime.ClonePointerToString(source.ReplyToSessionId) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SessionId + filter.SessionId = genruntime.ClonePointerToString(source.SessionId) + + // To + filter.To = genruntime.ClonePointerToString(source.To) + + // Update the property bag + if len(propertyBag) > 0 { + filter.PropertyBag = propertyBag + } else { + filter.PropertyBag = nil + } + + // Invoke the augmentConversionForCorrelationFilter_STATUS interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForCorrelationFilter_STATUS); ok { + err := augmentedFilter.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_CorrelationFilter_STATUS populates the provided destination CorrelationFilter_STATUS from our CorrelationFilter_STATUS +func (filter *CorrelationFilter_STATUS) AssignProperties_To_CorrelationFilter_STATUS(destination *v20211101s.CorrelationFilter_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(filter.PropertyBag) + + // ContentType + destination.ContentType = genruntime.ClonePointerToString(filter.ContentType) + + // CorrelationId + destination.CorrelationId = genruntime.ClonePointerToString(filter.CorrelationId) + + // Label + destination.Label = genruntime.ClonePointerToString(filter.Label) + + // MessageId + destination.MessageId = genruntime.ClonePointerToString(filter.MessageId) + + // Properties + destination.Properties = genruntime.CloneMapOfStringToString(filter.Properties) + + // ReplyTo + destination.ReplyTo = genruntime.ClonePointerToString(filter.ReplyTo) + + // ReplyToSessionId + destination.ReplyToSessionId = genruntime.ClonePointerToString(filter.ReplyToSessionId) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SessionId + destination.SessionId = genruntime.ClonePointerToString(filter.SessionId) + + // To + destination.To = genruntime.ClonePointerToString(filter.To) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForCorrelationFilter_STATUS interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForCorrelationFilter_STATUS); ok { + err := augmentedFilter.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20221001preview.SqlFilter +// Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. +type SqlFilter struct { + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +// AssignProperties_From_SqlFilter populates our SqlFilter from the provided source SqlFilter +func (filter *SqlFilter) AssignProperties_From_SqlFilter(source *v20211101s.SqlFilter) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CompatibilityLevel + filter.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SqlExpression + filter.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + filter.PropertyBag = propertyBag + } else { + filter.PropertyBag = nil + } + + // Invoke the augmentConversionForSqlFilter interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForSqlFilter); ok { + err := augmentedFilter.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_SqlFilter populates the provided destination SqlFilter from our SqlFilter +func (filter *SqlFilter) AssignProperties_To_SqlFilter(destination *v20211101s.SqlFilter) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(filter.PropertyBag) + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(filter.CompatibilityLevel) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(filter.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForSqlFilter interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForSqlFilter); ok { + err := augmentedFilter.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// Storage version of v1api20221001preview.SqlFilter_STATUS +// Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. +type SqlFilter_STATUS struct { + CompatibilityLevel *int `json:"compatibilityLevel,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"` + SqlExpression *string `json:"sqlExpression,omitempty"` +} + +// AssignProperties_From_SqlFilter_STATUS populates our SqlFilter_STATUS from the provided source SqlFilter_STATUS +func (filter *SqlFilter_STATUS) AssignProperties_From_SqlFilter_STATUS(source *v20211101s.SqlFilter_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CompatibilityLevel + filter.CompatibilityLevel = genruntime.ClonePointerToInt(source.CompatibilityLevel) + + // RequiresPreprocessing + if source.RequiresPreprocessing != nil { + requiresPreprocessing := *source.RequiresPreprocessing + filter.RequiresPreprocessing = &requiresPreprocessing + } else { + filter.RequiresPreprocessing = nil + } + + // SqlExpression + filter.SqlExpression = genruntime.ClonePointerToString(source.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + filter.PropertyBag = propertyBag + } else { + filter.PropertyBag = nil + } + + // Invoke the augmentConversionForSqlFilter_STATUS interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForSqlFilter_STATUS); ok { + err := augmentedFilter.AssignPropertiesFrom(source) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_SqlFilter_STATUS populates the provided destination SqlFilter_STATUS from our SqlFilter_STATUS +func (filter *SqlFilter_STATUS) AssignProperties_To_SqlFilter_STATUS(destination *v20211101s.SqlFilter_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(filter.PropertyBag) + + // CompatibilityLevel + destination.CompatibilityLevel = genruntime.ClonePointerToInt(filter.CompatibilityLevel) + + // RequiresPreprocessing + if filter.RequiresPreprocessing != nil { + requiresPreprocessing := *filter.RequiresPreprocessing + destination.RequiresPreprocessing = &requiresPreprocessing + } else { + destination.RequiresPreprocessing = nil + } + + // SqlExpression + destination.SqlExpression = genruntime.ClonePointerToString(filter.SqlExpression) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForSqlFilter_STATUS interface (if implemented) to customize the conversion + var filterAsAny any = filter + if augmentedFilter, ok := filterAsAny.(augmentConversionForSqlFilter_STATUS); ok { + err := augmentedFilter.AssignPropertiesTo(destination) + if err != nil { + return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForAction interface { + AssignPropertiesFrom(src *v20211101s.Action) error + AssignPropertiesTo(dst *v20211101s.Action) error +} + +type augmentConversionForAction_STATUS interface { + AssignPropertiesFrom(src *v20211101s.Action_STATUS) error + AssignPropertiesTo(dst *v20211101s.Action_STATUS) error +} + +type augmentConversionForCorrelationFilter interface { + AssignPropertiesFrom(src *v20211101s.CorrelationFilter) error + AssignPropertiesTo(dst *v20211101s.CorrelationFilter) error +} + +type augmentConversionForCorrelationFilter_STATUS interface { + AssignPropertiesFrom(src *v20211101s.CorrelationFilter_STATUS) error + AssignPropertiesTo(dst *v20211101s.CorrelationFilter_STATUS) error +} + +type augmentConversionForSqlFilter interface { + AssignPropertiesFrom(src *v20211101s.SqlFilter) error + AssignPropertiesTo(dst *v20211101s.SqlFilter) error +} + +type augmentConversionForSqlFilter_STATUS interface { + AssignPropertiesFrom(src *v20211101s.SqlFilter_STATUS) error + AssignPropertiesTo(dst *v20211101s.SqlFilter_STATUS) error +} + +func init() { + SchemeBuilder.Register(&NamespacesTopicsSubscriptionsRule{}, &NamespacesTopicsSubscriptionsRuleList{}) +} diff --git a/v2/api/servicebus/v1api20221001previewstorage/namespaces_topics_subscriptions_rule_types_gen_test.go b/v2/api/servicebus/v1api20221001previewstorage/namespaces_topics_subscriptions_rule_types_gen_test.go new file mode 100644 index 00000000000..a1559483bfd --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/namespaces_topics_subscriptions_rule_types_gen_test.go @@ -0,0 +1,1050 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20221001previewstorage + +import ( + "encoding/json" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + "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_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesTopicsSubscriptionsRule, NamespacesTopicsSubscriptionsRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesTopicsSubscriptionsRule tests if a specific instance of NamespacesTopicsSubscriptionsRule round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesTopicsSubscriptionsRule(subject NamespacesTopicsSubscriptionsRule) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub v20211101s.NamespacesTopicsSubscriptionsRule + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesTopicsSubscriptionsRule + 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_NamespacesTopicsSubscriptionsRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscriptionsRule to NamespacesTopicsSubscriptionsRule via AssignProperties_To_NamespacesTopicsSubscriptionsRule & AssignProperties_From_NamespacesTopicsSubscriptionsRule returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule, NamespacesTopicsSubscriptionsRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule tests if a specific instance of NamespacesTopicsSubscriptionsRule can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule(subject NamespacesTopicsSubscriptionsRule) 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.NamespacesTopicsSubscriptionsRule + err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscriptionsRule + err = actual.AssignProperties_From_NamespacesTopicsSubscriptionsRule(&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_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule, NamespacesTopicsSubscriptionsRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule runs a test to see if a specific instance of NamespacesTopicsSubscriptionsRule round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule(subject NamespacesTopicsSubscriptionsRule) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionsRule + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicsSubscriptionsRule instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionsRuleGenerator() +var namespacesTopicsSubscriptionsRuleGenerator gopter.Gen + +// NamespacesTopicsSubscriptionsRuleGenerator returns a generator of NamespacesTopicsSubscriptionsRule instances for property testing. +func NamespacesTopicsSubscriptionsRuleGenerator() gopter.Gen { + if namespacesTopicsSubscriptionsRuleGenerator != nil { + return namespacesTopicsSubscriptionsRuleGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule(generators) + namespacesTopicsSubscriptionsRuleGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule{}), generators) + + return namespacesTopicsSubscriptionsRuleGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule(gens map[string]gopter.Gen) { + gens["Spec"] = Namespaces_Topics_Subscriptions_Rule_SpecGenerator() + gens["Status"] = Namespaces_Topics_Subscriptions_Rule_STATUSGenerator() +} + +func Test_Namespaces_Topics_Subscriptions_Rule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscriptions_Rule_Spec to Namespaces_Topics_Subscriptions_Rule_Spec via AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec & AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_Spec, Namespaces_Topics_Subscriptions_Rule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_Spec tests if a specific instance of Namespaces_Topics_Subscriptions_Rule_Spec can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_Spec(subject Namespaces_Topics_Subscriptions_Rule_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 v20211101s.Namespaces_Topics_Subscriptions_Rule_Spec + err := copied.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscriptions_Rule_Spec + err = actual.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec, Namespaces_Topics_Subscriptions_Rule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec runs a test to see if a specific instance of Namespaces_Topics_Subscriptions_Rule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_Spec(subject Namespaces_Topics_Subscriptions_Rule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscriptions_Rule_SpecGenerator() +var namespaces_Topics_Subscriptions_Rule_SpecGenerator gopter.Gen + +// Namespaces_Topics_Subscriptions_Rule_SpecGenerator returns a generator of Namespaces_Topics_Subscriptions_Rule_Spec instances for property testing. +// We first initialize namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_SpecGenerator() gopter.Gen { + if namespaces_Topics_Subscriptions_Rule_SpecGenerator != nil { + return namespaces_Topics_Subscriptions_Rule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(generators) + namespaces_Topics_Subscriptions_Rule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(generators) + namespaces_Topics_Subscriptions_Rule_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_Spec{}), generators) + + return namespaces_Topics_Subscriptions_Rule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["FilterType"] = gen.PtrOf(gen.AlphaString()) + gens["OriginalVersion"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_Spec(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(ActionGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilterGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilterGenerator()) +} + +func Test_Namespaces_Topics_Subscriptions_Rule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespaces_Topics_Subscriptions_Rule_STATUS to Namespaces_Topics_Subscriptions_Rule_STATUS via AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS & AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_STATUS, Namespaces_Topics_Subscriptions_Rule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_STATUS tests if a specific instance of Namespaces_Topics_Subscriptions_Rule_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForNamespaces_Topics_Subscriptions_Rule_STATUS(subject Namespaces_Topics_Subscriptions_Rule_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 v20211101s.Namespaces_Topics_Subscriptions_Rule_STATUS + err := copied.AssignProperties_To_Namespaces_Topics_Subscriptions_Rule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Namespaces_Topics_Subscriptions_Rule_STATUS + err = actual.AssignProperties_From_Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS, Namespaces_Topics_Subscriptions_Rule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS runs a test to see if a specific instance of Namespaces_Topics_Subscriptions_Rule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_Topics_Subscriptions_Rule_STATUS(subject Namespaces_Topics_Subscriptions_Rule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUS instances for property testing - lazily instantiated by +// Namespaces_Topics_Subscriptions_Rule_STATUSGenerator() +var namespaces_Topics_Subscriptions_Rule_STATUSGenerator gopter.Gen + +// Namespaces_Topics_Subscriptions_Rule_STATUSGenerator returns a generator of Namespaces_Topics_Subscriptions_Rule_STATUS instances for property testing. +// We first initialize namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_STATUSGenerator() gopter.Gen { + if namespaces_Topics_Subscriptions_Rule_STATUSGenerator != nil { + return namespaces_Topics_Subscriptions_Rule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(generators) + namespaces_Topics_Subscriptions_Rule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(generators) + namespaces_Topics_Subscriptions_Rule_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_Topics_Subscriptions_Rule_STATUS{}), generators) + + return namespaces_Topics_Subscriptions_Rule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(gens map[string]gopter.Gen) { + gens["FilterType"] = 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()) +} + +// AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespaces_Topics_Subscriptions_Rule_STATUS(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(Action_STATUSGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilter_STATUSGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilter_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_Action_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Action to Action via AssignProperties_To_Action & AssignProperties_From_Action returns original", + prop.ForAll(RunPropertyAssignmentTestForAction, ActionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAction tests if a specific instance of Action can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForAction(subject Action) 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.Action + err := copied.AssignProperties_To_Action(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Action + err = actual.AssignProperties_From_Action(&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_Action_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 Action via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAction, ActionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAction runs a test to see if a specific instance of Action round trips to JSON and back losslessly +func RunJSONSerializationTestForAction(subject Action) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Action + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Action instances for property testing - lazily instantiated by ActionGenerator() +var actionGenerator gopter.Gen + +// ActionGenerator returns a generator of Action instances for property testing. +func ActionGenerator() gopter.Gen { + if actionGenerator != nil { + return actionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAction(generators) + actionGenerator = gen.Struct(reflect.TypeOf(Action{}), generators) + + return actionGenerator +} + +// AddIndependentPropertyGeneratorsForAction is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAction(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_Action_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Action_STATUS to Action_STATUS via AssignProperties_To_Action_STATUS & AssignProperties_From_Action_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForAction_STATUS, Action_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForAction_STATUS tests if a specific instance of Action_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForAction_STATUS(subject Action_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 v20211101s.Action_STATUS + err := copied.AssignProperties_To_Action_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Action_STATUS + err = actual.AssignProperties_From_Action_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_Action_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 Action_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForAction_STATUS, Action_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForAction_STATUS runs a test to see if a specific instance of Action_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForAction_STATUS(subject Action_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Action_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 Action_STATUS instances for property testing - lazily instantiated by Action_STATUSGenerator() +var action_STATUSGenerator gopter.Gen + +// Action_STATUSGenerator returns a generator of Action_STATUS instances for property testing. +func Action_STATUSGenerator() gopter.Gen { + if action_STATUSGenerator != nil { + return action_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForAction_STATUS(generators) + action_STATUSGenerator = gen.Struct(reflect.TypeOf(Action_STATUS{}), generators) + + return action_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForAction_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForAction_STATUS(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CorrelationFilter_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CorrelationFilter to CorrelationFilter via AssignProperties_To_CorrelationFilter & AssignProperties_From_CorrelationFilter returns original", + prop.ForAll(RunPropertyAssignmentTestForCorrelationFilter, CorrelationFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCorrelationFilter tests if a specific instance of CorrelationFilter can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForCorrelationFilter(subject CorrelationFilter) 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.CorrelationFilter + err := copied.AssignProperties_To_CorrelationFilter(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CorrelationFilter + err = actual.AssignProperties_From_CorrelationFilter(&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_CorrelationFilter_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 CorrelationFilter via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCorrelationFilter, CorrelationFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCorrelationFilter runs a test to see if a specific instance of CorrelationFilter round trips to JSON and back losslessly +func RunJSONSerializationTestForCorrelationFilter(subject CorrelationFilter) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CorrelationFilter + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of CorrelationFilter instances for property testing - lazily instantiated by CorrelationFilterGenerator() +var correlationFilterGenerator gopter.Gen + +// CorrelationFilterGenerator returns a generator of CorrelationFilter instances for property testing. +func CorrelationFilterGenerator() gopter.Gen { + if correlationFilterGenerator != nil { + return correlationFilterGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCorrelationFilter(generators) + correlationFilterGenerator = gen.Struct(reflect.TypeOf(CorrelationFilter{}), generators) + + return correlationFilterGenerator +} + +// AddIndependentPropertyGeneratorsForCorrelationFilter is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCorrelationFilter(gens map[string]gopter.Gen) { + gens["ContentType"] = gen.PtrOf(gen.AlphaString()) + gens["CorrelationId"] = gen.PtrOf(gen.AlphaString()) + gens["Label"] = gen.PtrOf(gen.AlphaString()) + gens["MessageId"] = gen.PtrOf(gen.AlphaString()) + gens["Properties"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ReplyTo"] = gen.PtrOf(gen.AlphaString()) + gens["ReplyToSessionId"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SessionId"] = gen.PtrOf(gen.AlphaString()) + gens["To"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_CorrelationFilter_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from CorrelationFilter_STATUS to CorrelationFilter_STATUS via AssignProperties_To_CorrelationFilter_STATUS & AssignProperties_From_CorrelationFilter_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForCorrelationFilter_STATUS, CorrelationFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForCorrelationFilter_STATUS tests if a specific instance of CorrelationFilter_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForCorrelationFilter_STATUS(subject CorrelationFilter_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 v20211101s.CorrelationFilter_STATUS + err := copied.AssignProperties_To_CorrelationFilter_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual CorrelationFilter_STATUS + err = actual.AssignProperties_From_CorrelationFilter_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_CorrelationFilter_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 CorrelationFilter_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForCorrelationFilter_STATUS, CorrelationFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForCorrelationFilter_STATUS runs a test to see if a specific instance of CorrelationFilter_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForCorrelationFilter_STATUS(subject CorrelationFilter_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual CorrelationFilter_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 CorrelationFilter_STATUS instances for property testing - lazily instantiated by +// CorrelationFilter_STATUSGenerator() +var correlationFilter_STATUSGenerator gopter.Gen + +// CorrelationFilter_STATUSGenerator returns a generator of CorrelationFilter_STATUS instances for property testing. +func CorrelationFilter_STATUSGenerator() gopter.Gen { + if correlationFilter_STATUSGenerator != nil { + return correlationFilter_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS(generators) + correlationFilter_STATUSGenerator = gen.Struct(reflect.TypeOf(CorrelationFilter_STATUS{}), generators) + + return correlationFilter_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS(gens map[string]gopter.Gen) { + gens["ContentType"] = gen.PtrOf(gen.AlphaString()) + gens["CorrelationId"] = gen.PtrOf(gen.AlphaString()) + gens["Label"] = gen.PtrOf(gen.AlphaString()) + gens["MessageId"] = gen.PtrOf(gen.AlphaString()) + gens["Properties"] = gen.MapOf(gen.AlphaString(), gen.AlphaString()) + gens["ReplyTo"] = gen.PtrOf(gen.AlphaString()) + gens["ReplyToSessionId"] = gen.PtrOf(gen.AlphaString()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SessionId"] = gen.PtrOf(gen.AlphaString()) + gens["To"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SqlFilter_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SqlFilter to SqlFilter via AssignProperties_To_SqlFilter & AssignProperties_From_SqlFilter returns original", + prop.ForAll(RunPropertyAssignmentTestForSqlFilter, SqlFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSqlFilter tests if a specific instance of SqlFilter can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSqlFilter(subject SqlFilter) 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.SqlFilter + err := copied.AssignProperties_To_SqlFilter(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SqlFilter + err = actual.AssignProperties_From_SqlFilter(&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_SqlFilter_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 SqlFilter via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSqlFilter, SqlFilterGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSqlFilter runs a test to see if a specific instance of SqlFilter round trips to JSON and back losslessly +func RunJSONSerializationTestForSqlFilter(subject SqlFilter) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SqlFilter + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SqlFilter instances for property testing - lazily instantiated by SqlFilterGenerator() +var sqlFilterGenerator gopter.Gen + +// SqlFilterGenerator returns a generator of SqlFilter instances for property testing. +func SqlFilterGenerator() gopter.Gen { + if sqlFilterGenerator != nil { + return sqlFilterGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSqlFilter(generators) + sqlFilterGenerator = gen.Struct(reflect.TypeOf(SqlFilter{}), generators) + + return sqlFilterGenerator +} + +// AddIndependentPropertyGeneratorsForSqlFilter is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSqlFilter(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} + +func Test_SqlFilter_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from SqlFilter_STATUS to SqlFilter_STATUS via AssignProperties_To_SqlFilter_STATUS & AssignProperties_From_SqlFilter_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForSqlFilter_STATUS, SqlFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForSqlFilter_STATUS tests if a specific instance of SqlFilter_STATUS can be assigned to v1api20211101storage and back losslessly +func RunPropertyAssignmentTestForSqlFilter_STATUS(subject SqlFilter_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 v20211101s.SqlFilter_STATUS + err := copied.AssignProperties_To_SqlFilter_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SqlFilter_STATUS + err = actual.AssignProperties_From_SqlFilter_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_SqlFilter_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 SqlFilter_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSqlFilter_STATUS, SqlFilter_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSqlFilter_STATUS runs a test to see if a specific instance of SqlFilter_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSqlFilter_STATUS(subject SqlFilter_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SqlFilter_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 SqlFilter_STATUS instances for property testing - lazily instantiated by SqlFilter_STATUSGenerator() +var sqlFilter_STATUSGenerator gopter.Gen + +// SqlFilter_STATUSGenerator returns a generator of SqlFilter_STATUS instances for property testing. +func SqlFilter_STATUSGenerator() gopter.Gen { + if sqlFilter_STATUSGenerator != nil { + return sqlFilter_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSqlFilter_STATUS(generators) + sqlFilter_STATUSGenerator = gen.Struct(reflect.TypeOf(SqlFilter_STATUS{}), generators) + + return sqlFilter_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSqlFilter_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSqlFilter_STATUS(gens map[string]gopter.Gen) { + gens["CompatibilityLevel"] = gen.PtrOf(gen.Int()) + gens["RequiresPreprocessing"] = gen.PtrOf(gen.Bool()) + gens["SqlExpression"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/servicebus/v1api20221001previewstorage/structure.txt b/v2/api/servicebus/v1api20221001previewstorage/structure.txt new file mode 100644 index 00000000000..bdedb4d1c83 --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/structure.txt @@ -0,0 +1,449 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage +├── APIVersion: Enum (1 value) +│ └── "2022-10-01-preview" +├── Namespace: Resource +│ ├── Owner: github.com/Azure/azure-service-operator/v2/api/resources/v1apiv20191001.ResourceGroup +│ ├── Spec: Object (16 properties) +│ │ ├── AlternateName: *string +│ │ ├── AzureName: string +│ │ ├── 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 +│ │ ├── Location: *string +│ │ ├── MinimumTlsVersion: *string +│ │ ├── OperatorSpec: *Object (2 properties) +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ └── Secrets: *Object (6 properties) +│ │ │ ├── Endpoint: *genruntime.SecretDestination +│ │ │ ├── PrimaryConnectionString: *genruntime.SecretDestination +│ │ │ ├── PrimaryKey: *genruntime.SecretDestination +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── SecondaryConnectionString: *genruntime.SecretDestination +│ │ │ └── SecondaryKey: *genruntime.SecretDestination +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PremiumMessagingPartitions: *int +│ │ ├── 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 (24 properties) +│ ├── AlternateName: *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 +│ ├── Location: *string +│ ├── MetricId: *string +│ ├── MinimumTlsVersion: *string +│ ├── Name: *string +│ ├── PremiumMessagingPartitions: *int +│ ├── 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: github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview.Namespace +│ ├── Spec: Object (6 properties) +│ │ ├── AzureName: Validated (2 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ └── Rule 1: MinLength: 1 +│ │ ├── 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 +├── NamespacesQueue: Resource +│ ├── Owner: github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview.Namespace +│ ├── Spec: Object (19 properties) +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── AzureName: Validated (1 rule) +│ │ │ └── Rule 0: MinLength: 1 +│ │ ├── DeadLetteringOnMessageExpiration: *bool +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── EnableExpress: *bool +│ │ ├── EnablePartitioning: *bool +│ │ ├── ForwardDeadLetteredMessagesTo: *string +│ │ ├── ForwardTo: *string +│ │ ├── LockDuration: *string +│ │ ├── MaxDeliveryCount: *int +│ │ ├── MaxMessageSizeInKilobytes: *int +│ │ ├── MaxSizeInMegabytes: *int +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── RequiresDuplicateDetection: *bool +│ │ └── RequiresSession: *bool +│ └── Status: Object (29 properties) +│ ├── AccessedAt: *string +│ ├── AutoDeleteOnIdle: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CountDetails: *Object (6 properties) +│ │ ├── ActiveMessageCount: *int +│ │ ├── DeadLetterMessageCount: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── ScheduledMessageCount: *int +│ │ ├── TransferDeadLetterMessageCount: *int +│ │ └── TransferMessageCount: *int +│ ├── CreatedAt: *string +│ ├── DeadLetteringOnMessageExpiration: *bool +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── EnableExpress: *bool +│ ├── EnablePartitioning: *bool +│ ├── ForwardDeadLetteredMessagesTo: *string +│ ├── ForwardTo: *string +│ ├── Id: *string +│ ├── Location: *string +│ ├── LockDuration: *string +│ ├── MaxDeliveryCount: *int +│ ├── MaxMessageSizeInKilobytes: *int +│ ├── MaxSizeInMegabytes: *int +│ ├── MessageCount: *int +│ ├── Name: *string +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── RequiresDuplicateDetection: *bool +│ ├── RequiresSession: *bool +│ ├── SizeInBytes: *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 +├── NamespacesTopic: Resource +│ ├── Owner: github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview.Namespace +│ ├── Spec: Object (14 properties) +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── AzureName: Validated (1 rule) +│ │ │ └── Rule 0: MinLength: 1 +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── EnableExpress: *bool +│ │ ├── EnablePartitioning: *bool +│ │ ├── MaxMessageSizeInKilobytes: *int +│ │ ├── MaxSizeInMegabytes: *int +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── RequiresDuplicateDetection: *bool +│ │ └── SupportOrdering: *bool +│ └── Status: Object (24 properties) +│ ├── AccessedAt: *string +│ ├── AutoDeleteOnIdle: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CountDetails: *Object (6 properties) +│ │ ├── ActiveMessageCount: *int +│ │ ├── DeadLetterMessageCount: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── ScheduledMessageCount: *int +│ │ ├── TransferDeadLetterMessageCount: *int +│ │ └── TransferMessageCount: *int +│ ├── CreatedAt: *string +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── EnableExpress: *bool +│ ├── EnablePartitioning: *bool +│ ├── Id: *string +│ ├── Location: *string +│ ├── MaxMessageSizeInKilobytes: *int +│ ├── MaxSizeInMegabytes: *int +│ ├── Name: *string +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── RequiresDuplicateDetection: *bool +│ ├── SizeInBytes: *int +│ ├── Status: *string +│ ├── SubscriptionCount: *int +│ ├── SupportOrdering: *bool +│ ├── SystemData: *Object (7 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *string +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ ├── LastModifiedByType: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── Type: *string +│ └── UpdatedAt: *string +├── NamespacesTopicsSubscription: Resource +│ ├── Owner: github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview.NamespacesTopic +│ ├── Spec: Object (17 properties) +│ │ ├── AutoDeleteOnIdle: *string +│ │ ├── AzureName: Validated (2 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ └── Rule 1: MinLength: 1 +│ │ ├── ClientAffineProperties: *Object (4 properties) +│ │ │ ├── ClientId: *string +│ │ │ ├── IsDurable: *bool +│ │ │ ├── IsShared: *bool +│ │ │ └── PropertyBag: genruntime.PropertyBag +│ │ ├── DeadLetteringOnFilterEvaluationExceptions: *bool +│ │ ├── DeadLetteringOnMessageExpiration: *bool +│ │ ├── DefaultMessageTimeToLive: *string +│ │ ├── DuplicateDetectionHistoryTimeWindow: *string +│ │ ├── EnableBatchedOperations: *bool +│ │ ├── ForwardDeadLetteredMessagesTo: *string +│ │ ├── ForwardTo: *string +│ │ ├── IsClientAffine: *bool +│ │ ├── LockDuration: *string +│ │ ├── MaxDeliveryCount: *int +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── RequiresSession: *bool +│ └── Status: Object (26 properties) +│ ├── AccessedAt: *string +│ ├── AutoDeleteOnIdle: *string +│ ├── ClientAffineProperties: *Object (4 properties) +│ │ ├── ClientId: *string +│ │ ├── IsDurable: *bool +│ │ ├── IsShared: *bool +│ │ └── PropertyBag: genruntime.PropertyBag +│ ├── Conditions: conditions.Condition[] +│ ├── CountDetails: *Object (6 properties) +│ │ ├── ActiveMessageCount: *int +│ │ ├── DeadLetterMessageCount: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── ScheduledMessageCount: *int +│ │ ├── TransferDeadLetterMessageCount: *int +│ │ └── TransferMessageCount: *int +│ ├── CreatedAt: *string +│ ├── DeadLetteringOnFilterEvaluationExceptions: *bool +│ ├── DeadLetteringOnMessageExpiration: *bool +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── ForwardDeadLetteredMessagesTo: *string +│ ├── ForwardTo: *string +│ ├── Id: *string +│ ├── IsClientAffine: *bool +│ ├── Location: *string +│ ├── LockDuration: *string +│ ├── MaxDeliveryCount: *int +│ ├── MessageCount: *int +│ ├── Name: *string +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── RequiresSession: *bool +│ ├── 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 +├── NamespacesTopicsSubscriptionsRule: Resource +│ ├── Owner: github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview.NamespacesTopicsSubscription +│ ├── Spec: Object (8 properties) +│ │ ├── Action: *Object (4 properties) +│ │ │ ├── CompatibilityLevel: *int +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── RequiresPreprocessing: *bool +│ │ │ └── SqlExpression: *string +│ │ ├── AzureName: Validated (2 rules) +│ │ │ ├── Rule 0: MaxLength: 50 +│ │ │ └── Rule 1: MinLength: 1 +│ │ ├── CorrelationFilter: *Object (11 properties) +│ │ │ ├── ContentType: *string +│ │ │ ├── CorrelationId: *string +│ │ │ ├── Label: *string +│ │ │ ├── MessageId: *string +│ │ │ ├── Properties: map[string]string +│ │ │ ├── PropertyBag: genruntime.PropertyBag +│ │ │ ├── ReplyTo: *string +│ │ │ ├── ReplyToSessionId: *string +│ │ │ ├── RequiresPreprocessing: *bool +│ │ │ ├── SessionId: *string +│ │ │ └── To: *string +│ │ ├── FilterType: *string +│ │ ├── OriginalVersion: string +│ │ ├── Owner: *genruntime.KnownResourceReference +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── SqlFilter: *Object (4 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *string +│ └── Status: Object (11 properties) +│ ├── Action: *Object (4 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *string +│ ├── Conditions: conditions.Condition[] +│ ├── CorrelationFilter: *Object (11 properties) +│ │ ├── ContentType: *string +│ │ ├── CorrelationId: *string +│ │ ├── Label: *string +│ │ ├── MessageId: *string +│ │ ├── Properties: map[string]string +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── ReplyTo: *string +│ │ ├── ReplyToSessionId: *string +│ │ ├── RequiresPreprocessing: *bool +│ │ ├── SessionId: *string +│ │ └── To: *string +│ ├── FilterType: *string +│ ├── Id: *string +│ ├── Location: *string +│ ├── Name: *string +│ ├── PropertyBag: genruntime.PropertyBag +│ ├── SqlFilter: *Object (4 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *string +│ ├── SystemData: *Object (7 properties) +│ │ ├── CreatedAt: *string +│ │ ├── CreatedBy: *string +│ │ ├── CreatedByType: *string +│ │ ├── LastModifiedAt: *string +│ │ ├── LastModifiedBy: *string +│ │ ├── LastModifiedByType: *string +│ │ └── PropertyBag: genruntime.PropertyBag +│ └── Type: *string +├── augmentConversionForAction: Interface +├── augmentConversionForAction_STATUS: Interface +├── augmentConversionForCorrelationFilter: Interface +├── augmentConversionForCorrelationFilter_STATUS: Interface +├── augmentConversionForEncryption: Interface +├── augmentConversionForEncryption_STATUS: Interface +├── augmentConversionForIdentity: Interface +├── augmentConversionForIdentity_STATUS: Interface +├── augmentConversionForKeyVaultProperties: Interface +├── augmentConversionForKeyVaultProperties_STATUS: Interface +├── augmentConversionForMessageCountDetails_STATUS: Interface +├── augmentConversionForNamespace: Interface +├── augmentConversionForNamespaceOperatorSecrets: Interface +├── augmentConversionForNamespaceOperatorSpec: Interface +├── augmentConversionForNamespace_STATUS: Interface +├── augmentConversionForNamespace_Spec: Interface +├── augmentConversionForNamespacesAuthorizationRule: Interface +├── augmentConversionForNamespacesAuthorizationRuleOperatorSecrets: Interface +├── augmentConversionForNamespacesAuthorizationRuleOperatorSpec: Interface +├── augmentConversionForNamespacesQueue: Interface +├── augmentConversionForNamespacesTopic: Interface +├── augmentConversionForNamespacesTopicsSubscription: Interface +├── augmentConversionForNamespacesTopicsSubscriptionsRule: Interface +├── augmentConversionForNamespaces_AuthorizationRule_STATUS: Interface +├── augmentConversionForNamespaces_AuthorizationRule_Spec: Interface +├── augmentConversionForNamespaces_Queue_STATUS: Interface +├── augmentConversionForNamespaces_Queue_Spec: Interface +├── augmentConversionForNamespaces_Topic_STATUS: Interface +├── augmentConversionForNamespaces_Topic_Spec: Interface +├── augmentConversionForNamespaces_Topics_Subscription_STATUS: Interface +├── augmentConversionForNamespaces_Topics_Subscription_Spec: Interface +├── augmentConversionForNamespaces_Topics_Subscriptions_Rule_STATUS: Interface +├── augmentConversionForNamespaces_Topics_Subscriptions_Rule_Spec: Interface +├── augmentConversionForPrivateEndpointConnection_STATUS: Interface +├── augmentConversionForSBClientAffineProperties: Interface +├── augmentConversionForSBClientAffineProperties_STATUS: Interface +├── augmentConversionForSBSku: Interface +├── augmentConversionForSBSku_STATUS: Interface +├── augmentConversionForSqlFilter: Interface +├── augmentConversionForSqlFilter_STATUS: Interface +├── augmentConversionForSystemData_STATUS: Interface +├── augmentConversionForUserAssignedIdentityDetails: Interface +├── augmentConversionForUserAssignedIdentityProperties: Interface +├── augmentConversionForUserAssignedIdentityProperties_STATUS: Interface +└── augmentConversionForUserAssignedIdentity_STATUS: Interface diff --git a/v2/api/servicebus/v1api20221001previewstorage/zz_generated.deepcopy.go b/v2/api/servicebus/v1api20221001previewstorage/zz_generated.deepcopy.go new file mode 100644 index 00000000000..09dcb61f8f3 --- /dev/null +++ b/v2/api/servicebus/v1api20221001previewstorage/zz_generated.deepcopy.go @@ -0,0 +1,2604 @@ +//go:build !ignore_autogenerated + +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1api20221001previewstorage + +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 *Action) DeepCopyInto(out *Action) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *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.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action. +func (in *Action) DeepCopy() *Action { + if in == nil { + return nil + } + out := new(Action) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Action_STATUS) DeepCopyInto(out *Action_STATUS) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *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.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Action_STATUS. +func (in *Action_STATUS) DeepCopy() *Action_STATUS { + if in == nil { + return nil + } + out := new(Action_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 *CorrelationFilter) DeepCopyInto(out *CorrelationFilter) { + *out = *in + if in.ContentType != nil { + in, out := &in.ContentType, &out.ContentType + *out = new(string) + **out = **in + } + if in.CorrelationId != nil { + in, out := &in.CorrelationId, &out.CorrelationId + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MessageId != nil { + in, out := &in.MessageId, &out.MessageId + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ReplyTo != nil { + in, out := &in.ReplyTo, &out.ReplyTo + *out = new(string) + **out = **in + } + if in.ReplyToSessionId != nil { + in, out := &in.ReplyToSessionId, &out.ReplyToSessionId + *out = new(string) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SessionId != nil { + in, out := &in.SessionId, &out.SessionId + *out = new(string) + **out = **in + } + if in.To != nil { + in, out := &in.To, &out.To + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelationFilter. +func (in *CorrelationFilter) DeepCopy() *CorrelationFilter { + if in == nil { + return nil + } + out := new(CorrelationFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CorrelationFilter_STATUS) DeepCopyInto(out *CorrelationFilter_STATUS) { + *out = *in + if in.ContentType != nil { + in, out := &in.ContentType, &out.ContentType + *out = new(string) + **out = **in + } + if in.CorrelationId != nil { + in, out := &in.CorrelationId, &out.CorrelationId + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MessageId != nil { + in, out := &in.MessageId, &out.MessageId + *out = new(string) + **out = **in + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ReplyTo != nil { + in, out := &in.ReplyTo, &out.ReplyTo + *out = new(string) + **out = **in + } + if in.ReplyToSessionId != nil { + in, out := &in.ReplyToSessionId, &out.ReplyToSessionId + *out = new(string) + **out = **in + } + if in.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SessionId != nil { + in, out := &in.SessionId, &out.SessionId + *out = new(string) + **out = **in + } + if in.To != nil { + in, out := &in.To, &out.To + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorrelationFilter_STATUS. +func (in *CorrelationFilter_STATUS) DeepCopy() *CorrelationFilter_STATUS { + if in == nil { + return nil + } + out := new(CorrelationFilter_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 *MessageCountDetails_STATUS) DeepCopyInto(out *MessageCountDetails_STATUS) { + *out = *in + if in.ActiveMessageCount != nil { + in, out := &in.ActiveMessageCount, &out.ActiveMessageCount + *out = new(int) + **out = **in + } + if in.DeadLetterMessageCount != nil { + in, out := &in.DeadLetterMessageCount, &out.DeadLetterMessageCount + *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.ScheduledMessageCount != nil { + in, out := &in.ScheduledMessageCount, &out.ScheduledMessageCount + *out = new(int) + **out = **in + } + if in.TransferDeadLetterMessageCount != nil { + in, out := &in.TransferDeadLetterMessageCount, &out.TransferDeadLetterMessageCount + *out = new(int) + **out = **in + } + if in.TransferMessageCount != nil { + in, out := &in.TransferMessageCount, &out.TransferMessageCount + *out = new(int) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MessageCountDetails_STATUS. +func (in *MessageCountDetails_STATUS) DeepCopy() *MessageCountDetails_STATUS { + if in == nil { + return nil + } + out := new(MessageCountDetails_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.Endpoint != nil { + in, out := &in.Endpoint, &out.Endpoint + *out = new(genruntime.SecretDestination) + **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.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.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **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.PremiumMessagingPartitions != nil { + in, out := &in.PremiumMessagingPartitions, &out.PremiumMessagingPartitions + *out = new(int) + **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(SBSku_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.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.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **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.PremiumMessagingPartitions != nil { + in, out := &in.PremiumMessagingPartitions, &out.PremiumMessagingPartitions + *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.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(SBSku) + (*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 *NamespacesQueue) DeepCopyInto(out *NamespacesQueue) { + *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 NamespacesQueue. +func (in *NamespacesQueue) DeepCopy() *NamespacesQueue { + if in == nil { + return nil + } + out := new(NamespacesQueue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesQueue) 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 *NamespacesQueueList) DeepCopyInto(out *NamespacesQueueList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesQueue, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesQueueList. +func (in *NamespacesQueueList) DeepCopy() *NamespacesQueueList { + if in == nil { + return nil + } + out := new(NamespacesQueueList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesQueueList) 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 *NamespacesTopic) DeepCopyInto(out *NamespacesTopic) { + *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 NamespacesTopic. +func (in *NamespacesTopic) DeepCopy() *NamespacesTopic { + if in == nil { + return nil + } + out := new(NamespacesTopic) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopic) 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 *NamespacesTopicList) DeepCopyInto(out *NamespacesTopicList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesTopic, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicList. +func (in *NamespacesTopicList) DeepCopy() *NamespacesTopicList { + if in == nil { + return nil + } + out := new(NamespacesTopicList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicList) 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 *NamespacesTopicsSubscription) DeepCopyInto(out *NamespacesTopicsSubscription) { + *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 NamespacesTopicsSubscription. +func (in *NamespacesTopicsSubscription) DeepCopy() *NamespacesTopicsSubscription { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscription) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscription) 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 *NamespacesTopicsSubscriptionList) DeepCopyInto(out *NamespacesTopicsSubscriptionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesTopicsSubscription, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicsSubscriptionList. +func (in *NamespacesTopicsSubscriptionList) DeepCopy() *NamespacesTopicsSubscriptionList { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscriptionList) 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 *NamespacesTopicsSubscriptionsRule) DeepCopyInto(out *NamespacesTopicsSubscriptionsRule) { + *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 NamespacesTopicsSubscriptionsRule. +func (in *NamespacesTopicsSubscriptionsRule) DeepCopy() *NamespacesTopicsSubscriptionsRule { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscriptionsRule) 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 *NamespacesTopicsSubscriptionsRuleList) DeepCopyInto(out *NamespacesTopicsSubscriptionsRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespacesTopicsSubscriptionsRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicsSubscriptionsRuleList. +func (in *NamespacesTopicsSubscriptionsRuleList) DeepCopy() *NamespacesTopicsSubscriptionsRuleList { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespacesTopicsSubscriptionsRuleList) 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_Queue_STATUS) DeepCopyInto(out *Namespaces_Queue_STATUS) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *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.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *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.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **out = **in + } + if in.MessageCount != nil { + in, out := &in.MessageCount, &out.MessageCount + *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.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } + if in.SizeInBytes != nil { + in, out := &in.SizeInBytes, &out.SizeInBytes + *out = new(int) + **out = **in + } + 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_Queue_STATUS. +func (in *Namespaces_Queue_STATUS) DeepCopy() *Namespaces_Queue_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Queue_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_Queue_Spec) DeepCopyInto(out *Namespaces_Queue_Spec) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **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.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Queue_Spec. +func (in *Namespaces_Queue_Spec) DeepCopy() *Namespaces_Queue_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Queue_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_Topic_STATUS) DeepCopyInto(out *Namespaces_Topic_STATUS) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *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.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **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.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *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.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.SizeInBytes != nil { + in, out := &in.SizeInBytes, &out.SizeInBytes + *out = new(int) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.SubscriptionCount != nil { + in, out := &in.SubscriptionCount, &out.SubscriptionCount + *out = new(int) + **out = **in + } + if in.SupportOrdering != nil { + in, out := &in.SupportOrdering, &out.SupportOrdering + *out = new(bool) + **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_Topic_STATUS. +func (in *Namespaces_Topic_STATUS) DeepCopy() *Namespaces_Topic_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Topic_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_Topic_Spec) DeepCopyInto(out *Namespaces_Topic_Spec) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.EnableExpress != nil { + in, out := &in.EnableExpress, &out.EnableExpress + *out = new(bool) + **out = **in + } + if in.EnablePartitioning != nil { + in, out := &in.EnablePartitioning, &out.EnablePartitioning + *out = new(bool) + **out = **in + } + if in.MaxMessageSizeInKilobytes != nil { + in, out := &in.MaxMessageSizeInKilobytes, &out.MaxMessageSizeInKilobytes + *out = new(int) + **out = **in + } + if in.MaxSizeInMegabytes != nil { + in, out := &in.MaxSizeInMegabytes, &out.MaxSizeInMegabytes + *out = new(int) + **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.RequiresDuplicateDetection != nil { + in, out := &in.RequiresDuplicateDetection, &out.RequiresDuplicateDetection + *out = new(bool) + **out = **in + } + if in.SupportOrdering != nil { + in, out := &in.SupportOrdering, &out.SupportOrdering + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topic_Spec. +func (in *Namespaces_Topic_Spec) DeepCopy() *Namespaces_Topic_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Topic_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_Topics_Subscription_STATUS) DeepCopyInto(out *Namespaces_Topics_Subscription_STATUS) { + *out = *in + if in.AccessedAt != nil { + in, out := &in.AccessedAt, &out.AccessedAt + *out = new(string) + **out = **in + } + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.ClientAffineProperties != nil { + in, out := &in.ClientAffineProperties, &out.ClientAffineProperties + *out = new(SBClientAffineProperties_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.CountDetails != nil { + in, out := &in.CountDetails, &out.CountDetails + *out = new(MessageCountDetails_STATUS) + (*in).DeepCopyInto(*out) + } + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.DeadLetteringOnFilterEvaluationExceptions != nil { + in, out := &in.DeadLetteringOnFilterEvaluationExceptions, &out.DeadLetteringOnFilterEvaluationExceptions + *out = new(bool) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.Id != nil { + in, out := &in.Id, &out.Id + *out = new(string) + **out = **in + } + if in.IsClientAffine != nil { + in, out := &in.IsClientAffine, &out.IsClientAffine + *out = new(bool) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **out = **in + } + if in.MessageCount != nil { + in, out := &in.MessageCount, &out.MessageCount + *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.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } + 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_Topics_Subscription_STATUS. +func (in *Namespaces_Topics_Subscription_STATUS) DeepCopy() *Namespaces_Topics_Subscription_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscription_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_Topics_Subscription_Spec) DeepCopyInto(out *Namespaces_Topics_Subscription_Spec) { + *out = *in + if in.AutoDeleteOnIdle != nil { + in, out := &in.AutoDeleteOnIdle, &out.AutoDeleteOnIdle + *out = new(string) + **out = **in + } + if in.ClientAffineProperties != nil { + in, out := &in.ClientAffineProperties, &out.ClientAffineProperties + *out = new(SBClientAffineProperties) + (*in).DeepCopyInto(*out) + } + if in.DeadLetteringOnFilterEvaluationExceptions != nil { + in, out := &in.DeadLetteringOnFilterEvaluationExceptions, &out.DeadLetteringOnFilterEvaluationExceptions + *out = new(bool) + **out = **in + } + if in.DeadLetteringOnMessageExpiration != nil { + in, out := &in.DeadLetteringOnMessageExpiration, &out.DeadLetteringOnMessageExpiration + *out = new(bool) + **out = **in + } + if in.DefaultMessageTimeToLive != nil { + in, out := &in.DefaultMessageTimeToLive, &out.DefaultMessageTimeToLive + *out = new(string) + **out = **in + } + if in.DuplicateDetectionHistoryTimeWindow != nil { + in, out := &in.DuplicateDetectionHistoryTimeWindow, &out.DuplicateDetectionHistoryTimeWindow + *out = new(string) + **out = **in + } + if in.EnableBatchedOperations != nil { + in, out := &in.EnableBatchedOperations, &out.EnableBatchedOperations + *out = new(bool) + **out = **in + } + if in.ForwardDeadLetteredMessagesTo != nil { + in, out := &in.ForwardDeadLetteredMessagesTo, &out.ForwardDeadLetteredMessagesTo + *out = new(string) + **out = **in + } + if in.ForwardTo != nil { + in, out := &in.ForwardTo, &out.ForwardTo + *out = new(string) + **out = **in + } + if in.IsClientAffine != nil { + in, out := &in.IsClientAffine, &out.IsClientAffine + *out = new(bool) + **out = **in + } + if in.LockDuration != nil { + in, out := &in.LockDuration, &out.LockDuration + *out = new(string) + **out = **in + } + if in.MaxDeliveryCount != nil { + in, out := &in.MaxDeliveryCount, &out.MaxDeliveryCount + *out = new(int) + **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.RequiresSession != nil { + in, out := &in.RequiresSession, &out.RequiresSession + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topics_Subscription_Spec. +func (in *Namespaces_Topics_Subscription_Spec) DeepCopy() *Namespaces_Topics_Subscription_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscription_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_Topics_Subscriptions_Rule_STATUS) DeepCopyInto(out *Namespaces_Topics_Subscriptions_Rule_STATUS) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(Action_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.CorrelationFilter != nil { + in, out := &in.CorrelationFilter, &out.CorrelationFilter + *out = new(CorrelationFilter_STATUS) + (*in).DeepCopyInto(*out) + } + if in.FilterType != nil { + in, out := &in.FilterType, &out.FilterType + *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.SqlFilter != nil { + in, out := &in.SqlFilter, &out.SqlFilter + *out = new(SqlFilter_STATUS) + (*in).DeepCopyInto(*out) + } + 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_Topics_Subscriptions_Rule_STATUS. +func (in *Namespaces_Topics_Subscriptions_Rule_STATUS) DeepCopy() *Namespaces_Topics_Subscriptions_Rule_STATUS { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscriptions_Rule_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_Topics_Subscriptions_Rule_Spec) DeepCopyInto(out *Namespaces_Topics_Subscriptions_Rule_Spec) { + *out = *in + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = new(Action) + (*in).DeepCopyInto(*out) + } + if in.CorrelationFilter != nil { + in, out := &in.CorrelationFilter, &out.CorrelationFilter + *out = new(CorrelationFilter) + (*in).DeepCopyInto(*out) + } + if in.FilterType != nil { + in, out := &in.FilterType, &out.FilterType + *out = new(string) + **out = **in + } + if in.Owner != nil { + in, out := &in.Owner, &out.Owner + *out = new(genruntime.KnownResourceReference) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SqlFilter != nil { + in, out := &in.SqlFilter, &out.SqlFilter + *out = new(SqlFilter) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Namespaces_Topics_Subscriptions_Rule_Spec. +func (in *Namespaces_Topics_Subscriptions_Rule_Spec) DeepCopy() *Namespaces_Topics_Subscriptions_Rule_Spec { + if in == nil { + return nil + } + out := new(Namespaces_Topics_Subscriptions_Rule_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 *SBClientAffineProperties) DeepCopyInto(out *SBClientAffineProperties) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.IsDurable != nil { + in, out := &in.IsDurable, &out.IsDurable + *out = new(bool) + **out = **in + } + if in.IsShared != nil { + in, out := &in.IsShared, &out.IsShared + *out = new(bool) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBClientAffineProperties. +func (in *SBClientAffineProperties) DeepCopy() *SBClientAffineProperties { + if in == nil { + return nil + } + out := new(SBClientAffineProperties) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SBClientAffineProperties_STATUS) DeepCopyInto(out *SBClientAffineProperties_STATUS) { + *out = *in + if in.ClientId != nil { + in, out := &in.ClientId, &out.ClientId + *out = new(string) + **out = **in + } + if in.IsDurable != nil { + in, out := &in.IsDurable, &out.IsDurable + *out = new(bool) + **out = **in + } + if in.IsShared != nil { + in, out := &in.IsShared, &out.IsShared + *out = new(bool) + **out = **in + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SBClientAffineProperties_STATUS. +func (in *SBClientAffineProperties_STATUS) DeepCopy() *SBClientAffineProperties_STATUS { + if in == nil { + return nil + } + out := new(SBClientAffineProperties_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 *SBSku) DeepCopyInto(out *SBSku) { + *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 SBSku. +func (in *SBSku) DeepCopy() *SBSku { + if in == nil { + return nil + } + out := new(SBSku) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SBSku_STATUS) DeepCopyInto(out *SBSku_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 SBSku_STATUS. +func (in *SBSku_STATUS) DeepCopy() *SBSku_STATUS { + if in == nil { + return nil + } + out := new(SBSku_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 *SqlFilter) DeepCopyInto(out *SqlFilter) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *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.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SqlFilter. +func (in *SqlFilter) DeepCopy() *SqlFilter { + if in == nil { + return nil + } + out := new(SqlFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SqlFilter_STATUS) DeepCopyInto(out *SqlFilter_STATUS) { + *out = *in + if in.CompatibilityLevel != nil { + in, out := &in.CompatibilityLevel, &out.CompatibilityLevel + *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.RequiresPreprocessing != nil { + in, out := &in.RequiresPreprocessing, &out.RequiresPreprocessing + *out = new(bool) + **out = **in + } + if in.SqlExpression != nil { + in, out := &in.SqlExpression, &out.SqlExpression + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SqlFilter_STATUS. +func (in *SqlFilter_STATUS) DeepCopy() *SqlFilter_STATUS { + if in == nil { + return nil + } + out := new(SqlFilter_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/servicebus/v1beta20210101preview/namespace_types_gen_test.go b/v2/api/servicebus/v1beta20210101preview/namespace_types_gen_test.go index 7f263faa0e1..9d5615fad58 100644 --- a/v2/api/servicebus/v1beta20210101preview/namespace_types_gen_test.go +++ b/v2/api/servicebus/v1beta20210101preview/namespace_types_gen_test.go @@ -5,7 +5,7 @@ package v1beta20210101preview import ( "encoding/json" - v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" v1beta20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101previewstorage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -37,7 +37,7 @@ func RunResourceConversionTestForNamespace(subject Namespace) string { copied := subject.DeepCopy() // Convert to our hub version - var hub v20210101ps.Namespace + var hub v20211101s.Namespace err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1beta20210101preview/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1beta20210101preview/namespaces_queue_types_gen_test.go index 5aa1f18e30e..7be314f7146 100644 --- a/v2/api/servicebus/v1beta20210101preview/namespaces_queue_types_gen_test.go +++ b/v2/api/servicebus/v1beta20210101preview/namespaces_queue_types_gen_test.go @@ -5,7 +5,7 @@ package v1beta20210101preview import ( "encoding/json" - v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" v1beta20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101previewstorage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -37,7 +37,7 @@ func RunResourceConversionTestForNamespacesQueue(subject NamespacesQueue) string copied := subject.DeepCopy() // Convert to our hub version - var hub v20210101ps.NamespacesQueue + var hub v20211101s.NamespacesQueue err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1beta20210101preview/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1beta20210101preview/namespaces_topic_types_gen_test.go index d947d0a18ef..d93643099bc 100644 --- a/v2/api/servicebus/v1beta20210101preview/namespaces_topic_types_gen_test.go +++ b/v2/api/servicebus/v1beta20210101preview/namespaces_topic_types_gen_test.go @@ -5,7 +5,7 @@ package v1beta20210101preview import ( "encoding/json" - v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" v1beta20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101previewstorage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -37,7 +37,7 @@ func RunResourceConversionTestForNamespacesTopic(subject NamespacesTopic) string copied := subject.DeepCopy() // Convert to our hub version - var hub v20210101ps.NamespacesTopic + var hub v20211101s.NamespacesTopic err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1beta20210101preview/namespaces_topics_subscription_types_gen_test.go b/v2/api/servicebus/v1beta20210101preview/namespaces_topics_subscription_types_gen_test.go index a252e55bb3b..2d658e7707e 100644 --- a/v2/api/servicebus/v1beta20210101preview/namespaces_topics_subscription_types_gen_test.go +++ b/v2/api/servicebus/v1beta20210101preview/namespaces_topics_subscription_types_gen_test.go @@ -5,7 +5,7 @@ package v1beta20210101preview import ( "encoding/json" - v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" v1beta20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101previewstorage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -37,7 +37,7 @@ func RunResourceConversionTestForNamespacesTopicsSubscription(subject Namespaces copied := subject.DeepCopy() // Convert to our hub version - var hub v20210101ps.NamespacesTopicsSubscription + var hub v20211101s.NamespacesTopicsSubscription err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1beta20210101preview/namespaces_topics_subscriptions_rule_types_gen_test.go b/v2/api/servicebus/v1beta20210101preview/namespaces_topics_subscriptions_rule_types_gen_test.go index 2f8a1f73f21..8687abe01e7 100644 --- a/v2/api/servicebus/v1beta20210101preview/namespaces_topics_subscriptions_rule_types_gen_test.go +++ b/v2/api/servicebus/v1beta20210101preview/namespaces_topics_subscriptions_rule_types_gen_test.go @@ -5,7 +5,7 @@ package v1beta20210101preview import ( "encoding/json" - v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" v1beta20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101previewstorage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -37,7 +37,7 @@ func RunResourceConversionTestForNamespacesTopicsSubscriptionsRule(subject Names copied := subject.DeepCopy() // Convert to our hub version - var hub v20210101ps.NamespacesTopicsSubscriptionsRule + var hub v20211101s.NamespacesTopicsSubscriptionsRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1beta20210101previewstorage/namespace_types_gen.go b/v2/api/servicebus/v1beta20210101previewstorage/namespace_types_gen.go index 37c947b7461..9e903df2946 100644 --- a/v2/api/servicebus/v1beta20210101previewstorage/namespace_types_gen.go +++ b/v2/api/servicebus/v1beta20210101previewstorage/namespace_types_gen.go @@ -4,7 +4,6 @@ package v1beta20210101previewstorage import ( - "fmt" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -45,22 +44,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.(*v20210101ps.Namespace) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/Namespace but received %T instead", hub) + // intermediate variable for conversion + var source v20210101ps.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.(*v20210101ps.Namespace) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/Namespace but received %T instead", hub) + // intermediate variable for conversion + var destination v20210101ps.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 } var _ genruntime.KubernetesResource = &Namespace{} diff --git a/v2/api/servicebus/v1beta20210101previewstorage/namespace_types_gen_test.go b/v2/api/servicebus/v1beta20210101previewstorage/namespace_types_gen_test.go index c618dfa401a..b6837a9ae5c 100644 --- a/v2/api/servicebus/v1beta20210101previewstorage/namespace_types_gen_test.go +++ b/v2/api/servicebus/v1beta20210101previewstorage/namespace_types_gen_test.go @@ -6,6 +6,7 @@ package v1beta20210101previewstorage import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "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 v20210101ps.Namespace + var hub v20211101s.Namespace err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_queue_types_gen.go b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_queue_types_gen.go index 6814e301001..f2315dfcc1a 100644 --- a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_queue_types_gen.go +++ b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_queue_types_gen.go @@ -4,7 +4,6 @@ package v1beta20210101previewstorage import ( - "fmt" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -45,22 +44,36 @@ var _ conversion.Convertible = &NamespacesQueue{} // ConvertFrom populates our NamespacesQueue from the provided hub NamespacesQueue func (queue *NamespacesQueue) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20210101ps.NamespacesQueue) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesQueue but received %T instead", hub) + // intermediate variable for conversion + var source v20210101ps.NamespacesQueue + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") + } + + err = queue.AssignProperties_From_NamespacesQueue(&source) + if err != nil { + return errors.Wrap(err, "converting from source to queue") } - return queue.AssignProperties_From_NamespacesQueue(source) + return nil } // ConvertTo populates the provided hub NamespacesQueue from our NamespacesQueue func (queue *NamespacesQueue) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20210101ps.NamespacesQueue) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesQueue but received %T instead", hub) + // intermediate variable for conversion + var destination v20210101ps.NamespacesQueue + err := queue.AssignProperties_To_NamespacesQueue(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from queue") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") } - return queue.AssignProperties_To_NamespacesQueue(destination) + return nil } var _ genruntime.KubernetesResource = &NamespacesQueue{} diff --git a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_queue_types_gen_test.go index 504e4565cf7..5339dc62c2c 100644 --- a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_queue_types_gen_test.go +++ b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_queue_types_gen_test.go @@ -6,6 +6,7 @@ package v1beta20210101previewstorage import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesQueue(subject NamespacesQueue) string copied := subject.DeepCopy() // Convert to our hub version - var hub v20210101ps.NamespacesQueue + var hub v20211101s.NamespacesQueue err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topic_types_gen.go b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topic_types_gen.go index 7dcb42f8e73..9954b5e0d57 100644 --- a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topic_types_gen.go +++ b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topic_types_gen.go @@ -4,7 +4,6 @@ package v1beta20210101previewstorage import ( - "fmt" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -45,22 +44,36 @@ var _ conversion.Convertible = &NamespacesTopic{} // ConvertFrom populates our NamespacesTopic from the provided hub NamespacesTopic func (topic *NamespacesTopic) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20210101ps.NamespacesTopic) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesTopic but received %T instead", hub) + // intermediate variable for conversion + var source v20210101ps.NamespacesTopic + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") + } + + err = topic.AssignProperties_From_NamespacesTopic(&source) + if err != nil { + return errors.Wrap(err, "converting from source to topic") } - return topic.AssignProperties_From_NamespacesTopic(source) + return nil } // ConvertTo populates the provided hub NamespacesTopic from our NamespacesTopic func (topic *NamespacesTopic) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20210101ps.NamespacesTopic) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesTopic but received %T instead", hub) + // intermediate variable for conversion + var destination v20210101ps.NamespacesTopic + err := topic.AssignProperties_To_NamespacesTopic(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from topic") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") } - return topic.AssignProperties_To_NamespacesTopic(destination) + return nil } var _ genruntime.KubernetesResource = &NamespacesTopic{} diff --git a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topic_types_gen_test.go index ca1920ac0cd..701008adfb5 100644 --- a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topic_types_gen_test.go +++ b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topic_types_gen_test.go @@ -6,6 +6,7 @@ package v1beta20210101previewstorage import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesTopic(subject NamespacesTopic) string copied := subject.DeepCopy() // Convert to our hub version - var hub v20210101ps.NamespacesTopic + var hub v20211101s.NamespacesTopic err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscription_types_gen.go index 2ab46dc522b..c5cc0465e68 100644 --- a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscription_types_gen.go +++ b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscription_types_gen.go @@ -4,7 +4,6 @@ package v1beta20210101previewstorage import ( - "fmt" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -45,22 +44,36 @@ var _ conversion.Convertible = &NamespacesTopicsSubscription{} // ConvertFrom populates our NamespacesTopicsSubscription from the provided hub NamespacesTopicsSubscription func (subscription *NamespacesTopicsSubscription) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20210101ps.NamespacesTopicsSubscription) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesTopicsSubscription but received %T instead", hub) + // intermediate variable for conversion + var source v20210101ps.NamespacesTopicsSubscription + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") + } + + err = subscription.AssignProperties_From_NamespacesTopicsSubscription(&source) + if err != nil { + return errors.Wrap(err, "converting from source to subscription") } - return subscription.AssignProperties_From_NamespacesTopicsSubscription(source) + return nil } // ConvertTo populates the provided hub NamespacesTopicsSubscription from our NamespacesTopicsSubscription func (subscription *NamespacesTopicsSubscription) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20210101ps.NamespacesTopicsSubscription) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesTopicsSubscription but received %T instead", hub) + // intermediate variable for conversion + var destination v20210101ps.NamespacesTopicsSubscription + err := subscription.AssignProperties_To_NamespacesTopicsSubscription(&destination) + if err != nil { + return errors.Wrap(err, "converting to destination from subscription") + } + err = destination.ConvertTo(hub) + if err != nil { + return errors.Wrap(err, "converting from destination to hub") } - return subscription.AssignProperties_To_NamespacesTopicsSubscription(destination) + return nil } var _ genruntime.KubernetesResource = &NamespacesTopicsSubscription{} diff --git a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscription_types_gen_test.go b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscription_types_gen_test.go index 2d0c3667c5f..ebba4a5b776 100644 --- a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscription_types_gen_test.go +++ b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscription_types_gen_test.go @@ -6,6 +6,7 @@ package v1beta20210101previewstorage import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesTopicsSubscription(subject Namespaces copied := subject.DeepCopy() // Convert to our hub version - var hub v20210101ps.NamespacesTopicsSubscription + var hub v20211101s.NamespacesTopicsSubscription err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen.go index 23a39ee00a1..5dce7a1bbb3 100644 --- a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen.go +++ b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen.go @@ -4,7 +4,6 @@ package v1beta20210101previewstorage import ( - "fmt" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -45,22 +44,36 @@ var _ conversion.Convertible = &NamespacesTopicsSubscriptionsRule{} // ConvertFrom populates our NamespacesTopicsSubscriptionsRule from the provided hub NamespacesTopicsSubscriptionsRule func (rule *NamespacesTopicsSubscriptionsRule) ConvertFrom(hub conversion.Hub) error { - source, ok := hub.(*v20210101ps.NamespacesTopicsSubscriptionsRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + // intermediate variable for conversion + var source v20210101ps.NamespacesTopicsSubscriptionsRule + + err := source.ConvertFrom(hub) + if err != nil { + return errors.Wrap(err, "converting from hub to source") + } + + err = rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule(&source) + if err != nil { + return errors.Wrap(err, "converting from source to rule") } - return rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule(source) + return nil } // ConvertTo populates the provided hub NamespacesTopicsSubscriptionsRule from our NamespacesTopicsSubscriptionsRule func (rule *NamespacesTopicsSubscriptionsRule) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*v20210101ps.NamespacesTopicsSubscriptionsRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20210101previewstorage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + // intermediate variable for conversion + var destination v20210101ps.NamespacesTopicsSubscriptionsRule + err := rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(&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_NamespacesTopicsSubscriptionsRule(destination) + return nil } var _ genruntime.KubernetesResource = &NamespacesTopicsSubscriptionsRule{} diff --git a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen_test.go b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen_test.go index 3b238a6bff5..04e0f638544 100644 --- a/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen_test.go +++ b/v2/api/servicebus/v1beta20210101previewstorage/namespaces_topics_subscriptions_rule_types_gen_test.go @@ -6,6 +6,7 @@ package v1beta20210101previewstorage import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesTopicsSubscriptionsRule(subject Names copied := subject.DeepCopy() // Convert to our hub version - var hub v20210101ps.NamespacesTopicsSubscriptionsRule + var hub v20211101s.NamespacesTopicsSubscriptionsRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/versions_matrix.md b/v2/api/servicebus/versions_matrix.md index 782493289b7..744527c722b 100644 --- a/v2/api/servicebus/versions_matrix.md +++ b/v2/api/servicebus/versions_matrix.md @@ -1,69 +1,76 @@ -| Type Definitions in package "servicebus" | v1api20210101preview | v1beta20210101preview | -|-------------------------------------------------------|----------------------|-----------------------| -| APIVersion | v1api20210101preview | v1beta20210101preview | -| Action | v1api20210101preview | v1beta20210101preview | -| Action_STATUS | v1api20210101preview | v1beta20210101preview | -| CorrelationFilter | v1api20210101preview | v1beta20210101preview | -| CorrelationFilter_STATUS | v1api20210101preview | v1beta20210101preview | -| DictionaryValue_STATUS | v1api20210101preview | v1beta20210101preview | -| Encryption | v1api20210101preview | v1beta20210101preview | -| Encryption_KeySource | v1api20210101preview | v1beta20210101preview | -| Encryption_KeySource_STATUS | v1api20210101preview | v1beta20210101preview | -| Encryption_STATUS | v1api20210101preview | v1beta20210101preview | -| EntityStatus_STATUS | v1api20210101preview | v1beta20210101preview | -| FilterType | v1api20210101preview | v1beta20210101preview | -| FilterType_STATUS | v1api20210101preview | v1beta20210101preview | -| Identity | v1api20210101preview | v1beta20210101preview | -| Identity_STATUS | v1api20210101preview | v1beta20210101preview | -| Identity_Type | v1api20210101preview | v1beta20210101preview | -| Identity_Type_STATUS | v1api20210101preview | v1beta20210101preview | -| KeyVaultProperties | v1api20210101preview | v1beta20210101preview | -| KeyVaultProperties_STATUS | v1api20210101preview | v1beta20210101preview | -| MessageCountDetails_STATUS | v1api20210101preview | v1beta20210101preview | -| Namespace | v1api20210101preview | v1beta20210101preview | -| Namespace_STATUS | v1api20210101preview | v1beta20210101preview | -| Namespace_Spec | v1api20210101preview | v1beta20210101preview | -| NamespacesAuthorizationRule | v1api20210101preview | | -| NamespacesQueue | v1api20210101preview | v1beta20210101preview | -| NamespacesTopic | v1api20210101preview | v1beta20210101preview | -| NamespacesTopicsSubscription | v1api20210101preview | v1beta20210101preview | -| NamespacesTopicsSubscriptionsRule | v1api20210101preview | v1beta20210101preview | -| Namespaces_AuthorizationRule_Properties_Rights_STATUS | v1api20210101preview | | -| Namespaces_AuthorizationRule_Properties_Rights_Spec | v1api20210101preview | | -| Namespaces_AuthorizationRule_Properties_STATUS | v1api20210101preview | | -| Namespaces_AuthorizationRule_Properties_Spec | v1api20210101preview | | -| Namespaces_AuthorizationRule_STATUS | v1api20210101preview | | -| Namespaces_AuthorizationRule_Spec | v1api20210101preview | | -| Namespaces_Queue_STATUS | v1api20210101preview | v1beta20210101preview | -| Namespaces_Queue_Spec | v1api20210101preview | v1beta20210101preview | -| Namespaces_Topic_STATUS | v1api20210101preview | v1beta20210101preview | -| Namespaces_Topic_Spec | v1api20210101preview | v1beta20210101preview | -| Namespaces_Topics_Subscription_STATUS | v1api20210101preview | v1beta20210101preview | -| Namespaces_Topics_Subscription_Spec | v1api20210101preview | v1beta20210101preview | -| Namespaces_Topics_Subscriptions_Rule_STATUS | v1api20210101preview | v1beta20210101preview | -| Namespaces_Topics_Subscriptions_Rule_Spec | v1api20210101preview | v1beta20210101preview | -| PrivateEndpointConnection_STATUS | v1api20210101preview | v1beta20210101preview | -| Ruleproperties | v1api20210101preview | v1beta20210101preview | -| Ruleproperties_STATUS | v1api20210101preview | v1beta20210101preview | -| SBNamespaceProperties | v1api20210101preview | v1beta20210101preview | -| SBNamespaceProperties_STATUS | v1api20210101preview | v1beta20210101preview | -| SBQueueProperties | v1api20210101preview | v1beta20210101preview | -| SBQueueProperties_STATUS | v1api20210101preview | v1beta20210101preview | -| SBSku | v1api20210101preview | v1beta20210101preview | -| SBSku_Name | v1api20210101preview | v1beta20210101preview | -| SBSku_Name_STATUS | v1api20210101preview | v1beta20210101preview | -| SBSku_STATUS | v1api20210101preview | v1beta20210101preview | -| SBSku_Tier | v1api20210101preview | v1beta20210101preview | -| SBSku_Tier_STATUS | v1api20210101preview | v1beta20210101preview | -| SBSubscriptionProperties | v1api20210101preview | v1beta20210101preview | -| SBSubscriptionProperties_STATUS | v1api20210101preview | v1beta20210101preview | -| SBTopicProperties | v1api20210101preview | v1beta20210101preview | -| SBTopicProperties_STATUS | v1api20210101preview | v1beta20210101preview | -| SqlFilter | v1api20210101preview | v1beta20210101preview | -| SqlFilter_STATUS | v1api20210101preview | v1beta20210101preview | -| SystemData_CreatedByType_STATUS | v1api20210101preview | v1beta20210101preview | -| SystemData_LastModifiedByType_STATUS | v1api20210101preview | v1beta20210101preview | -| SystemData_STATUS | v1api20210101preview | v1beta20210101preview | -| UserAssignedIdentityDetails | v1api20210101preview | v1beta20210101preview | -| UserAssignedIdentityProperties | v1api20210101preview | v1beta20210101preview | -| UserAssignedIdentityProperties_STATUS | v1api20210101preview | v1beta20210101preview | +| Type Definitions in package "servicebus" | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +|-------------------------------------------------------|----------------------|---------------|----------------------|-----------------------| +| APIVersion | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Action | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Action_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| CorrelationFilter | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| CorrelationFilter_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| DictionaryValue_STATUS | v1api20210101preview | | | v1beta20210101preview | +| Encryption | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Encryption_KeySource | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Encryption_KeySource_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Encryption_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| EntityStatus_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| FilterType | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| FilterType_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Identity | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Identity_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Identity_Type | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Identity_Type_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| KeyVaultProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| KeyVaultProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| MessageCountDetails_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Namespace | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Namespace_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Namespace_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| NamespacesAuthorizationRule | v1api20210101preview | v1api20211101 | v1api20221001preview | | +| NamespacesQueue | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| NamespacesTopic | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| NamespacesTopicsSubscription | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| NamespacesTopicsSubscriptionsRule | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Namespaces_AuthorizationRule_Properties_Rights_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | | +| Namespaces_AuthorizationRule_Properties_Rights_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | | +| Namespaces_AuthorizationRule_Properties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | | +| Namespaces_AuthorizationRule_Properties_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | | +| Namespaces_AuthorizationRule_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | | +| Namespaces_AuthorizationRule_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | | +| Namespaces_Queue_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Namespaces_Queue_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Namespaces_Topic_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Namespaces_Topic_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Namespaces_Topics_Subscription_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Namespaces_Topics_Subscription_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Namespaces_Topics_Subscriptions_Rule_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Namespaces_Topics_Subscriptions_Rule_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| PrivateEndpointConnection_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Ruleproperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| Ruleproperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBClientAffineProperties | | v1api20211101 | v1api20221001preview | | +| SBClientAffineProperties_STATUS | | v1api20211101 | v1api20221001preview | | +| SBNamespaceProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBNamespaceProperties_MinimumTlsVersion | | | v1api20221001preview | | +| SBNamespaceProperties_MinimumTlsVersion_STATUS | | | v1api20221001preview | | +| SBNamespaceProperties_PublicNetworkAccess | | | v1api20221001preview | | +| SBNamespaceProperties_PublicNetworkAccess_STATUS | | | v1api20221001preview | | +| SBNamespaceProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBQueueProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBQueueProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBSku | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBSku_Name | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBSku_Name_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBSku_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBSku_Tier | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBSku_Tier_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBSubscriptionProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBSubscriptionProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBTopicProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SBTopicProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SqlFilter | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SqlFilter_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SystemData_CreatedByType_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SystemData_LastModifiedByType_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| SystemData_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| UserAssignedIdentityDetails | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| UserAssignedIdentityProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| UserAssignedIdentityProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1beta20210101preview | +| UserAssignedIdentity_STATUS | | v1api20211101 | v1api20221001preview | | diff --git a/v2/azure-arm.yaml b/v2/azure-arm.yaml index 5c62f3c781b..997bbcc1c3f 100644 --- a/v2/azure-arm.yaml +++ b/v2/azure-arm.yaml @@ -45,8 +45,8 @@ typeFilters: - action: include group: servicebus - version: v*20210101preview - because: We want to export this particular preview version + version: v*20210101preview;v*20221001preview + because: We want to export these particular preview versions - action: include group: keyvault @@ -1684,6 +1684,8 @@ objectModelConfiguration: - QueryKey servicebus: 2021-01-01-preview: + DictionaryValue_STATUS: + $nameInNextVersion: UserAssignedIdentity_STATUS Namespace: $export: true $supportedFrom: v2.0.0-alpha.1 @@ -1716,6 +1718,72 @@ objectModelConfiguration: Namespaces_Topics_Subscriptions_Rule: $exportAs: NamespacesTopicsSubscriptionsRule $supportedFrom: v2.0.0-beta.3 + 2021-11-01: + Namespace: + $export: true + $supportedFrom: v2.3.0 + $azureGeneratedSecrets: + - Endpoint + - PrimaryKey + - PrimaryConnectionString + - SecondaryKey + - SecondaryConnectionString + Namespaces_AuthorizationRule: + $exportAs: NamespacesAuthorizationRule + $supportedFrom: v2.3.0 + $azureGeneratedSecrets: + - PrimaryKey + - PrimaryConnectionString + - SecondaryKey + - SecondaryConnectionString + Namespaces_Queue: + $exportAs: NamespacesQueue + $supportedFrom: v2.3.0 + Namespaces_Topic: + $exportAs: NamespacesTopic + $supportedFrom: v2.3.0 + UserAssignedIdentityProperties: + UserAssignedIdentity: + $armReference: true + Namespaces_Topics_Subscription: + $exportAs: NamespacesTopicsSubscription + $supportedFrom: v2.3.0 + Namespaces_Topics_Subscriptions_Rule: + $exportAs: NamespacesTopicsSubscriptionsRule + $supportedFrom: v2.3.0 + 2022-10-01-preview: + Namespace: + $export: true + $supportedFrom: v2.3.0 + $azureGeneratedSecrets: + - Endpoint + - PrimaryKey + - PrimaryConnectionString + - SecondaryKey + - SecondaryConnectionString + Namespaces_AuthorizationRule: + $exportAs: NamespacesAuthorizationRule + $supportedFrom: v2.3.0 + $azureGeneratedSecrets: + - PrimaryKey + - PrimaryConnectionString + - SecondaryKey + - SecondaryConnectionString + Namespaces_Queue: + $exportAs: NamespacesQueue + $supportedFrom: v2.3.0 + Namespaces_Topic: + $exportAs: NamespacesTopic + $supportedFrom: v2.3.0 + UserAssignedIdentityProperties: + UserAssignedIdentity: + $armReference: true + Namespaces_Topics_Subscription: + $exportAs: NamespacesTopicsSubscription + $supportedFrom: v2.3.0 + Namespaces_Topics_Subscriptions_Rule: + $exportAs: NamespacesTopicsSubscriptionsRule + $supportedFrom: v2.3.0 signalrservice: 2021-10-01: SignalR: diff --git a/v2/internal/controllers/controller_resources_gen.go b/v2/internal/controllers/controller_resources_gen.go index 591eb301773..8a6d45153bd 100644 --- a/v2/internal/controllers/controller_resources_gen.go +++ b/v2/internal/controllers/controller_resources_gen.go @@ -179,6 +179,10 @@ import ( servicebus_customizations "github.com/Azure/azure-service-operator/v2/api/servicebus/customizations" servicebus_v20210101p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview" servicebus_v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101previewstorage" + servicebus_v20211101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101" + servicebus_v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101storage" + servicebus_v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" + servicebus_v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001previewstorage" servicebus_v1beta20210101p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101preview" servicebus_v1beta20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1beta20210101previewstorage" signalrservice_customizations "github.com/Azure/azure-service-operator/v2/api/signalrservice/customizations" @@ -643,12 +647,12 @@ func getKnownStorageTypes() []*registration.StorageType { result = append(result, ®istration.StorageType{Obj: new(operationalinsights_v20210601s.Workspace)}) result = append(result, ®istration.StorageType{Obj: new(resources_v20200601s.ResourceGroup)}) result = append(result, ®istration.StorageType{Obj: new(search_v20220901s.SearchService)}) - result = append(result, ®istration.StorageType{Obj: new(servicebus_v20210101ps.Namespace)}) - result = append(result, ®istration.StorageType{Obj: new(servicebus_v20210101ps.NamespacesAuthorizationRule)}) - result = append(result, ®istration.StorageType{Obj: new(servicebus_v20210101ps.NamespacesQueue)}) - result = append(result, ®istration.StorageType{Obj: new(servicebus_v20210101ps.NamespacesTopic)}) - result = append(result, ®istration.StorageType{Obj: new(servicebus_v20210101ps.NamespacesTopicsSubscription)}) - result = append(result, ®istration.StorageType{Obj: new(servicebus_v20210101ps.NamespacesTopicsSubscriptionsRule)}) + result = append(result, ®istration.StorageType{Obj: new(servicebus_v20211101s.Namespace)}) + result = append(result, ®istration.StorageType{Obj: new(servicebus_v20211101s.NamespacesAuthorizationRule)}) + result = append(result, ®istration.StorageType{Obj: new(servicebus_v20211101s.NamespacesQueue)}) + result = append(result, ®istration.StorageType{Obj: new(servicebus_v20211101s.NamespacesTopic)}) + result = append(result, ®istration.StorageType{Obj: new(servicebus_v20211101s.NamespacesTopicsSubscription)}) + result = append(result, ®istration.StorageType{Obj: new(servicebus_v20211101s.NamespacesTopicsSubscriptionsRule)}) result = append(result, ®istration.StorageType{Obj: new(signalrservice_v20211001s.SignalR)}) result = append(result, ®istration.StorageType{ Obj: new(sql_v20211101s.Server), @@ -1401,6 +1405,38 @@ func getKnownTypes() []client.Object { new(servicebus_v20210101ps.NamespacesTopic), new(servicebus_v20210101ps.NamespacesTopicsSubscription), new(servicebus_v20210101ps.NamespacesTopicsSubscriptionsRule)) + result = append( + result, + new(servicebus_v20211101.Namespace), + new(servicebus_v20211101.NamespacesAuthorizationRule), + new(servicebus_v20211101.NamespacesQueue), + new(servicebus_v20211101.NamespacesTopic), + new(servicebus_v20211101.NamespacesTopicsSubscription), + new(servicebus_v20211101.NamespacesTopicsSubscriptionsRule)) + result = append( + result, + new(servicebus_v20211101s.Namespace), + new(servicebus_v20211101s.NamespacesAuthorizationRule), + new(servicebus_v20211101s.NamespacesQueue), + new(servicebus_v20211101s.NamespacesTopic), + new(servicebus_v20211101s.NamespacesTopicsSubscription), + new(servicebus_v20211101s.NamespacesTopicsSubscriptionsRule)) + result = append( + result, + new(servicebus_v20221001p.Namespace), + new(servicebus_v20221001p.NamespacesAuthorizationRule), + new(servicebus_v20221001p.NamespacesQueue), + new(servicebus_v20221001p.NamespacesTopic), + new(servicebus_v20221001p.NamespacesTopicsSubscription), + new(servicebus_v20221001p.NamespacesTopicsSubscriptionsRule)) + result = append( + result, + new(servicebus_v20221001ps.Namespace), + new(servicebus_v20221001ps.NamespacesAuthorizationRule), + new(servicebus_v20221001ps.NamespacesQueue), + new(servicebus_v20221001ps.NamespacesTopic), + new(servicebus_v20221001ps.NamespacesTopicsSubscription), + new(servicebus_v20221001ps.NamespacesTopicsSubscriptionsRule)) result = append(result, new(signalrservice_v1beta20211001.SignalR)) result = append(result, new(signalrservice_v1beta20211001s.SignalR)) result = append(result, new(signalrservice_v20211001.SignalR)) @@ -1676,6 +1712,10 @@ func createScheme() *runtime.Scheme { _ = servicebus_v1beta20210101ps.AddToScheme(scheme) _ = servicebus_v20210101p.AddToScheme(scheme) _ = servicebus_v20210101ps.AddToScheme(scheme) + _ = servicebus_v20211101.AddToScheme(scheme) + _ = servicebus_v20211101s.AddToScheme(scheme) + _ = servicebus_v20221001p.AddToScheme(scheme) + _ = servicebus_v20221001ps.AddToScheme(scheme) _ = signalrservice_v1beta20211001.AddToScheme(scheme) _ = signalrservice_v1beta20211001s.AddToScheme(scheme) _ = signalrservice_v20211001.AddToScheme(scheme) diff --git a/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20210101preview_test.go b/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20210101preview_test.go new file mode 100644 index 00000000000..c0b05fb7ca1 --- /dev/null +++ b/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20210101preview_test.go @@ -0,0 +1,110 @@ +/* +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" + + servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview" + "github.com/Azure/azure-service-operator/v2/internal/testcommon" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" +) + +func Test_ServiceBus_Namespace_Basic_v1api20210101preview_CRUD(t *testing.T) { + t.Parallel() + + tc := globalTestContext.ForTest(t) + + rg := tc.CreateTestResourceGroupAndWait() + + sku := servicebus.SBSku_Name_Basic + namespace := NewServiceBusNamespace_v1api20210101preview(tc, rg, sku) + + tc.CreateResourceAndWait(namespace) + + tc.Expect(namespace.Status.Id).ToNot(BeNil()) + armId := *namespace.Status.Id + + tc.RunParallelSubtests( + testcommon.Subtest{ + Name: "Queue CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_Queue_v1api20210101preview_CRUD(tc, namespace) + }, + }, + testcommon.Subtest{ + Name: "Namespace secrets", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_Namespace_Secrets_v1api20210101preview(tc, namespace) + }, + }, + ) + + tc.DeleteResourceAndWait(namespace) + + // Ensure that the resource was really deleted in Azure + tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) +} + +func ServiceBus_Queue_v1api20210101preview_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { + queue := &servicebus.NamespacesQueue{ + ObjectMeta: tc.MakeObjectMeta("queue"), + Spec: servicebus.Namespaces_Queue_Spec{ + Owner: testcommon.AsOwner(sbNamespace), + }, + } + + tc.CreateResourceAndWait(queue) + defer tc.DeleteResourceAndWait(queue) + + tc.Expect(queue.Status.Id).ToNot(BeNil()) + + // a basic assertion on a property + tc.Expect(queue.Status.SizeInBytes).ToNot(BeNil()) + tc.Expect(*queue.Status.SizeInBytes).To(Equal(0)) +} + +func ServiceBus_Namespace_Secrets_v1api20210101preview(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { + namespace := sbNamespace.(*servicebus.Namespace) + secretName := "namespace-secrets-20210101preview" + + old := namespace.DeepCopy() + + if namespace.Spec.OperatorSpec == nil { + namespace.Spec.OperatorSpec = &servicebus.NamespaceOperatorSpec{} + } + + namespace.Spec.OperatorSpec.Secrets = &servicebus.NamespaceOperatorSecrets{ + Endpoint: &genruntime.SecretDestination{ + Name: secretName, + Key: "Endpoint", + }, + PrimaryKey: &genruntime.SecretDestination{ + Name: secretName, + Key: "PrimaryKey", + }, + PrimaryConnectionString: &genruntime.SecretDestination{ + Name: secretName, + Key: "PrimaryConnectionString", + }, + SecondaryKey: &genruntime.SecretDestination{ + Name: secretName, + Key: "SecondaryKey", + }, + SecondaryConnectionString: &genruntime.SecretDestination{ + Name: secretName, + Key: "SecondaryConnectionString", + }, + } + + tc.PatchResourceAndWait(old, namespace) + + tc.UpdateResource(namespace) + tc.ExpectSecretHasKeys(secretName, "Endpoint", "PrimaryKey", "PrimaryConnectionString", "SecondaryKey", "SecondaryConnectionString") +} diff --git a/v2/internal/controllers/crd_servicebus_namespace_basic_test.go b/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20211101_test.go similarity index 82% rename from v2/internal/controllers/crd_servicebus_namespace_basic_test.go rename to v2/internal/controllers/crd_servicebus_namespace_basic_v1api20211101_test.go index 16d002c673f..aee886ea23b 100644 --- a/v2/internal/controllers/crd_servicebus_namespace_basic_test.go +++ b/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20211101_test.go @@ -11,12 +11,12 @@ import ( . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/client" - servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview" + servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101" "github.com/Azure/azure-service-operator/v2/internal/testcommon" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) -func Test_ServiceBus_Namespace_Basic_CRUD(t *testing.T) { +func Test_ServiceBus_Namespace_Basic_v1api20211101_CRUD(t *testing.T) { t.Parallel() tc := globalTestContext.ForTest(t) @@ -24,7 +24,7 @@ func Test_ServiceBus_Namespace_Basic_CRUD(t *testing.T) { rg := tc.CreateTestResourceGroupAndWait() sku := servicebus.SBSku_Name_Basic - namespace := NewServiceBusNamespace(tc, rg, sku) + namespace := NewServiceBusNamespace_v1api20211101(tc, rg, sku) tc.CreateResourceAndWait(namespace) @@ -35,12 +35,12 @@ func Test_ServiceBus_Namespace_Basic_CRUD(t *testing.T) { testcommon.Subtest{ Name: "Queue CRUD", Test: func(tc *testcommon.KubePerTestContext) { - ServiceBus_Queue_CRUD(tc, namespace) + ServiceBus_Queue_v1api20211101_CRUD(tc, namespace) }, }, testcommon.Subtest{ Name: "Namespace secrets", - Test: func(tc *testcommon.KubePerTestContext) { ServiceBus_Namespace_Secrets(tc, namespace) }, + Test: func(tc *testcommon.KubePerTestContext) { ServiceBus_Namespace_Secrets_v1api20211101(tc, namespace) }, }, ) @@ -50,7 +50,7 @@ func Test_ServiceBus_Namespace_Basic_CRUD(t *testing.T) { tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) } -func ServiceBus_Queue_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { +func ServiceBus_Queue_v1api20211101_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { queue := &servicebus.NamespacesQueue{ ObjectMeta: tc.MakeObjectMeta("queue"), Spec: servicebus.Namespaces_Queue_Spec{ @@ -68,9 +68,9 @@ func ServiceBus_Queue_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client tc.Expect(*queue.Status.SizeInBytes).To(Equal(0)) } -func ServiceBus_Namespace_Secrets(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { +func ServiceBus_Namespace_Secrets_v1api20211101(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { namespace := sbNamespace.(*servicebus.Namespace) - secretName := "namespace-secrets" + secretName := "namespace-secrets-20211101" old := namespace.DeepCopy() diff --git a/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20221001preview_test.go b/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20221001preview_test.go new file mode 100644 index 00000000000..03813eac2c4 --- /dev/null +++ b/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20221001preview_test.go @@ -0,0 +1,110 @@ +/* +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" + + servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" + "github.com/Azure/azure-service-operator/v2/internal/testcommon" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" +) + +func Test_ServiceBus_Namespace_Basic_v1api20221001preview_CRUD(t *testing.T) { + t.Parallel() + + tc := globalTestContext.ForTest(t) + + rg := tc.CreateTestResourceGroupAndWait() + + sku := servicebus.SBSku_Name_Basic + namespace := NewServiceBusNamespace_v1api20221001preview(tc, rg, sku) + + tc.CreateResourceAndWait(namespace) + + tc.Expect(namespace.Status.Id).ToNot(BeNil()) + armId := *namespace.Status.Id + + tc.RunParallelSubtests( + testcommon.Subtest{ + Name: "Queue CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_NamespacesQueue_v1api20221001preview_CRUD(tc, namespace) + }, + }, + testcommon.Subtest{ + Name: "Namespace secrets", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_Namespace_Secrets_v1api20221001preview(tc, namespace) + }, + }, + ) + + tc.DeleteResourceAndWait(namespace) + + // Ensure that the resource was really deleted in Azure + tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) +} + +func ServiceBus_NamespacesQueue_v1api20221001preview_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { + queue := &servicebus.NamespacesQueue{ + ObjectMeta: tc.MakeObjectMeta("queue"), + Spec: servicebus.Namespaces_Queue_Spec{ + Owner: testcommon.AsOwner(sbNamespace), + }, + } + + tc.CreateResourceAndWait(queue) + defer tc.DeleteResourceAndWait(queue) + + tc.Expect(queue.Status.Id).ToNot(BeNil()) + + // a basic assertion on a property + tc.Expect(queue.Status.SizeInBytes).ToNot(BeNil()) + tc.Expect(*queue.Status.SizeInBytes).To(Equal(0)) +} + +func ServiceBus_Namespace_Secrets_v1api20221001preview(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { + namespace := sbNamespace.(*servicebus.Namespace) + secretName := "namespace-secrets-20221001preview" + + old := namespace.DeepCopy() + + if namespace.Spec.OperatorSpec == nil { + namespace.Spec.OperatorSpec = &servicebus.NamespaceOperatorSpec{} + } + + namespace.Spec.OperatorSpec.Secrets = &servicebus.NamespaceOperatorSecrets{ + Endpoint: &genruntime.SecretDestination{ + Name: secretName, + Key: "Endpoint", + }, + PrimaryKey: &genruntime.SecretDestination{ + Name: secretName, + Key: "PrimaryKey", + }, + PrimaryConnectionString: &genruntime.SecretDestination{ + Name: secretName, + Key: "PrimaryConnectionString", + }, + SecondaryKey: &genruntime.SecretDestination{ + Name: secretName, + Key: "SecondaryKey", + }, + SecondaryConnectionString: &genruntime.SecretDestination{ + Name: secretName, + Key: "SecondaryConnectionString", + }, + } + + tc.PatchResourceAndWait(old, namespace) + + tc.UpdateResource(namespace) + tc.ExpectSecretHasKeys(secretName, "Endpoint", "PrimaryKey", "PrimaryConnectionString", "SecondaryKey", "SecondaryConnectionString") +} diff --git a/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20210101preview_test.go b/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20210101preview_test.go new file mode 100644 index 00000000000..813e624da1f --- /dev/null +++ b/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20210101preview_test.go @@ -0,0 +1,197 @@ +/* +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" + + resources "github.com/Azure/azure-service-operator/v2/api/resources/v1api20200601" + servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview" + "github.com/Azure/azure-service-operator/v2/internal/testcommon" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" +) + +func Test_ServiceBus_Namespace_Standard_v1api20210101preview_CRUD(t *testing.T) { + t.Parallel() + + tc := globalTestContext.ForTest(t) + + rg := tc.CreateTestResourceGroupAndWait() + + sku := servicebus.SBSku_Name_Standard + namespace := NewServiceBusNamespace_v1api20210101preview(tc, rg, sku) + + tc.CreateResourceAndWait(namespace) + + tc.Expect(namespace.Status.Id).ToNot(BeNil()) + armId := *namespace.Status.Id + + tc.RunParallelSubtests( + testcommon.Subtest{ + Name: "Queue CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_Queue_v1api20210101preview_CRUD(tc, namespace) + }, + }, + testcommon.Subtest{ + Name: "Topic CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_NamespacesTopic_v1api20210101preview_CRUD(tc, namespace) + }, + }, + testcommon.Subtest{ + Name: "AuthorizationRule CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_NamespacesAuthorizationRule_v1api20210101preview_CRUD(tc, namespace) + }, + }, + testcommon.Subtest{ + Name: "NamespaceSecrets CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_Namespace_Secrets_v1api20210101preview(tc, namespace) + }, + }, + ) + + tc.DeleteResourceAndWait(namespace) + + // Ensure that the resource was really deleted in Azure + tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) +} + +func NewServiceBusNamespace_v1api20210101preview(tc *testcommon.KubePerTestContext, rg *resources.ResourceGroup, sku servicebus.SBSku_Name) *servicebus.Namespace { + zoneRedundant := false + namespace := &servicebus.Namespace{ + ObjectMeta: tc.MakeObjectMetaWithName(tc.Namer.GenerateName("namespace")), + Spec: servicebus.Namespace_Spec{ + Location: tc.AzureRegion, + Owner: testcommon.AsOwner(rg), + Sku: &servicebus.SBSku{ + Name: &sku, + }, + ZoneRedundant: &zoneRedundant, + }, + } + return namespace +} + +func ServiceBus_NamespacesAuthorizationRule_v1api20210101preview_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { + secretName := "rule-secrets" + + rule := &servicebus.NamespacesAuthorizationRule{ + ObjectMeta: tc.MakeObjectMetaWithName(tc.Namer.GenerateName("rule")), + Spec: servicebus.Namespaces_AuthorizationRule_Spec{ + Owner: testcommon.AsOwner(sbNamespace), + Rights: []servicebus.Namespaces_AuthorizationRule_Properties_Rights_Spec{ + servicebus.Namespaces_AuthorizationRule_Properties_Rights_Spec_Listen, + servicebus.Namespaces_AuthorizationRule_Properties_Rights_Spec_Send, + }, + OperatorSpec: &servicebus.NamespacesAuthorizationRuleOperatorSpec{ + Secrets: &servicebus.NamespacesAuthorizationRuleOperatorSecrets{ + PrimaryKey: &genruntime.SecretDestination{ + Name: secretName, + Key: "PrimaryKey", + }, + PrimaryConnectionString: &genruntime.SecretDestination{ + Name: secretName, + Key: "PrimaryConnectionString", + }, + SecondaryKey: &genruntime.SecretDestination{ + Name: secretName, + Key: "SecondaryKey", + }, + SecondaryConnectionString: &genruntime.SecretDestination{ + Name: secretName, + Key: "SecondaryConnectionString", + }, + }, + }, + }, + } + + tc.CreateResourceAndWait(rule) + defer tc.DeleteResourceAndWait(rule) + + tc.Expect(rule.Status.Rights).To(HaveLen(2)) + + tc.ExpectSecretHasKeys(secretName, "PrimaryKey", "PrimaryConnectionString", "SecondaryKey", "SecondaryConnectionString") +} + +// Topics can only be created in Standard or Premium SKUs +func ServiceBus_NamespacesTopic_v1api20210101preview_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { + topic := &servicebus.NamespacesTopic{ + ObjectMeta: tc.MakeObjectMeta("topic"), + Spec: servicebus.Namespaces_Topic_Spec{ + Owner: testcommon.AsOwner(sbNamespace), + }, + } + + tc.CreateResourceAndWait(topic) + defer tc.DeleteResourceAndWait(topic) + + tc.Expect(topic.Status.Id).ToNot(BeNil()) + + // a basic assertion on a property + tc.Expect(topic.Status.SizeInBytes).ToNot(BeNil()) + tc.Expect(*topic.Status.SizeInBytes).To(Equal(0)) + + tc.RunParallelSubtests( + testcommon.Subtest{ + Name: "Subscription CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_NamespacesTopicsSubscription_v1api20210101preview_CRUD(tc, topic) + }, + }, + ) +} + +func ServiceBus_NamespacesTopicsSubscription_v1api20210101preview_CRUD(tc *testcommon.KubePerTestContext, sbTopic client.Object) { + subscription := &servicebus.NamespacesTopicsSubscription{ + ObjectMeta: tc.MakeObjectMeta("subscription"), + Spec: servicebus.Namespaces_Topics_Subscription_Spec{ + Owner: testcommon.AsOwner(sbTopic), + }, + } + + tc.CreateResourceAndWait(subscription) + + tc.Expect(subscription.Status.Id).ToNot(BeNil()) + armId := *subscription.Status.Id + + tc.RunParallelSubtests( + testcommon.Subtest{ + Name: "SubscriptionsRule CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_NamespacesTopicsSubscriptionsRule_v1api20210101preview_CRUD(tc, subscription) + }, + }, + ) + + tc.DeleteResourceAndWait(subscription) + // Ensure that the resource was really deleted in Azure + tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) +} + +func ServiceBus_NamespacesTopicsSubscriptionsRule_v1api20210101preview_CRUD(tc *testcommon.KubePerTestContext, sbSubscription client.Object) { + rule := &servicebus.NamespacesTopicsSubscriptionsRule{ + ObjectMeta: tc.MakeObjectMeta("subrule"), + Spec: servicebus.Namespaces_Topics_Subscriptions_Rule_Spec{ + Owner: testcommon.AsOwner(sbSubscription), + }, + } + + tc.CreateResourceAndWait(rule) + + tc.Expect(rule.Status.Id).ToNot(BeNil()) + armId := *rule.Status.Id + + tc.DeleteResourceAndWait(rule) + // Ensure that the resource was really deleted in Azure + tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) +} diff --git a/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20211101_test.go b/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20211101_test.go new file mode 100644 index 00000000000..14f9b063cc1 --- /dev/null +++ b/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20211101_test.go @@ -0,0 +1,197 @@ +/* +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" + + resources "github.com/Azure/azure-service-operator/v2/api/resources/v1api20200601" + servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101" + "github.com/Azure/azure-service-operator/v2/internal/testcommon" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" +) + +func Test_ServiceBus_Namespace_Standard_v1api20211101_CRUD(t *testing.T) { + t.Parallel() + + tc := globalTestContext.ForTest(t) + + rg := tc.CreateTestResourceGroupAndWait() + + sku := servicebus.SBSku_Name_Standard + namespace := NewServiceBusNamespace_v1api20211101(tc, rg, sku) + + tc.CreateResourceAndWait(namespace) + + tc.Expect(namespace.Status.Id).ToNot(BeNil()) + armId := *namespace.Status.Id + + tc.RunParallelSubtests( + testcommon.Subtest{ + Name: "Queue CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_Queue_v1api20211101_CRUD(tc, namespace) + }, + }, + testcommon.Subtest{ + Name: "Topic CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_NamespacesTopic_v1api20211101_CRUD(tc, namespace) + }, + }, + testcommon.Subtest{ + Name: "AuthorizationRule CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_NamespacesAuthorizationRule_v1api20211101_CRUD(tc, namespace) + }, + }, + testcommon.Subtest{ + Name: "NamespaceSecrets CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_Namespace_Secrets_v1api20211101(tc, namespace) + }, + }, + ) + + tc.DeleteResourceAndWait(namespace) + + // Ensure that the resource was really deleted in Azure + tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) +} + +func NewServiceBusNamespace_v1api20211101(tc *testcommon.KubePerTestContext, rg *resources.ResourceGroup, sku servicebus.SBSku_Name) *servicebus.Namespace { + zoneRedundant := false + namespace := &servicebus.Namespace{ + ObjectMeta: tc.MakeObjectMetaWithName(tc.Namer.GenerateName("namespace")), + Spec: servicebus.Namespace_Spec{ + Location: tc.AzureRegion, + Owner: testcommon.AsOwner(rg), + Sku: &servicebus.SBSku{ + Name: &sku, + }, + ZoneRedundant: &zoneRedundant, + }, + } + return namespace +} + +func ServiceBus_NamespacesAuthorizationRule_v1api20211101_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { + secretName := "rule-secrets" + + rule := &servicebus.NamespacesAuthorizationRule{ + ObjectMeta: tc.MakeObjectMetaWithName(tc.Namer.GenerateName("rule")), + Spec: servicebus.Namespaces_AuthorizationRule_Spec{ + Owner: testcommon.AsOwner(sbNamespace), + Rights: []servicebus.Namespaces_AuthorizationRule_Properties_Rights_Spec{ + servicebus.Namespaces_AuthorizationRule_Properties_Rights_Spec_Listen, + servicebus.Namespaces_AuthorizationRule_Properties_Rights_Spec_Send, + }, + OperatorSpec: &servicebus.NamespacesAuthorizationRuleOperatorSpec{ + Secrets: &servicebus.NamespacesAuthorizationRuleOperatorSecrets{ + PrimaryKey: &genruntime.SecretDestination{ + Name: secretName, + Key: "PrimaryKey", + }, + PrimaryConnectionString: &genruntime.SecretDestination{ + Name: secretName, + Key: "PrimaryConnectionString", + }, + SecondaryKey: &genruntime.SecretDestination{ + Name: secretName, + Key: "SecondaryKey", + }, + SecondaryConnectionString: &genruntime.SecretDestination{ + Name: secretName, + Key: "SecondaryConnectionString", + }, + }, + }, + }, + } + + tc.CreateResourceAndWait(rule) + defer tc.DeleteResourceAndWait(rule) + + tc.Expect(rule.Status.Rights).To(HaveLen(2)) + + tc.ExpectSecretHasKeys(secretName, "PrimaryKey", "PrimaryConnectionString", "SecondaryKey", "SecondaryConnectionString") +} + +// Topics can only be created in Standard or Premium SKUs +func ServiceBus_NamespacesTopic_v1api20211101_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { + topic := &servicebus.NamespacesTopic{ + ObjectMeta: tc.MakeObjectMeta("topic"), + Spec: servicebus.Namespaces_Topic_Spec{ + Owner: testcommon.AsOwner(sbNamespace), + }, + } + + tc.CreateResourceAndWait(topic) + defer tc.DeleteResourceAndWait(topic) + + tc.Expect(topic.Status.Id).ToNot(BeNil()) + + // a basic assertion on a property + tc.Expect(topic.Status.SizeInBytes).ToNot(BeNil()) + tc.Expect(*topic.Status.SizeInBytes).To(Equal(0)) + + tc.RunParallelSubtests( + testcommon.Subtest{ + Name: "Subscription CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_NamespacesTopicsSubscription_v1api20211101_CRUD(tc, topic) + }, + }, + ) +} + +func ServiceBus_NamespacesTopicsSubscription_v1api20211101_CRUD(tc *testcommon.KubePerTestContext, sbTopic client.Object) { + subscription := &servicebus.NamespacesTopicsSubscription{ + ObjectMeta: tc.MakeObjectMeta("subscription"), + Spec: servicebus.Namespaces_Topics_Subscription_Spec{ + Owner: testcommon.AsOwner(sbTopic), + }, + } + + tc.CreateResourceAndWait(subscription) + + tc.Expect(subscription.Status.Id).ToNot(BeNil()) + armId := *subscription.Status.Id + + tc.RunParallelSubtests( + testcommon.Subtest{ + Name: "SubscriptionsRule CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_NamespacesTopicsSubscriptionsRule_v1api20211101_CRUD(tc, subscription) + }, + }, + ) + + tc.DeleteResourceAndWait(subscription) + // Ensure that the resource was really deleted in Azure + tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) +} + +func ServiceBus_NamespacesTopicsSubscriptionsRule_v1api20211101_CRUD(tc *testcommon.KubePerTestContext, sbSubscription client.Object) { + rule := &servicebus.NamespacesTopicsSubscriptionsRule{ + ObjectMeta: tc.MakeObjectMeta("subrule"), + Spec: servicebus.Namespaces_Topics_Subscriptions_Rule_Spec{ + Owner: testcommon.AsOwner(sbSubscription), + }, + } + + tc.CreateResourceAndWait(rule) + + tc.Expect(rule.Status.Id).ToNot(BeNil()) + armId := *rule.Status.Id + + tc.DeleteResourceAndWait(rule) + // Ensure that the resource was really deleted in Azure + tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) +} diff --git a/v2/internal/controllers/crd_servicebus_namespace_standard_test.go b/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20221001preview_test.go similarity index 75% rename from v2/internal/controllers/crd_servicebus_namespace_standard_test.go rename to v2/internal/controllers/crd_servicebus_namespace_standard_v1api20221001preview_test.go index 8acc7e63c81..3d68f60903f 100644 --- a/v2/internal/controllers/crd_servicebus_namespace_standard_test.go +++ b/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20221001preview_test.go @@ -12,12 +12,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" resources "github.com/Azure/azure-service-operator/v2/api/resources/v1api20200601" - servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview" + servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" "github.com/Azure/azure-service-operator/v2/internal/testcommon" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) -func Test_ServiceBus_Namespace_Standard_CRUD(t *testing.T) { +func Test_ServiceBus_Namespace_Standard_v1api20221001preview_CRUD(t *testing.T) { t.Parallel() tc := globalTestContext.ForTest(t) @@ -25,7 +25,7 @@ func Test_ServiceBus_Namespace_Standard_CRUD(t *testing.T) { rg := tc.CreateTestResourceGroupAndWait() sku := servicebus.SBSku_Name_Standard - namespace := NewServiceBusNamespace(tc, rg, sku) + namespace := NewServiceBusNamespace_v1api20221001preview(tc, rg, sku) tc.CreateResourceAndWait(namespace) @@ -35,19 +35,27 @@ func Test_ServiceBus_Namespace_Standard_CRUD(t *testing.T) { tc.RunParallelSubtests( testcommon.Subtest{ Name: "Queue CRUD", - Test: func(tc *testcommon.KubePerTestContext) { ServiceBus_Queue_CRUD(tc, namespace) }, + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_NamespacesQueue_v1api20221001preview_CRUD(tc, namespace) + }, }, testcommon.Subtest{ Name: "Topic CRUD", - Test: func(tc *testcommon.KubePerTestContext) { ServiceBus_Topic_CRUD(tc, namespace) }, + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_Topic_v1api20221001preview_CRUD(tc, namespace) + }, }, testcommon.Subtest{ Name: "AuthorizationRule CRUD", - Test: func(tc *testcommon.KubePerTestContext) { ServiceBus_AuthorizationRule_CRUD(tc, namespace) }, + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_AuthorizationRule_v1api20221001preview_CRUD(tc, namespace) + }, }, testcommon.Subtest{ Name: "NamespaceSecrets CRUD", - Test: func(tc *testcommon.KubePerTestContext) { ServiceBus_Namespace_Secrets(tc, namespace) }, + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_Namespace_Secrets_v1api20221001preview(tc, namespace) + }, }, ) @@ -57,7 +65,7 @@ func Test_ServiceBus_Namespace_Standard_CRUD(t *testing.T) { tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) } -func NewServiceBusNamespace(tc *testcommon.KubePerTestContext, rg *resources.ResourceGroup, sku servicebus.SBSku_Name) *servicebus.Namespace { +func NewServiceBusNamespace_v1api20221001preview(tc *testcommon.KubePerTestContext, rg *resources.ResourceGroup, sku servicebus.SBSku_Name) *servicebus.Namespace { zoneRedundant := false namespace := &servicebus.Namespace{ ObjectMeta: tc.MakeObjectMetaWithName(tc.Namer.GenerateName("namespace")), @@ -73,7 +81,7 @@ func NewServiceBusNamespace(tc *testcommon.KubePerTestContext, rg *resources.Res return namespace } -func ServiceBus_AuthorizationRule_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { +func ServiceBus_AuthorizationRule_v1api20221001preview_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { secretName := "rule-secrets" rule := &servicebus.NamespacesAuthorizationRule{ @@ -116,7 +124,7 @@ func ServiceBus_AuthorizationRule_CRUD(tc *testcommon.KubePerTestContext, sbName } // Topics can only be created in Standard or Premium SKUs -func ServiceBus_Topic_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { +func ServiceBus_Topic_v1api20221001preview_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { topic := &servicebus.NamespacesTopic{ ObjectMeta: tc.MakeObjectMeta("topic"), Spec: servicebus.Namespaces_Topic_Spec{ @@ -136,12 +144,12 @@ func ServiceBus_Topic_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client tc.RunParallelSubtests( testcommon.Subtest{ Name: "Subscription CRUD", - Test: func(tc *testcommon.KubePerTestContext) { ServiceBus_Subscription_CRUD(tc, topic) }, + Test: func(tc *testcommon.KubePerTestContext) { ServiceBus_Subscription_v1api20221001preview_CRUD(tc, topic) }, }, ) } -func ServiceBus_Subscription_CRUD(tc *testcommon.KubePerTestContext, sbTopic client.Object) { +func ServiceBus_Subscription_v1api20221001preview_CRUD(tc *testcommon.KubePerTestContext, sbTopic client.Object) { subscription := &servicebus.NamespacesTopicsSubscription{ ObjectMeta: tc.MakeObjectMeta("subscription"), Spec: servicebus.Namespaces_Topics_Subscription_Spec{ @@ -157,7 +165,9 @@ func ServiceBus_Subscription_CRUD(tc *testcommon.KubePerTestContext, sbTopic cli tc.RunParallelSubtests( testcommon.Subtest{ Name: "SubscriptionsRule CRUD", - Test: func(tc *testcommon.KubePerTestContext) { ServiceBus_Subscriptions_Rule_CRUD(tc, subscription) }, + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_Subscriptions_Rule_v1api20221001preview_CRUD(tc, subscription) + }, }, ) @@ -166,7 +176,7 @@ func ServiceBus_Subscription_CRUD(tc *testcommon.KubePerTestContext, sbTopic cli tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) } -func ServiceBus_Subscriptions_Rule_CRUD(tc *testcommon.KubePerTestContext, sbSubscription client.Object) { +func ServiceBus_Subscriptions_Rule_v1api20221001preview_CRUD(tc *testcommon.KubePerTestContext, sbSubscription client.Object) { rule := &servicebus.NamespacesTopicsSubscriptionsRule{ ObjectMeta: tc.MakeObjectMeta("subrule"), Spec: servicebus.Namespaces_Topics_Subscriptions_Rule_Spec{ diff --git a/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api_CreationAndDeletion.yaml b/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api20210101preview_CreationAndDeletion.yaml similarity index 74% rename from v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api_CreationAndDeletion.yaml rename to v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api20210101preview_CreationAndDeletion.yaml index a206f7d6799..defea35478e 100644 --- a/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api_CreationAndDeletion.yaml +++ b/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api20210101preview_CreationAndDeletion.yaml @@ -2,7 +2,7 @@ version: 1 interactions: - request: - body: '{"location":"westus2","name":"asotest-rg-cepajg","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' + body: '{"location":"westus2","name":"asotest-rg-bwxmby","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' form: {} headers: Accept: @@ -13,10 +13,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby?api-version=2020-06-01 method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg","name":"asotest-rg-cepajg","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby","name":"asotest-rg-bwxmby","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' headers: Cache-Control: - no-cache @@ -43,10 +43,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby?api-version=2020-06-01 method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg","name":"asotest-rg-cepajg","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby","name":"asotest-rg-bwxmby","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' headers: Cache-Control: - no-cache @@ -66,7 +66,7 @@ interactions: code: 200 duration: "" - request: - body: '{"location":"westcentralus","name":"asotestyfontb","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' + body: '{"location":"westcentralus","name":"asotesthzpbpj","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' form: {} headers: Accept: @@ -77,11 +77,11 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj?api-version=2021-01-01-preview method: PUT response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb","name":"asotestyfontb","type":"Microsoft.ServiceBus/Namespaces","location":"West - Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestyfontb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyfontb.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj","name":"asotesthzpbpj","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotesthzpbpj","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotesthzpbpj.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -111,11 +111,11 @@ interactions: headers: Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb","name":"asotestyfontb","type":"Microsoft.ServiceBus/Namespaces","location":"West - Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestyfontb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyfontb.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj","name":"asotesthzpbpj","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotesthzpbpj","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotesthzpbpj.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -145,11 +145,11 @@ interactions: headers: Test-Request-Attempt: - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb","name":"asotestyfontb","type":"Microsoft.ServiceBus/Namespaces","location":"West - Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestyfontb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyfontb.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj","name":"asotesthzpbpj","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotesthzpbpj","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotesthzpbpj.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -179,11 +179,11 @@ interactions: headers: Test-Request-Attempt: - "2" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb","name":"asotestyfontb","type":"Microsoft.ServiceBus/Namespaces","location":"West - Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestyfontb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyfontb.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj","name":"asotesthzpbpj","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotesthzpbpj","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotesthzpbpj.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -213,11 +213,11 @@ interactions: headers: Test-Request-Attempt: - "3" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb","name":"asotestyfontb","type":"Microsoft.ServiceBus/Namespaces","location":"West - Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestyfontb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyfontb.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj","name":"asotesthzpbpj","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotesthzpbpj","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotesthzpbpj.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -247,11 +247,11 @@ interactions: headers: Test-Request-Attempt: - "4" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb","name":"asotestyfontb","type":"Microsoft.ServiceBus/Namespaces","location":"West - Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestyfontb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyfontb.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj","name":"asotesthzpbpj","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotesthzpbpj","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotesthzpbpj.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -281,11 +281,11 @@ interactions: headers: Test-Request-Attempt: - "5" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb","name":"asotestyfontb","type":"Microsoft.ServiceBus/Namespaces","location":"West - Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotestyfontb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyfontb.servicebus.windows.net:443/","status":"Active"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj","name":"asotesthzpbpj","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotesthzpbpj","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotesthzpbpj.servicebus.windows.net:443/","status":"Active"}}' headers: Cache-Control: - no-cache @@ -317,11 +317,11 @@ interactions: - application/json Test-Request-Attempt: - "6" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb","name":"asotestyfontb","type":"Microsoft.ServiceBus/Namespaces","location":"West - Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotestyfontb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyfontb.servicebus.windows.net:443/","status":"Active"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj","name":"asotesthzpbpj","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotesthzpbpj","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotesthzpbpj.servicebus.windows.net:443/","status":"Active"}}' headers: Cache-Control: - no-cache @@ -346,7 +346,7 @@ interactions: code: 200 duration: "" - request: - body: '{"name":"asotestlqpkst"}' + body: '{"name":"asotestgadbkx"}' form: {} headers: Accept: @@ -357,10 +357,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/queues/asotestlqpkst?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx?api-version=2021-01-01-preview method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/queues/asotestlqpkst","name":"asotestlqpkst","type":"Microsoft.ServiceBus/namespaces/queues","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx","name":"asotestgadbkx","type":"Microsoft.ServiceBus/namespaces/topics","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}' headers: Cache-Control: - no-cache @@ -382,7 +382,7 @@ interactions: code: 200 duration: "" - request: - body: '{"name":"asotestbtgszj"}' + body: '{"name":"asotestwurheb"}' form: {} headers: Accept: @@ -393,10 +393,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/queues/asotestwurheb?api-version=2021-01-01-preview method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj","name":"asotestbtgszj","type":"Microsoft.ServiceBus/namespaces/topics","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/queues/asotestwurheb","name":"asotestwurheb","type":"Microsoft.ServiceBus/namespaces/queues","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00"}}' headers: Cache-Control: - no-cache @@ -425,10 +425,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/queues/asotestlqpkst?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx?api-version=2021-01-01-preview method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/queues/asotestlqpkst","name":"asotestlqpkst","type":"Microsoft.ServiceBus/namespaces/queues","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx","name":"asotestgadbkx","type":"Microsoft.ServiceBus/namespaces/topics","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}' headers: Cache-Control: - no-cache @@ -457,10 +457,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/queues/asotestwurheb?api-version=2021-01-01-preview method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj","name":"asotestbtgszj","type":"Microsoft.ServiceBus/namespaces/topics","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/queues/asotestwurheb","name":"asotestwurheb","type":"Microsoft.ServiceBus/namespaces/queues","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z"}}' headers: Cache-Control: - no-cache @@ -482,7 +482,7 @@ interactions: code: 200 duration: "" - request: - body: '{"name":"asotestygoyha","properties":{"rights":["Listen","Send"]}}' + body: '{"name":"asotestymtocl","properties":{"rights":["Listen","Send"]}}' form: {} headers: Accept: @@ -493,10 +493,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/AuthorizationRules/asotestygoyha?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/AuthorizationRules/asotestymtocl?api-version=2021-01-01-preview method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/AuthorizationRules/asotestygoyha","name":"asotestygoyha","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"westcentralus","properties":{"rights":["Listen","Send"]}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/AuthorizationRules/asotestymtocl","name":"asotestymtocl","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"westcentralus","properties":{"rights":["Listen","Send"]}}' headers: Cache-Control: - no-cache @@ -525,10 +525,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/AuthorizationRules/asotestygoyha?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/AuthorizationRules/asotestymtocl?api-version=2021-01-01-preview method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/authorizationrules/asotestygoyha","name":"asotestygoyha","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"westcentralus","properties":{"rights":["Listen","Send"]}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/authorizationrules/asotestymtocl","name":"asotestymtocl","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"westcentralus","properties":{"rights":["Listen","Send"]}}' headers: Cache-Control: - no-cache @@ -557,10 +557,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/AuthorizationRules/asotestygoyha/listKeys?api-version=2021-11-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/AuthorizationRules/asotestymtocl/listKeys?api-version=2021-11-01 method: POST response: - body: '{"primaryConnectionString":"Endpoint=sb://asotestyfontb.servicebus.windows.net/;SharedAccessKeyName=asotestygoyha;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotestyfontb.servicebus.windows.net/;SharedAccessKeyName=asotestygoyha;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"asotestygoyha"}' + body: '{"primaryConnectionString":"Endpoint=sb://asotesthzpbpj.servicebus.windows.net/;SharedAccessKeyName=asotestymtocl;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotesthzpbpj.servicebus.windows.net/;SharedAccessKeyName=asotestymtocl;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"asotestymtocl"}' headers: Cache-Control: - no-cache @@ -582,7 +582,7 @@ interactions: code: 200 duration: "" - request: - body: '{"name":"asotesthjpbkz"}' + body: '{"name":"asotestojebhz"}' form: {} headers: Accept: @@ -593,10 +593,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj/subscriptions/asotesthjpbkz?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx/subscriptions/asotestojebhz?api-version=2021-01-01-preview method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj/subscriptions/asotesthjpbkz","name":"asotesthjpbkz","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westcentralus","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx/subscriptions/asotestojebhz","name":"asotestojebhz","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westcentralus","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' headers: Cache-Control: - no-cache @@ -625,10 +625,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj/subscriptions/asotesthjpbkz?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx/subscriptions/asotestojebhz?api-version=2021-01-01-preview method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj/subscriptions/asotesthjpbkz","name":"asotesthjpbkz","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westcentralus","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx/subscriptions/asotestojebhz","name":"asotestojebhz","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westcentralus","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' headers: Cache-Control: - no-cache @@ -650,7 +650,7 @@ interactions: code: 200 duration: "" - request: - body: '{"name":"asotestugzeeq","properties":{"action":{"compatibilityLevel":20,"requiresPreprocessing":false,"sqlExpression":"SET + body: '{"name":"asotestquccdd","properties":{"action":{"compatibilityLevel":20,"requiresPreprocessing":false,"sqlExpression":"SET myproperty=myvalue"},"correlationFilter":{"contentType":"text"},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"StoreId IN (''Store1'',''Store2'',''Store3'')"}}}' form: {} @@ -663,10 +663,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj/subscriptions/asotesthjpbkz/rules/asotestugzeeq?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx/subscriptions/asotestojebhz/rules/asotestquccdd?api-version=2021-01-01-preview method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj/subscriptions/asotesthjpbkz/rules/asotestugzeeq","name":"asotestugzeeq","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westcentralus","properties":{"action":{"sqlExpression":"SET + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx/subscriptions/asotestojebhz/rules/asotestquccdd","name":"asotestquccdd","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westcentralus","properties":{"action":{"sqlExpression":"SET myproperty=myvalue","compatibilityLevel":20},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"StoreId IN (''Store1'',''Store2'',''Store3'')","compatibilityLevel":20}}}' headers: @@ -697,10 +697,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj/subscriptions/asotesthjpbkz/rules/asotestugzeeq?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx/subscriptions/asotestojebhz/rules/asotestquccdd?api-version=2021-01-01-preview method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj/subscriptions/asotesthjpbkz/rules/asotestugzeeq","name":"asotestugzeeq","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westcentralus","properties":{"action":{"sqlExpression":"SET + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx/subscriptions/asotestojebhz/rules/asotestquccdd","name":"asotestquccdd","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westcentralus","properties":{"action":{"sqlExpression":"SET myproperty=myvalue","compatibilityLevel":20,"parameters":{}},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"StoreId IN (''Store1'',''Store2'',''Store3'')","compatibilityLevel":20,"parameters":{}}}}' headers: @@ -731,7 +731,7 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby?api-version=2020-06-01 method: DELETE response: body: "" @@ -743,7 +743,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRDRVBBSkctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRCV1hNQlktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -761,7 +761,7 @@ interactions: headers: Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRDRVBBSkctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRCV1hNQlktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" @@ -773,7 +773,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRDRVBBSkctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRCV1hNQlktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -791,7 +791,7 @@ interactions: headers: Test-Request-Attempt: - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRDRVBBSkctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRCV1hNQlktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" @@ -803,7 +803,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRDRVBBSkctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRCV1hNQlktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -821,7 +821,7 @@ interactions: headers: Test-Request-Attempt: - "2" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRDRVBBSkctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRCV1hNQlktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" @@ -833,7 +833,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRDRVBBSkctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRCV1hNQlktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -851,7 +851,7 @@ interactions: headers: Test-Request-Attempt: - "3" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRDRVBBSkctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRCV1hNQlktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" @@ -863,7 +863,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRDRVBBSkctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRCV1hNQlktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -881,7 +881,7 @@ interactions: headers: Test-Request-Attempt: - "4" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRDRVBBSkctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRCV1hNQlktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" @@ -909,10 +909,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj?api-version=2021-01-01-preview method: DELETE response: - body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-cepajg'' + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-bwxmby'' could not be found."}}' headers: Cache-Control: @@ -942,16 +942,18 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/queues/asotestlqpkst?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/AuthorizationRules/asotestymtocl?api-version=2021-01-01-preview method: DELETE response: - body: '{"error":{"code":"ParentResourceNotFound","message":"Can not perform requested - operation on nested resource. Parent resource ''asotestyfontb'' not found."}}' + 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-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj'' + could not be found."}}' headers: Cache-Control: - no-cache Content-Length: - - "154" + - "329" Content-Type: - application/json; charset=utf-8 Expires: @@ -975,16 +977,18 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx?api-version=2021-01-01-preview method: DELETE response: - body: '{"error":{"code":"ParentResourceNotFound","message":"Can not perform requested - operation on nested resource. Parent resource ''asotestyfontb'' not found."}}' + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform + ''delete'' on resource(s) of type ''namespaces/topics'', because the parent + resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj'' + could not be found."}}' headers: Cache-Control: - no-cache Content-Length: - - "154" + - "317" Content-Type: - application/json; charset=utf-8 Expires: @@ -1008,16 +1012,18 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/AuthorizationRules/asotestygoyha?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/queues/asotestwurheb?api-version=2021-01-01-preview method: DELETE response: - body: '{"error":{"code":"ParentResourceNotFound","message":"Can not perform requested - operation on nested resource. Parent resource ''asotestyfontb'' not found."}}' + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform + ''delete'' on resource(s) of type ''namespaces/queues'', because the parent + resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj'' + could not be found."}}' headers: Cache-Control: - no-cache Content-Length: - - "154" + - "317" Content-Type: - application/json; charset=utf-8 Expires: @@ -1041,17 +1047,18 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj/subscriptions/asotesthjpbkz?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx/subscriptions/asotestojebhz?api-version=2021-01-01-preview method: DELETE response: - body: '{"error":{"code":"ParentResourceNotFound","message":"Can not perform requested - operation on nested resource. Parent resource ''asotestyfontb/asotestbtgszj'' - not found."}}' + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform + ''delete'' on resource(s) of type ''namespaces/topics/subscriptions'', because + the parent resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx'' + could not be found."}}' headers: Cache-Control: - no-cache Content-Length: - - "168" + - "352" Content-Type: - application/json; charset=utf-8 Expires: @@ -1075,17 +1082,18 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cepajg/providers/Microsoft.ServiceBus/namespaces/asotestyfontb/topics/asotestbtgszj/subscriptions/asotesthjpbkz/rules/asotestugzeeq?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx/subscriptions/asotestojebhz/rules/asotestquccdd?api-version=2021-01-01-preview method: DELETE response: - body: '{"error":{"code":"ParentResourceNotFound","message":"Can not perform requested - operation on nested resource. Parent resource ''asotestyfontb/asotestbtgszj/asotesthjpbkz'' - not found."}}' + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform + ''delete'' on resource(s) of type ''namespaces/topics/subscriptions/rules'', + because the parent resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-bwxmby/providers/Microsoft.ServiceBus/namespaces/asotesthzpbpj/topics/asotestgadbkx/subscriptions/asotestojebhz'' + could not be found."}}' headers: Cache-Control: - no-cache Content-Length: - - "182" + - "386" Content-Type: - application/json; charset=utf-8 Expires: diff --git a/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api20211101_CreationAndDeletion.yaml b/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api20211101_CreationAndDeletion.yaml new file mode 100644 index 00000000000..12b06c57d45 --- /dev/null +++ b/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api20211101_CreationAndDeletion.yaml @@ -0,0 +1,1111 @@ +--- +version: 1 +interactions: +- request: + body: '{"location":"westus2","name":"asotest-rg-vwbpuo","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-vwbpuo?api-version=2020-06-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo","name":"asotest-rg-vwbpuo","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-vwbpuo?api-version=2020-06-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo","name":"asotest-rg-vwbpuo","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":"asotestedijsl","properties":{"disableLocalAuth":true,"zoneRedundant":false},"sku":{"name":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "138" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl?api-version=2021-11-01 + method: PUT + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl","name":"asotestedijsl","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"disableLocalAuth":true,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestedijsl","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestedijsl.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: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl","name":"asotestedijsl","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"disableLocalAuth":true,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestedijsl","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestedijsl.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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl","name":"asotestedijsl","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"disableLocalAuth":true,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestedijsl","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestedijsl.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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl","name":"asotestedijsl","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"disableLocalAuth":true,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestedijsl","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestedijsl.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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl","name":"asotestedijsl","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"disableLocalAuth":true,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestedijsl","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestedijsl.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: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl","name":"asotestedijsl","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"disableLocalAuth":true,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestedijsl","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestedijsl.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: + - "5" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl","name":"asotestedijsl","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"disableLocalAuth":true,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotestedijsl","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestedijsl.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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl","name":"asotestedijsl","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"disableLocalAuth":true,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotestedijsl","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestedijsl.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":"asotesteenzrz"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "24" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz?api-version=2021-11-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz","name":"asotesteenzrz","type":"Microsoft.ServiceBus/namespaces/topics","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":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":"asotestzjviny"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "24" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/queues/asotestzjviny?api-version=2021-11-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/queues/asotestzjviny","name":"asotestzjviny","type":"Microsoft.ServiceBus/namespaces/queues","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00"}}' + 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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz?api-version=2021-11-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz","name":"asotesteenzrz","type":"Microsoft.ServiceBus/namespaces/topics","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/queues/asotestzjviny?api-version=2021-11-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/queues/asotestzjviny","name":"asotestzjviny","type":"Microsoft.ServiceBus/namespaces/queues","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z"}}' + 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":"asotestexokpd","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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/AuthorizationRules/asotestexokpd?api-version=2021-11-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/AuthorizationRules/asotestexokpd","name":"asotestexokpd","type":"Microsoft.ServiceBus/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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/AuthorizationRules/asotestexokpd?api-version=2021-11-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/authorizationrules/asotestexokpd","name":"asotestexokpd","type":"Microsoft.ServiceBus/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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/AuthorizationRules/asotestexokpd/listKeys?api-version=2021-11-01 + method: POST + response: + body: '{"primaryConnectionString":"Endpoint=sb://asotestedijsl.servicebus.windows.net/;SharedAccessKeyName=asotestexokpd;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotestedijsl.servicebus.windows.net/;SharedAccessKeyName=asotestexokpd;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"asotestexokpd"}' + 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":"asotestroeizu"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "24" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz/subscriptions/asotestroeizu?api-version=2021-11-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz/subscriptions/asotestroeizu","name":"asotestroeizu","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westcentralus","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' + 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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz/subscriptions/asotestroeizu?api-version=2021-11-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz/subscriptions/asotestroeizu","name":"asotestroeizu","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westcentralus","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' + 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":"asotestnmosgs","properties":{"action":{"compatibilityLevel":20,"requiresPreprocessing":false,"sqlExpression":"SET + myproperty=myvalue"},"correlationFilter":{"contentType":"text"},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"StoreId + IN (''Store1'',''Store2'',''Store3'')"}}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "285" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz/subscriptions/asotestroeizu/rules/asotestnmosgs?api-version=2021-11-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz/subscriptions/asotestroeizu/rules/asotestnmosgs","name":"asotestnmosgs","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westcentralus","properties":{"action":{"sqlExpression":"SET + myproperty=myvalue","compatibilityLevel":20},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"StoreId + IN (''Store1'',''Store2'',''Store3'')","compatibilityLevel":20}}}' + 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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz/subscriptions/asotestroeizu/rules/asotestnmosgs?api-version=2021-11-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz/subscriptions/asotestroeizu/rules/asotestnmosgs","name":"asotestnmosgs","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westcentralus","properties":{"action":{"sqlExpression":"SET + myproperty=myvalue","compatibilityLevel":20,"parameters":{}},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"StoreId + IN (''Store1'',''Store2'',''Store3'')","compatibilityLevel":20,"parameters":{}}}}' + 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-vwbpuo?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWV0JQVU8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWV0JQVU8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWV0JQVU8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWV0JQVU8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWV0JQVU8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWV0JQVU8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWV0JQVU8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWV0JQVU8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWV0JQVU8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRWV0JQVU8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl?api-version=2021-11-01 + method: DELETE + response: + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-vwbpuo'' + 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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz?api-version=2021-11-01 + method: DELETE + response: + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform + ''delete'' on resource(s) of type ''namespaces/topics'', because the parent + resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl'' + could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "317" + 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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/AuthorizationRules/asotestexokpd?api-version=2021-11-01 + method: DELETE + response: + 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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl'' + could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "329" + 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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/queues/asotestzjviny?api-version=2021-11-01 + method: DELETE + response: + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform + ''delete'' on resource(s) of type ''namespaces/queues'', because the parent + resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl'' + could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "317" + 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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz/subscriptions/asotestroeizu?api-version=2021-11-01 + method: DELETE + response: + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform + ''delete'' on resource(s) of type ''namespaces/topics/subscriptions'', because + the parent resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz'' + could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "352" + 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-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz/subscriptions/asotestroeizu/rules/asotestnmosgs?api-version=2021-11-01 + method: DELETE + response: + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform + ''delete'' on resource(s) of type ''namespaces/topics/subscriptions/rules'', + because the parent resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-vwbpuo/providers/Microsoft.ServiceBus/namespaces/asotestedijsl/topics/asotesteenzrz/subscriptions/asotestroeizu'' + could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "386" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + status: 404 Not Found + code: 404 + duration: "" diff --git a/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api20221001preview_CreationAndDeletion.yaml b/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api20221001preview_CreationAndDeletion.yaml new file mode 100644 index 00000000000..46135e7eddc --- /dev/null +++ b/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api20221001preview_CreationAndDeletion.yaml @@ -0,0 +1,1111 @@ +--- +version: 1 +interactions: +- request: + body: '{"location":"westus2","name":"asotest-rg-jwyavv","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-jwyavv?api-version=2020-06-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv","name":"asotest-rg-jwyavv","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-jwyavv?api-version=2020-06-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv","name":"asotest-rg-jwyavv","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":"asotestyftnak","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "114" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak?api-version=2021-01-01-preview + method: PUT + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak","name":"asotestyftnak","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestyftnak","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyftnak.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: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak?api-version=2021-01-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak","name":"asotestyftnak","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestyftnak","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyftnak.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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak?api-version=2021-01-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak","name":"asotestyftnak","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestyftnak","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyftnak.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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak?api-version=2021-01-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak","name":"asotestyftnak","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestyftnak","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyftnak.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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak?api-version=2021-01-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak","name":"asotestyftnak","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestyftnak","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyftnak.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: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak?api-version=2021-01-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak","name":"asotestyftnak","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotestyftnak","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyftnak.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: + - "5" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak?api-version=2021-01-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak","name":"asotestyftnak","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotestyftnak","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyftnak.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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak?api-version=2021-01-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak","name":"asotestyftnak","type":"Microsoft.ServiceBus/Namespaces","location":"West + Central US","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotestyftnak","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotestyftnak.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":"asotestqaeexb"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "24" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/queues/asotestqaeexb?api-version=2021-01-01-preview + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/queues/asotestqaeexb","name":"asotestqaeexb","type":"Microsoft.ServiceBus/namespaces/queues","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00"}}' + 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":"asotesthoycyt"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "24" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt?api-version=2021-01-01-preview + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt","name":"asotesthoycyt","type":"Microsoft.ServiceBus/namespaces/topics","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt?api-version=2021-01-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt","name":"asotesthoycyt","type":"Microsoft.ServiceBus/namespaces/topics","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/queues/asotestqaeexb?api-version=2021-01-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/queues/asotestqaeexb","name":"asotestqaeexb","type":"Microsoft.ServiceBus/namespaces/queues","location":"westcentralus","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z"}}' + 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":"asotestgwznuu","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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/AuthorizationRules/asotestgwznuu?api-version=2021-01-01-preview + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/AuthorizationRules/asotestgwznuu","name":"asotestgwznuu","type":"Microsoft.ServiceBus/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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/AuthorizationRules/asotestgwznuu?api-version=2021-01-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/authorizationrules/asotestgwznuu","name":"asotestgwznuu","type":"Microsoft.ServiceBus/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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/AuthorizationRules/asotestgwznuu/listKeys?api-version=2021-11-01 + method: POST + response: + body: '{"primaryConnectionString":"Endpoint=sb://asotestyftnak.servicebus.windows.net/;SharedAccessKeyName=asotestgwznuu;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotestyftnak.servicebus.windows.net/;SharedAccessKeyName=asotestgwznuu;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"asotestgwznuu"}' + 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":"asotestswxzyc"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "24" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt/subscriptions/asotestswxzyc?api-version=2021-01-01-preview + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt/subscriptions/asotestswxzyc","name":"asotestswxzyc","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westcentralus","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' + 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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt/subscriptions/asotestswxzyc?api-version=2021-01-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt/subscriptions/asotestswxzyc","name":"asotestswxzyc","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westcentralus","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' + 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":"asotestaknclk","properties":{"action":{"compatibilityLevel":20,"requiresPreprocessing":false,"sqlExpression":"SET + myproperty=myvalue"},"correlationFilter":{"contentType":"text"},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"StoreId + IN (''Store1'',''Store2'',''Store3'')"}}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "285" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt/subscriptions/asotestswxzyc/rules/asotestaknclk?api-version=2021-01-01-preview + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt/subscriptions/asotestswxzyc/rules/asotestaknclk","name":"asotestaknclk","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westcentralus","properties":{"action":{"sqlExpression":"SET + myproperty=myvalue","compatibilityLevel":20},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"StoreId + IN (''Store1'',''Store2'',''Store3'')","compatibilityLevel":20}}}' + 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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt/subscriptions/asotestswxzyc/rules/asotestaknclk?api-version=2021-01-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt/subscriptions/asotestswxzyc/rules/asotestaknclk","name":"asotestaknclk","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westcentralus","properties":{"action":{"sqlExpression":"SET + myproperty=myvalue","compatibilityLevel":20,"parameters":{}},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"StoreId + IN (''Store1'',''Store2'',''Store3'')","compatibilityLevel":20,"parameters":{}}}}' + 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-jwyavv?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKV1lBVlYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKV1lBVlYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKV1lBVlYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKV1lBVlYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKV1lBVlYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKV1lBVlYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKV1lBVlYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKV1lBVlYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKV1lBVlYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRKV1lBVlYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak?api-version=2021-01-01-preview + method: DELETE + response: + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-jwyavv'' + 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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt?api-version=2021-01-01-preview + method: DELETE + response: + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform + ''delete'' on resource(s) of type ''namespaces/topics'', because the parent + resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak'' + could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "317" + 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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/AuthorizationRules/asotestgwznuu?api-version=2021-01-01-preview + method: DELETE + response: + 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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak'' + could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "329" + 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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/queues/asotestqaeexb?api-version=2021-01-01-preview + method: DELETE + response: + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform + ''delete'' on resource(s) of type ''namespaces/queues'', because the parent + resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak'' + could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "317" + 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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt/subscriptions/asotestswxzyc?api-version=2021-01-01-preview + method: DELETE + response: + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform + ''delete'' on resource(s) of type ''namespaces/topics/subscriptions'', because + the parent resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt'' + could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "352" + 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-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt/subscriptions/asotestswxzyc/rules/asotestaknclk?api-version=2021-01-01-preview + method: DELETE + response: + body: '{"error":{"code":"ParentResourceNotFound","message":"Failed to perform + ''delete'' on resource(s) of type ''namespaces/topics/subscriptions/rules'', + because the parent resource ''/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-jwyavv/providers/Microsoft.ServiceBus/namespaces/asotestyftnak/topics/asotesthoycyt/subscriptions/asotestswxzyc'' + could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "386" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + status: 404 Not Found + code: 404 + duration: "" diff --git a/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_CRUD.yaml b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_v1api20210101preview_CRUD.yaml similarity index 76% rename from v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_CRUD.yaml rename to v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_v1api20210101preview_CRUD.yaml index 15e2d750a63..af740d59866 100644 --- a/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_CRUD.yaml +++ b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_v1api20210101preview_CRUD.yaml @@ -2,7 +2,7 @@ version: 1 interactions: - request: - body: '{"location":"westus2","name":"asotest-rg-lcniru","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' + body: '{"location":"westus2","name":"asotest-rg-trsviw","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' form: {} headers: Accept: @@ -13,10 +13,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw?api-version=2020-06-01 method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru","name":"asotest-rg-lcniru","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw","name":"asotest-rg-trsviw","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' headers: Cache-Control: - no-cache @@ -43,10 +43,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw?api-version=2020-06-01 method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru","name":"asotest-rg-lcniru","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw","name":"asotest-rg-trsviw","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' headers: Cache-Control: - no-cache @@ -66,7 +66,7 @@ interactions: code: 200 duration: "" - request: - body: '{"location":"westus2","name":"asotest-namespace-teqmwb","properties":{"zoneRedundant":false},"sku":{"name":"Basic"}}' + body: '{"location":"westus2","name":"asotest-namespace-nqpmya","properties":{"zoneRedundant":false},"sku":{"name":"Basic"}}' form: {} headers: Accept: @@ -77,11 +77,11 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: PUT response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -111,11 +111,11 @@ interactions: headers: Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -145,11 +145,11 @@ interactions: headers: Test-Request-Attempt: - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -179,11 +179,11 @@ interactions: headers: Test-Request-Attempt: - "2" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -213,11 +213,11 @@ interactions: headers: Test-Request-Attempt: - "3" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -247,11 +247,11 @@ interactions: headers: Test-Request-Attempt: - "4" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -281,11 +281,11 @@ interactions: headers: Test-Request-Attempt: - "5" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Active"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Active"}}' headers: Cache-Control: - no-cache @@ -317,11 +317,11 @@ interactions: - application/json Test-Request-Attempt: - "6" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Active"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Active"}}' headers: Cache-Control: - no-cache @@ -346,7 +346,7 @@ interactions: code: 200 duration: "" - request: - body: '{"name":"asotest-queue-gkglnj"}' + body: '{"name":"asotest-queue-urflmr"}' form: {} headers: Accept: @@ -357,10 +357,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb/queues/asotest-queue-gkglnj?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya/queues/asotest-queue-urflmr?api-version=2021-01-01-preview method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb/queues/asotest-queue-gkglnj","name":"asotest-queue-gkglnj","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P14D","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya/queues/asotest-queue-urflmr","name":"asotest-queue-urflmr","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P14D","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00"}}' headers: Cache-Control: - no-cache @@ -389,10 +389,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb/queues/asotest-queue-gkglnj?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya/queues/asotest-queue-urflmr?api-version=2021-01-01-preview method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb/queues/asotest-queue-gkglnj","name":"asotest-queue-gkglnj","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P14D","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya/queues/asotest-queue-urflmr","name":"asotest-queue-urflmr","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P14D","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z"}}' headers: Cache-Control: - no-cache @@ -421,7 +421,7 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb/queues/asotest-queue-gkglnj?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya/queues/asotest-queue-urflmr?api-version=2021-01-01-preview method: DELETE response: body: "" @@ -444,7 +444,7 @@ interactions: code: 200 duration: "" - request: - body: '{"location":"westus2","name":"asotest-namespace-teqmwb","properties":{"zoneRedundant":false},"sku":{"name":"Basic"}}' + body: '{"location":"westus2","name":"asotest-namespace-nqpmya","properties":{"zoneRedundant":false},"sku":{"name":"Basic"}}' form: {} headers: Accept: @@ -455,11 +455,11 @@ interactions: - application/json Test-Request-Attempt: - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: PUT response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -489,11 +489,11 @@ interactions: headers: Test-Request-Attempt: - "7" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Active"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -521,15 +521,13 @@ interactions: body: "" form: {} headers: - Accept: - - application/json Test-Request-Attempt: - "8" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Active"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Active"}}' headers: Cache-Control: - no-cache @@ -560,11 +558,12 @@ interactions: Accept: - application/json Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb/AuthorizationRules/RootManageSharedAccessKey/listKeys?api-version=2021-11-01 - method: POST + - "9" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview + method: GET response: - body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-teqmwb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-teqmwb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"RootManageSharedAccessKey"}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Active"}}' headers: Cache-Control: - no-cache @@ -575,7 +574,10 @@ interactions: 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: @@ -593,59 +595,53 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview - method: DELETE + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya/AuthorizationRules/RootManageSharedAccessKey/listKeys?api-version=2021-11-01 + method: POST response: - body: "" + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-nqpmya.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-nqpmya.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"RootManageSharedAccessKey"}' headers: Cache-Control: - no-cache - Content-Length: - - "0" + Content-Type: + - application/json; charset=utf-8 Expires: - "-1" - Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb/operationresults/asotest-namespace-teqmwb?api-version=2021-01-01-preview 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: 202 Accepted - code: 202 + 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-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb/operationresults/asotest-namespace-teqmwb?api-version=2021-01-01-preview - method: GET + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview + method: DELETE response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Removing"}}' + body: "" headers: Cache-Control: - no-cache Content-Length: - - "631" - Content-Type: - - application/json; charset=utf-8 + - "0" Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb/operationresults/asotest-namespace-teqmwb?api-version=2021-01-01-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya/operationresults/asotest-namespace-nqpmya?api-version=2021-01-01-preview Pragma: - no-cache - Retry-After: - - "35" Server: - Service-Bus-Resource-Provider/SN1 - Microsoft-HTTPAPI/2.0 @@ -662,24 +658,28 @@ interactions: body: "" form: {} headers: - Accept: - - application/json Test-Request-Attempt: - - "9" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya/operationresults/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Removing"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Removing"}}' headers: Cache-Control: - no-cache + Content-Length: + - "631" Content-Type: - application/json; charset=utf-8 Expires: - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya/operationresults/asotest-namespace-nqpmya?api-version=2021-01-01-preview Pragma: - no-cache + Retry-After: + - "46" Server: - Service-Bus-Resource-Provider/SN1 - Microsoft-HTTPAPI/2.0 @@ -687,12 +687,10 @@ interactions: - 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 + status: 202 Accepted + code: 202 duration: "" - request: body: "" @@ -702,11 +700,11 @@ interactions: - application/json Test-Request-Attempt: - "10" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Removing"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Removing"}}' headers: Cache-Control: - no-cache @@ -738,11 +736,11 @@ interactions: - application/json Test-Request-Attempt: - "11" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Removing"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Removing"}}' headers: Cache-Control: - no-cache @@ -774,11 +772,11 @@ interactions: - application/json Test-Request-Attempt: - "12" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb","name":"asotest-namespace-teqmwb","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-teqmwb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-teqmwb.servicebus.windows.net:443/","status":"Removing"}}' + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya","name":"asotest-namespace-nqpmya","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nqpmya","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nqpmya.servicebus.windows.net:443/","status":"Removing"}}' headers: Cache-Control: - no-cache @@ -810,10 +808,10 @@ interactions: - application/json Test-Request-Attempt: - "13" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-teqmwb?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nqpmya?api-version=2021-01-01-preview method: GET response: - body: '{"error":{"message":"Namespace does not exist. CorrelationId: 986da2cc-ed27-4857-ac5f-1aaa159c670a","code":"NotFound"}}' + body: '{"error":{"message":"Namespace does not exist. CorrelationId: 0c90496a-b9de-440b-8e69-28627c26f11b","code":"NotFound"}}' headers: Cache-Control: - no-cache @@ -845,7 +843,7 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-lcniru?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-trsviw?api-version=2020-06-01 method: DELETE response: body: "" @@ -857,7 +855,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRMQ05JUlUtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRUUlNWSVctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -875,7 +873,7 @@ interactions: headers: Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRMQ05JUlUtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRUUlNWSVctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" @@ -887,7 +885,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRMQ05JUlUtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRUUlNWSVctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -905,7 +903,7 @@ interactions: headers: Test-Request-Attempt: - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRMQ05JUlUtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRUUlNWSVctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" @@ -917,7 +915,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRMQ05JUlUtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRUUlNWSVctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -935,7 +933,7 @@ interactions: headers: Test-Request-Attempt: - "2" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRMQ05JUlUtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRUUlNWSVctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" @@ -947,7 +945,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRMQ05JUlUtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRUUlNWSVctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -965,7 +963,7 @@ interactions: headers: Test-Request-Attempt: - "3" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRMQ05JUlUtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRUUlNWSVctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" @@ -977,7 +975,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRMQ05JUlUtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRUUlNWSVctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -995,7 +993,7 @@ interactions: headers: Test-Request-Attempt: - "4" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRMQ05JUlUtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRUUlNWSVctV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" diff --git a/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_v1api20211101_CRUD.yaml b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_v1api20211101_CRUD.yaml new file mode 100644 index 00000000000..cabb1969afe --- /dev/null +++ b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_v1api20211101_CRUD.yaml @@ -0,0 +1,981 @@ +--- +version: 1 +interactions: +- request: + body: '{"location":"westus2","name":"asotest-rg-wcpcaq","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-wcpcaq?api-version=2020-06-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq","name":"asotest-rg-wcpcaq","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-wcpcaq?api-version=2020-06-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq","name":"asotest-rg-wcpcaq","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-bwqtxw","properties":{"zoneRedundant":false},"sku":{"name":"Basic"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "116" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: PUT + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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: + - "5" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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-queue-qjwkld"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "31" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw/queues/asotest-queue-qjwkld?api-version=2021-11-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw/queues/asotest-queue-qjwkld","name":"asotest-queue-qjwkld","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P14D","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00"}}' + 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-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw/queues/asotest-queue-qjwkld?api-version=2021-11-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw/queues/asotest-queue-qjwkld","name":"asotest-queue-qjwkld","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P14D","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z"}}' + 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-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw/queues/asotest-queue-qjwkld?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: '{"location":"westus2","name":"asotest-namespace-bwqtxw","properties":{"zoneRedundant":false},"sku":{"name":"Basic"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "116" + Content-Type: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: PUT + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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: + - "7" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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: + - "8" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw/AuthorizationRules/RootManageSharedAccessKey/listKeys?api-version=2021-11-01 + method: POST + response: + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-bwqtxw.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-bwqtxw.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"RootManageSharedAccessKey"}' + 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-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?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-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw/operationresults/asotest-namespace-bwqtxw?api-version=2021-11-01 + 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: 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-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw/operationresults/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.servicebus.windows.net:443/","status":"Removing"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "656" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw/operationresults/asotest-namespace-bwqtxw?api-version=2021-11-01 + Pragma: + - no-cache + Retry-After: + - "38" + 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: 202 Accepted + code: 202 + 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-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw","name":"asotest-namespace-bwqtxw","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-bwqtxw","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-bwqtxw.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: + - "12" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-wcpcaq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-bwqtxw?api-version=2021-11-01 + method: GET + response: + body: '{"error":{"message":"Namespace does not exist. CorrelationId: 555d4343-33eb-4bb2-847d-6185e6292695","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-wcpcaq?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRXQ1BDQVEtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRXQ1BDQVEtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRXQ1BDQVEtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRXQ1BDQVEtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRXQ1BDQVEtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRXQ1BDQVEtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRXQ1BDQVEtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRXQ1BDQVEtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRXQ1BDQVEtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRXQ1BDQVEtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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_ServiceBus_Namespace_Basic_v1api20221001preview_CRUD.yaml b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_v1api20221001preview_CRUD.yaml new file mode 100644 index 00000000000..61151b34ce4 --- /dev/null +++ b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_v1api20221001preview_CRUD.yaml @@ -0,0 +1,909 @@ +--- +version: 1 +interactions: +- request: + body: '{"location":"westus2","name":"asotest-rg-ottrav","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-ottrav?api-version=2020-06-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav","name":"asotest-rg-ottrav","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-ottrav?api-version=2020-06-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav","name":"asotest-rg-ottrav","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-tsffrn","properties":{"zoneRedundant":false},"sku":{"name":"Basic"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "116" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + method: PUT + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn","name":"asotest-namespace-tsffrn","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-tsffrn","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-tsffrn.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: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn","name":"asotest-namespace-tsffrn","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-tsffrn","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-tsffrn.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-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn","name":"asotest-namespace-tsffrn","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-tsffrn","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-tsffrn.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-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn","name":"asotest-namespace-tsffrn","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-tsffrn","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-tsffrn.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-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn","name":"asotest-namespace-tsffrn","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-tsffrn","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-tsffrn.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: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn","name":"asotest-namespace-tsffrn","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-tsffrn","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-tsffrn.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: + - "5" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn","name":"asotest-namespace-tsffrn","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-tsffrn","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-tsffrn.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-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn","name":"asotest-namespace-tsffrn","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-tsffrn","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-tsffrn.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-queue-btuete"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "31" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn/queues/asotest-queue-btuete?api-version=2022-10-01-preview + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn/queues/asotest-queue-btuete","name":"asotest-queue-btuete","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P14D","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00"}}' + 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-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn/queues/asotest-queue-btuete?api-version=2022-10-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn/queues/asotest-queue-btuete","name":"asotest-queue-btuete","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P14D","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z"}}' + 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-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn/queues/asotest-queue-btuete?api-version=2022-10-01-preview + 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: '{"location":"westus2","name":"asotest-namespace-tsffrn","properties":{"zoneRedundant":false},"sku":{"name":"Basic"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "116" + Content-Type: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + method: PUT + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn","name":"asotest-namespace-tsffrn","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-tsffrn","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-tsffrn.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: + - "7" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn","name":"asotest-namespace-tsffrn","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-tsffrn","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-tsffrn.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: + - "8" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn","name":"asotest-namespace-tsffrn","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-tsffrn","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-tsffrn.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: + - "9" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Basic","tier":"Basic"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn","name":"asotest-namespace-tsffrn","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-tsffrn","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-tsffrn.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: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn/AuthorizationRules/RootManageSharedAccessKey/listKeys?api-version=2021-11-01 + method: POST + response: + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-tsffrn.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-tsffrn.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"RootManageSharedAccessKey"}' + 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-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + 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-ottrav/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-tsffrn?api-version=2022-10-01-preview&resourceType=Namespace + 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: 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-ottrav/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-tsffrn?api-version=2022-10-01-preview&resourceType=Namespace + 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/resourcegroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-tsffrn?api-version=2022-10-01-preview&resourceType=Namespace + 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: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-tsffrn?api-version=2022-10-01-preview&resourceType=Namespace + 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/resourcegroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-tsffrn?api-version=2022-10-01-preview&resourceType=Namespace + 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: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-tsffrn?api-version=2022-10-01-preview&resourceType=Namespace + 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/resourcegroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-tsffrn?api-version=2022-10-01-preview&resourceType=Namespace + 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: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-tsffrn?api-version=2022-10-01-preview&resourceType=Namespace + 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/resourcegroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-tsffrn?api-version=2022-10-01-preview&resourceType=Namespace + 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: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-ottrav/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-tsffrn?api-version=2022-10-01-preview&resourceType=Namespace + method: GET + response: + body: "" + headers: + Cache-Control: + - no-cache + 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: 204 No Content + code: 204 + 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-ottrav/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn?api-version=2022-10-01-preview + method: GET + response: + body: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.ServiceBus/namespaces/asotest-namespace-tsffrn'' + under resource group ''asotest-rg-ottrav'' was not found. For more details please + go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "245" + 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-ottrav?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPVFRSQVYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPVFRSQVYtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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_ServiceBus_Namespace_Standard_CRUD.yaml b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Standard_v1api20210101preview_CRUD.yaml similarity index 73% rename from v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Standard_CRUD.yaml rename to v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Standard_v1api20210101preview_CRUD.yaml index a5a7911956e..b7ed05822d2 100644 --- a/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Standard_CRUD.yaml +++ b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Standard_v1api20210101preview_CRUD.yaml @@ -2,7 +2,7 @@ version: 1 interactions: - request: - body: '{"location":"westus2","name":"asotest-rg-agwubx","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' + body: '{"location":"westus2","name":"asotest-rg-ozhnzo","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' form: {} headers: Accept: @@ -13,10 +13,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo?api-version=2020-06-01 method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx","name":"asotest-rg-agwubx","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo","name":"asotest-rg-ozhnzo","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' headers: Cache-Control: - no-cache @@ -43,10 +43,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo?api-version=2020-06-01 method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx","name":"asotest-rg-agwubx","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo","name":"asotest-rg-ozhnzo","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' headers: Cache-Control: - no-cache @@ -66,7 +66,7 @@ interactions: code: 200 duration: "" - request: - body: '{"location":"westus2","name":"asotest-namespace-nrqflo","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' + body: '{"location":"westus2","name":"asotest-namespace-vlsonb","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' form: {} headers: Accept: @@ -77,11 +77,11 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: PUT response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -111,11 +111,11 @@ interactions: headers: Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -145,11 +145,11 @@ interactions: headers: Test-Request-Attempt: - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -179,11 +179,11 @@ interactions: headers: Test-Request-Attempt: - "2" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -213,11 +213,11 @@ interactions: headers: Test-Request-Attempt: - "3" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -247,11 +247,11 @@ interactions: headers: Test-Request-Attempt: - "4" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -281,11 +281,11 @@ interactions: headers: Test-Request-Attempt: - "5" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Active"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Active"}}' headers: Cache-Control: - no-cache @@ -317,11 +317,11 @@ interactions: - application/json Test-Request-Attempt: - "6" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Active"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Active"}}' headers: Cache-Control: - no-cache @@ -346,7 +346,7 @@ interactions: code: 200 duration: "" - request: - body: '{"name":"asotest-queue-qxxgdt"}' + body: '{"name":"asotest-queue-kjdgln"}' form: {} headers: Accept: @@ -357,10 +357,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/queues/asotest-queue-qxxgdt?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/queues/asotest-queue-kjdgln?api-version=2021-01-01-preview method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/queues/asotest-queue-qxxgdt","name":"asotest-queue-qxxgdt","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/queues/asotest-queue-kjdgln","name":"asotest-queue-kjdgln","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00"}}' headers: Cache-Control: - no-cache @@ -382,7 +382,7 @@ interactions: code: 200 duration: "" - request: - body: '{"name":"asotest-topic-cwiusv"}' + body: '{"name":"asotest-topic-giunzg"}' form: {} headers: Accept: @@ -393,10 +393,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg?api-version=2021-01-01-preview method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv","name":"asotest-topic-cwiusv","type":"Microsoft.ServiceBus/namespaces/topics","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg","name":"asotest-topic-giunzg","type":"Microsoft.ServiceBus/namespaces/topics","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}' headers: Cache-Control: - no-cache @@ -425,10 +425,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/queues/asotest-queue-qxxgdt?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/queues/asotest-queue-kjdgln?api-version=2021-01-01-preview method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/queues/asotest-queue-qxxgdt","name":"asotest-queue-qxxgdt","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/queues/asotest-queue-kjdgln","name":"asotest-queue-kjdgln","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z"}}' headers: Cache-Control: - no-cache @@ -457,10 +457,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg?api-version=2021-01-01-preview method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv","name":"asotest-topic-cwiusv","type":"Microsoft.ServiceBus/namespaces/topics","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg","name":"asotest-topic-giunzg","type":"Microsoft.ServiceBus/namespaces/topics","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0}}}' headers: Cache-Control: - no-cache @@ -489,7 +489,7 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/queues/asotest-queue-qxxgdt?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/queues/asotest-queue-kjdgln?api-version=2021-01-01-preview method: DELETE response: body: "" @@ -512,21 +512,21 @@ interactions: code: 200 duration: "" - request: - body: '{"name":"asotest-subscription-rxfpvw"}' + body: '{"name":"asotest-rule-nutrsw","properties":{"rights":["Listen","Send"]}}' form: {} headers: Accept: - application/json Content-Length: - - "38" + - "72" Content-Type: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv/subscriptions/asotest-subscription-rxfpvw?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/AuthorizationRules/asotest-rule-nutrsw?api-version=2021-01-01-preview method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv/subscriptions/asotest-subscription-rxfpvw","name":"asotest-subscription-rxfpvw","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westus2","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/AuthorizationRules/asotest-rule-nutrsw","name":"asotest-rule-nutrsw","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"westus2","properties":{"rights":["Listen","Send"]}}' headers: Cache-Control: - no-cache @@ -548,21 +548,22 @@ interactions: code: 200 duration: "" - request: - body: '{"name":"asotest-rule-rdawjk","properties":{"rights":["Listen","Send"]}}' + body: '{"location":"westus2","name":"asotest-namespace-vlsonb","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' form: {} headers: Accept: - application/json Content-Length: - - "72" + - "119" Content-Type: - application/json Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/AuthorizationRules/asotest-rule-rdawjk?api-version=2021-01-01-preview + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: PUT response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/AuthorizationRules/asotest-rule-rdawjk","name":"asotest-rule-rdawjk","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"westus2","properties":{"rights":["Listen","Send"]}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -573,7 +574,10 @@ interactions: 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: @@ -591,10 +595,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv/subscriptions/asotest-subscription-rxfpvw?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/AuthorizationRules/asotest-rule-nutrsw?api-version=2021-01-01-preview method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv/subscriptions/asotest-subscription-rxfpvw","name":"asotest-subscription-rxfpvw","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westus2","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/authorizationrules/asotest-rule-nutrsw","name":"asotest-rule-nutrsw","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"westus2","properties":{"rights":["Listen","Send"]}}' headers: Cache-Control: - no-cache @@ -619,14 +623,13 @@ interactions: body: "" form: {} headers: - Accept: - - application/json Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/AuthorizationRules/asotest-rule-rdawjk?api-version=2021-01-01-preview + - "7" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/authorizationrules/asotest-rule-rdawjk","name":"asotest-rule-rdawjk","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"westus2","properties":{"rights":["Listen","Send"]}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Activating"}}' headers: Cache-Control: - no-cache @@ -637,7 +640,10 @@ interactions: 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: @@ -648,22 +654,21 @@ interactions: code: 200 duration: "" - request: - body: '{"location":"westus2","name":"asotest-namespace-nrqflo","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' + body: '{"name":"asotest-subscription-mxuscp"}' form: {} headers: Accept: - application/json Content-Length: - - "119" + - "38" Content-Type: - application/json Test-Request-Attempt: - - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg/subscriptions/asotest-subscription-mxuscp?api-version=2021-01-01-preview method: PUT response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Activating"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg/subscriptions/asotest-subscription-mxuscp","name":"asotest-subscription-mxuscp","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westus2","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' headers: Cache-Control: - no-cache @@ -674,10 +679,7 @@ interactions: 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: @@ -695,10 +697,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/AuthorizationRules/asotest-rule-rdawjk/listKeys?api-version=2021-11-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/AuthorizationRules/asotest-rule-nutrsw/listKeys?api-version=2021-11-01 method: POST response: - body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-nrqflo.servicebus.windows.net/;SharedAccessKeyName=asotest-rule-rdawjk;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-nrqflo.servicebus.windows.net/;SharedAccessKeyName=asotest-rule-rdawjk;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"asotest-rule-rdawjk"}' + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-vlsonb.servicebus.windows.net/;SharedAccessKeyName=asotest-rule-nutrsw;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-vlsonb.servicebus.windows.net/;SharedAccessKeyName=asotest-rule-nutrsw;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"asotest-rule-nutrsw"}' headers: Cache-Control: - no-cache @@ -723,13 +725,14 @@ interactions: body: "" form: {} headers: + Accept: + - application/json Test-Request-Attempt: - - "7" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg/subscriptions/asotest-subscription-mxuscp?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Active"}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg/subscriptions/asotest-subscription-mxuscp","name":"asotest-subscription-mxuscp","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westus2","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' headers: Cache-Control: - no-cache @@ -740,10 +743,7 @@ interactions: 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: @@ -754,21 +754,16 @@ interactions: code: 200 duration: "" - request: - body: '{"name":"asotest-subrule-wlvfby"}' + body: "" form: {} headers: - Accept: - - application/json - Content-Length: - - "33" - Content-Type: - - application/json Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv/subscriptions/asotest-subscription-rxfpvw/rules/asotest-subrule-wlvfby?api-version=2021-01-01-preview - method: PUT + - "8" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview + method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv/subscriptions/asotest-subscription-rxfpvw/rules/asotest-subrule-wlvfby","name":"asotest-subrule-wlvfby","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westus2","properties":{"action":{},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"1=1","compatibilityLevel":20,"parameters":{}}}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Active"}}' headers: Cache-Control: - no-cache @@ -779,7 +774,10 @@ interactions: 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: @@ -796,12 +794,12 @@ interactions: Accept: - application/json Test-Request-Attempt: - - "8" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + - "9" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Active"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Active"}}' headers: Cache-Control: - no-cache @@ -825,6 +823,42 @@ interactions: status: 200 OK code: 200 duration: "" +- request: + body: '{"name":"asotest-subrule-qlhrcu"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "33" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg/subscriptions/asotest-subscription-mxuscp/rules/asotest-subrule-qlhrcu?api-version=2021-01-01-preview + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg/subscriptions/asotest-subscription-mxuscp/rules/asotest-subrule-qlhrcu","name":"asotest-subrule-qlhrcu","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westus2","properties":{"action":{},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"1=1","compatibilityLevel":20,"parameters":{}}}}' + 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: {} @@ -833,10 +867,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv/subscriptions/asotest-subscription-rxfpvw/rules/asotest-subrule-wlvfby?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg/subscriptions/asotest-subscription-mxuscp/rules/asotest-subrule-qlhrcu?api-version=2021-01-01-preview method: GET response: - body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv/subscriptions/asotest-subscription-rxfpvw/rules/asotest-subrule-wlvfby","name":"asotest-subrule-wlvfby","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westus2","properties":{"action":{},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"1=1","compatibilityLevel":20,"parameters":{}}}}' + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg/subscriptions/asotest-subscription-mxuscp/rules/asotest-subrule-qlhrcu","name":"asotest-subrule-qlhrcu","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westus2","properties":{"action":{},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"1=1","compatibilityLevel":20,"parameters":{}}}}' headers: Cache-Control: - no-cache @@ -865,10 +899,10 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/AuthorizationRules/RootManageSharedAccessKey/listKeys?api-version=2021-11-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/AuthorizationRules/RootManageSharedAccessKey/listKeys?api-version=2021-11-01 method: POST response: - body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-nrqflo.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-nrqflo.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"RootManageSharedAccessKey"}' + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-vlsonb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-vlsonb.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"RootManageSharedAccessKey"}' headers: Cache-Control: - no-cache @@ -897,7 +931,7 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv/subscriptions/asotest-subscription-rxfpvw/rules/asotest-subrule-wlvfby?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg/subscriptions/asotest-subscription-mxuscp/rules/asotest-subrule-qlhrcu?api-version=2021-01-01-preview method: DELETE response: body: "" @@ -926,18 +960,16 @@ interactions: Accept: - application/json Test-Request-Attempt: - - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv/subscriptions/asotest-subscription-rxfpvw/rules/asotest-subrule-wlvfby?api-version=2021-01-01-preview - method: GET + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/AuthorizationRules/asotest-rule-nutrsw?api-version=2021-01-01-preview + method: DELETE response: - body: '{"error":{"code":"SubscriptionNotFound","message":"Rule does not exist"}}' + body: "" headers: Cache-Control: - no-cache Content-Length: - - "73" - Content-Type: - - application/json + - "0" Expires: - "-1" Pragma: @@ -948,8 +980,8 @@ interactions: - max-age=31536000; includeSubDomains X-Content-Type-Options: - nosniff - status: 404 Not Found - code: 404 + status: 200 OK + code: 200 duration: "" - request: body: "" @@ -958,16 +990,18 @@ interactions: Accept: - application/json Test-Request-Attempt: - - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/AuthorizationRules/asotest-rule-rdawjk?api-version=2021-01-01-preview - method: DELETE + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg/subscriptions/asotest-subscription-mxuscp/rules/asotest-subrule-qlhrcu?api-version=2021-01-01-preview + method: GET response: - body: "" + body: '{"error":{"code":"SubscriptionNotFound","message":"Rule does not exist"}}' headers: Cache-Control: - no-cache Content-Length: - - "0" + - "73" + Content-Type: + - application/json Expires: - "-1" Pragma: @@ -978,8 +1012,8 @@ interactions: - max-age=31536000; includeSubDomains X-Content-Type-Options: - nosniff - status: 200 OK - code: 200 + status: 404 Not Found + code: 404 duration: "" - request: body: "" @@ -989,7 +1023,7 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv/subscriptions/asotest-subscription-rxfpvw?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg/subscriptions/asotest-subscription-mxuscp?api-version=2021-01-01-preview method: DELETE response: body: "" @@ -1019,7 +1053,7 @@ interactions: - application/json Test-Request-Attempt: - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv/subscriptions/asotest-subscription-rxfpvw?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg/subscriptions/asotest-subscription-mxuscp?api-version=2021-01-01-preview method: GET response: body: '{"error":{"code":"SubscriptionNotFound","message":"Subscription does not @@ -1052,7 +1086,7 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/topics/asotest-topic-cwiusv?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/topics/asotest-topic-giunzg?api-version=2021-01-01-preview method: DELETE response: body: "" @@ -1082,7 +1116,7 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: DELETE response: body: "" @@ -1094,7 +1128,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/operationresults/asotest-namespace-nrqflo?api-version=2021-01-01-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/operationresults/asotest-namespace-vlsonb?api-version=2021-01-01-preview Pragma: - no-cache Server: @@ -1115,11 +1149,11 @@ interactions: headers: Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/operationresults/asotest-namespace-nrqflo?api-version=2021-01-01-preview + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/operationresults/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Removing"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Removing"}}' headers: Cache-Control: - no-cache @@ -1130,11 +1164,11 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo/operationresults/asotest-namespace-nrqflo?api-version=2021-01-01-preview + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb/operationresults/asotest-namespace-vlsonb?api-version=2021-01-01-preview Pragma: - no-cache Retry-After: - - "40" + - "45" Server: - Service-Bus-Resource-Provider/SN1 - Microsoft-HTTPAPI/2.0 @@ -1154,12 +1188,12 @@ interactions: Accept: - application/json Test-Request-Attempt: - - "9" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + - "10" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Removing"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Removing"}}' headers: Cache-Control: - no-cache @@ -1190,12 +1224,12 @@ interactions: Accept: - application/json Test-Request-Attempt: - - "10" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + - "11" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Removing"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Removing"}}' headers: Cache-Control: - no-cache @@ -1226,12 +1260,12 @@ interactions: Accept: - application/json Test-Request-Attempt: - - "11" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + - "12" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Removing"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Removing"}}' headers: Cache-Control: - no-cache @@ -1262,12 +1296,12 @@ interactions: Accept: - application/json Test-Request-Attempt: - - "12" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + - "13" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo","name":"asotest-namespace-nrqflo","type":"Microsoft.ServiceBus/Namespaces","location":"West - US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nrqflo","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-nrqflo.servicebus.windows.net:443/","status":"Removing"}}' + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb","name":"asotest-namespace-vlsonb","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-vlsonb","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-vlsonb.servicebus.windows.net:443/","status":"Removing"}}' headers: Cache-Control: - no-cache @@ -1298,11 +1332,11 @@ interactions: Accept: - application/json Test-Request-Attempt: - - "13" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nrqflo?api-version=2021-01-01-preview + - "14" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-vlsonb?api-version=2021-01-01-preview method: GET response: - body: '{"error":{"message":"Namespace does not exist. CorrelationId: 9121df5d-cfa5-4ac7-9dbe-972ad2a43002","code":"NotFound"}}' + body: '{"error":{"message":"Namespace does not exist. CorrelationId: 6bfa0207-60e3-4f99-bd35-f31d92a5e4a0","code":"NotFound"}}' headers: Cache-Control: - no-cache @@ -1334,7 +1368,7 @@ interactions: - application/json Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-agwubx?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-ozhnzo?api-version=2020-06-01 method: DELETE response: body: "" @@ -1346,7 +1380,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRBR1dVQlgtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPWkhOWk8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -1364,7 +1398,7 @@ interactions: headers: Test-Request-Attempt: - "0" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRBR1dVQlgtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPWkhOWk8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" @@ -1376,7 +1410,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRBR1dVQlgtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPWkhOWk8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -1394,7 +1428,7 @@ interactions: headers: Test-Request-Attempt: - "1" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRBR1dVQlgtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPWkhOWk8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" @@ -1406,7 +1440,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRBR1dVQlgtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPWkhOWk8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -1424,7 +1458,7 @@ interactions: headers: Test-Request-Attempt: - "2" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRBR1dVQlgtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPWkhOWk8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" @@ -1436,7 +1470,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRBR1dVQlgtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPWkhOWk8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -1454,7 +1488,7 @@ interactions: headers: Test-Request-Attempt: - "3" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRBR1dVQlgtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPWkhOWk8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" @@ -1466,7 +1500,7 @@ interactions: Expires: - "-1" Location: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRBR1dVQlgtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPWkhOWk8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 Pragma: - no-cache Retry-After: @@ -1484,7 +1518,7 @@ interactions: headers: Test-Request-Attempt: - "4" - url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRBR1dVQlgtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPWkhOWk8tV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01 method: GET response: body: "" diff --git a/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Standard_v1api20211101_CRUD.yaml b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Standard_v1api20211101_CRUD.yaml new file mode 100644 index 00000000000..39726f961f3 --- /dev/null +++ b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Standard_v1api20211101_CRUD.yaml @@ -0,0 +1,1504 @@ +--- +version: 1 +interactions: +- request: + body: '{"location":"westus2","name":"asotest-rg-oucoat","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-oucoat?api-version=2020-06-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat","name":"asotest-rg-oucoat","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-oucoat?api-version=2020-06-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat","name":"asotest-rg-oucoat","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-sbjmwy","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "119" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: PUT + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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: + - "5" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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-queue-wgrtru"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "31" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/queues/asotest-queue-wgrtru?api-version=2021-11-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/queues/asotest-queue-wgrtru","name":"asotest-queue-wgrtru","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00"}}' + 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-topic-uajkmi"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "31" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi?api-version=2021-11-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi","name":"asotest-topic-uajkmi","type":"Microsoft.ServiceBus/namespaces/topics","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/queues/asotest-queue-wgrtru?api-version=2021-11-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/queues/asotest-queue-wgrtru","name":"asotest-queue-wgrtru","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z"}}' + 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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi?api-version=2021-11-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi","name":"asotest-topic-uajkmi","type":"Microsoft.ServiceBus/namespaces/topics","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/queues/asotest-queue-wgrtru?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-rule-oiszcy","properties":{"rights":["Listen","Send"]}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "72" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/AuthorizationRules/asotest-rule-oiszcy?api-version=2021-11-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/AuthorizationRules/asotest-rule-oiszcy","name":"asotest-rule-oiszcy","type":"Microsoft.ServiceBus/Namespaces/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-subscription-bdlrev"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "38" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi/subscriptions/asotest-subscription-bdlrev?api-version=2021-11-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi/subscriptions/asotest-subscription-bdlrev","name":"asotest-subscription-bdlrev","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westus2","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' + 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: '{"location":"westus2","name":"asotest-namespace-sbjmwy","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "119" + Content-Type: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: PUT + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi/subscriptions/asotest-subscription-bdlrev?api-version=2021-11-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi/subscriptions/asotest-subscription-bdlrev","name":"asotest-subscription-bdlrev","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westus2","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' + 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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/AuthorizationRules/asotest-rule-oiszcy?api-version=2021-11-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/authorizationrules/asotest-rule-oiszcy","name":"asotest-rule-oiszcy","type":"Microsoft.ServiceBus/Namespaces/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: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/AuthorizationRules/asotest-rule-oiszcy/listKeys?api-version=2021-11-01 + method: POST + response: + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-sbjmwy.servicebus.windows.net/;SharedAccessKeyName=asotest-rule-oiszcy;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-sbjmwy.servicebus.windows.net/;SharedAccessKeyName=asotest-rule-oiszcy;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"asotest-rule-oiszcy"}' + 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: + Test-Request-Attempt: + - "7" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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: '{"name":"asotest-subrule-rvwwao"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "33" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi/subscriptions/asotest-subscription-bdlrev/rules/asotest-subrule-rvwwao?api-version=2021-11-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi/subscriptions/asotest-subscription-bdlrev/rules/asotest-subrule-rvwwao","name":"asotest-subrule-rvwwao","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westus2","properties":{"action":{},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"1=1","compatibilityLevel":20,"parameters":{}}}}' + 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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi/subscriptions/asotest-subscription-bdlrev/rules/asotest-subrule-rvwwao?api-version=2021-11-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi/subscriptions/asotest-subscription-bdlrev/rules/asotest-subrule-rvwwao","name":"asotest-subrule-rvwwao","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westus2","properties":{"action":{},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"1=1","compatibilityLevel":20,"parameters":{}}}}' + 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: + Test-Request-Attempt: + - "8" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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: + - "9" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi/subscriptions/asotest-subscription-bdlrev/rules/asotest-subrule-rvwwao?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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/AuthorizationRules/RootManageSharedAccessKey/listKeys?api-version=2021-11-01 + method: POST + response: + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-sbjmwy.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-sbjmwy.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"RootManageSharedAccessKey"}' + 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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi/subscriptions/asotest-subscription-bdlrev/rules/asotest-subrule-rvwwao?api-version=2021-11-01 + method: GET + response: + body: '{"error":{"code":"SubscriptionNotFound","message":"Rule does not exist"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "73" + Content-Type: + - application/json + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 404 Not Found + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi/subscriptions/asotest-subscription-bdlrev?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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/AuthorizationRules/asotest-rule-oiszcy?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: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi/subscriptions/asotest-subscription-bdlrev?api-version=2021-11-01 + method: GET + response: + body: '{"error":{"code":"SubscriptionNotFound","message":"Subscription does not + exist"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "81" + Content-Type: + - application/json + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 404 Not Found + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/topics/asotest-topic-uajkmi?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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/operationresults/asotest-namespace-sbjmwy?api-version=2021-11-01 + 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: 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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/operationresults/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.servicebus.windows.net:443/","status":"Removing"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "662" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy/operationresults/asotest-namespace-sbjmwy?api-version=2021-11-01 + Pragma: + - no-cache + Retry-After: + - "38" + 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: 202 Accepted + code: 202 + 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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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: + - "12" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy","name":"asotest-namespace-sbjmwy","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-sbjmwy","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-sbjmwy.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: + - "13" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-oucoat/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-sbjmwy?api-version=2021-11-01 + method: GET + response: + body: '{"error":{"message":"Namespace does not exist. CorrelationId: 1ce0b28c-d2ed-4103-9509-cb6ee782056d","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-oucoat?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPVUNPQVQtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPVUNPQVQtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPVUNPQVQtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPVUNPQVQtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPVUNPQVQtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPVUNPQVQtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPVUNPQVQtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPVUNPQVQtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPVUNPQVQtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRPVUNPQVQtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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_ServiceBus_Namespace_Standard_v1api20221001preview_CRUD.yaml b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Standard_v1api20221001preview_CRUD.yaml new file mode 100644 index 00000000000..d9bef0ce4ea --- /dev/null +++ b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Standard_v1api20221001preview_CRUD.yaml @@ -0,0 +1,1398 @@ +--- +version: 1 +interactions: +- request: + body: '{"location":"westus2","name":"asotest-rg-cmripq","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-cmripq?api-version=2020-06-01 + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq","name":"asotest-rg-cmripq","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-cmripq?api-version=2020-06-01 + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq","name":"asotest-rg-cmripq","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-njcypa","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "119" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + method: PUT + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa","name":"asotest-namespace-njcypa","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-njcypa","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-njcypa.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: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa","name":"asotest-namespace-njcypa","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-njcypa","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-njcypa.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-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa","name":"asotest-namespace-njcypa","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-njcypa","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-njcypa.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-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa","name":"asotest-namespace-njcypa","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-njcypa","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-njcypa.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-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa","name":"asotest-namespace-njcypa","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-njcypa","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-njcypa.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: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa","name":"asotest-namespace-njcypa","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Created","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-njcypa","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-njcypa.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: + - "5" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa","name":"asotest-namespace-njcypa","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-njcypa","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-njcypa.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-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa","name":"asotest-namespace-njcypa","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-njcypa","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-njcypa.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-queue-cedvvz"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "31" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/queues/asotest-queue-cedvvz?api-version=2022-10-01-preview + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/queues/asotest-queue-cedvvz","name":"asotest-queue-cedvvz","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00"}}' + 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-topic-gqyqcn"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "31" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn?api-version=2022-10-01-preview + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn","name":"asotest-topic-gqyqcn","type":"Microsoft.ServiceBus/namespaces/topics","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":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-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/queues/asotest-queue-cedvvz?api-version=2022-10-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/queues/asotest-queue-cedvvz","name":"asotest-queue-cedvvz","type":"Microsoft.ServiceBus/namespaces/queues","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"lockDuration":"PT1M","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"enableBatchedOperations":true,"duplicateDetectionHistoryTimeWindow":"PT10M","maxDeliveryCount":10,"sizeInBytes":0,"messageCount":0,"status":"Active","autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z"}}' + 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-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn?api-version=2022-10-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn","name":"asotest-topic-gqyqcn","type":"Microsoft.ServiceBus/namespaces/topics","location":"westus2","properties":{"maxMessageSizeInKilobytes":256,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","maxSizeInMegabytes":1024,"requiresDuplicateDetection":false,"duplicateDetectionHistoryTimeWindow":"PT10M","enableBatchedOperations":true,"sizeInBytes":0,"status":"Active","supportOrdering":true,"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S","enablePartitioning":false,"enableExpress":false,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","subscriptionCount":0,"countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":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-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/queues/asotest-queue-cedvvz?api-version=2022-10-01-preview + 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-subscription-djpfaw"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "38" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn/subscriptions/asotest-subscription-djpfaw?api-version=2022-10-01-preview + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn/subscriptions/asotest-subscription-djpfaw","name":"asotest-subscription-djpfaw","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westus2","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"0001-01-01T00:00:00","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' + 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-rule-gqvonv","properties":{"rights":["Listen","Send"]}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "72" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/AuthorizationRules/asotest-rule-gqvonv?api-version=2022-10-01-preview + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/AuthorizationRules/asotest-rule-gqvonv","name":"asotest-rule-gqvonv","type":"Microsoft.ServiceBus/Namespaces/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: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn/subscriptions/asotest-subscription-djpfaw?api-version=2022-10-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn/subscriptions/asotest-subscription-djpfaw","name":"asotest-subscription-djpfaw","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions","location":"westus2","properties":{"isClientAffine":false,"lockDuration":"PT1M","requiresSession":false,"defaultMessageTimeToLive":"P10675199DT2H48M5.4775807S","deadLetteringOnMessageExpiration":false,"deadLetteringOnFilterEvaluationExceptions":true,"messageCount":0,"maxDeliveryCount":10,"status":"Active","enableBatchedOperations":true,"createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","accessedAt":"2001-02-03T04:05:06Z","countDetails":{"activeMessageCount":0,"deadLetterMessageCount":0,"scheduledMessageCount":0,"transferMessageCount":0,"transferDeadLetterMessageCount":0},"autoDeleteOnIdle":"P10675199DT2H48M5.4775807S"}}' + 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: '{"location":"westus2","name":"asotest-namespace-njcypa","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "119" + Content-Type: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + method: PUT + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa","name":"asotest-namespace-njcypa","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-njcypa","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-njcypa.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: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/AuthorizationRules/asotest-rule-gqvonv?api-version=2022-10-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/authorizationrules/asotest-rule-gqvonv","name":"asotest-rule-gqvonv","type":"Microsoft.ServiceBus/Namespaces/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: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/AuthorizationRules/asotest-rule-gqvonv/listKeys?api-version=2021-11-01 + method: POST + response: + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-njcypa.servicebus.windows.net/;SharedAccessKeyName=asotest-rule-gqvonv;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-njcypa.servicebus.windows.net/;SharedAccessKeyName=asotest-rule-gqvonv;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"asotest-rule-gqvonv"}' + 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: + Test-Request-Attempt: + - "7" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa","name":"asotest-namespace-njcypa","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Updating","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-njcypa","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-njcypa.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: '{"name":"asotest-subrule-hkgrjf"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "33" + Content-Type: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn/subscriptions/asotest-subscription-djpfaw/rules/asotest-subrule-hkgrjf?api-version=2022-10-01-preview + method: PUT + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn/subscriptions/asotest-subscription-djpfaw/rules/asotest-subrule-hkgrjf","name":"asotest-subrule-hkgrjf","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westus2","properties":{"action":{},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"1=1","compatibilityLevel":20,"parameters":{}}}}' + 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-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn/subscriptions/asotest-subscription-djpfaw/rules/asotest-subrule-hkgrjf?api-version=2022-10-01-preview + method: GET + response: + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn/subscriptions/asotest-subscription-djpfaw/rules/asotest-subrule-hkgrjf","name":"asotest-subrule-hkgrjf","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westus2","properties":{"action":{},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"1=1","compatibilityLevel":20,"parameters":{}}}}' + 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: + Test-Request-Attempt: + - "8" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa","name":"asotest-namespace-njcypa","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-njcypa","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-njcypa.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: + - "9" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + method: GET + response: + body: '{"sku":{"name":"Standard","tier":"Standard"},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa","name":"asotest-namespace-njcypa","type":"Microsoft.ServiceBus/Namespaces","location":"West + US 2","tags":{},"properties":{"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"provisioningState":"Succeeded","metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-njcypa","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z","serviceBusEndpoint":"https://asotest-namespace-njcypa.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: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn/subscriptions/asotest-subscription-djpfaw/rules/asotest-subrule-hkgrjf?api-version=2022-10-01-preview + 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-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/AuthorizationRules/RootManageSharedAccessKey/listKeys?api-version=2021-11-01 + method: POST + response: + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-njcypa.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-njcypa.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"RootManageSharedAccessKey"}' + 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-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn/subscriptions/asotest-subscription-djpfaw/rules/asotest-subrule-hkgrjf?api-version=2022-10-01-preview + method: GET + response: + body: '{"error":{"code":"SubscriptionNotFound","message":"Rule does not exist"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "73" + Content-Type: + - application/json + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 404 Not Found + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn/subscriptions/asotest-subscription-djpfaw?api-version=2022-10-01-preview + 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-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/AuthorizationRules/asotest-rule-gqvonv?api-version=2022-10-01-preview + 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: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn/subscriptions/asotest-subscription-djpfaw?api-version=2022-10-01-preview + method: GET + response: + body: '{"error":{"code":"SubscriptionNotFound","message":"Subscription does not + exist"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "81" + Content-Type: + - application/json + Expires: + - "-1" + Pragma: + - no-cache + Server: + - Microsoft-HTTPAPI/2.0 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Content-Type-Options: + - nosniff + status: 404 Not Found + code: 404 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa/topics/asotest-topic-gqyqcn?api-version=2022-10-01-preview + 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-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + 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-cmripq/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-njcypa?api-version=2022-10-01-preview&resourceType=Namespace + 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: 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-cmripq/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-njcypa?api-version=2022-10-01-preview&resourceType=Namespace + 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/resourcegroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-njcypa?api-version=2022-10-01-preview&resourceType=Namespace + 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: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-njcypa?api-version=2022-10-01-preview&resourceType=Namespace + 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/resourcegroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-njcypa?api-version=2022-10-01-preview&resourceType=Namespace + 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: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-njcypa?api-version=2022-10-01-preview&resourceType=Namespace + 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/resourcegroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-njcypa?api-version=2022-10-01-preview&resourceType=Namespace + 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: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-njcypa?api-version=2022-10-01-preview&resourceType=Namespace + 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/resourcegroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-njcypa?api-version=2022-10-01-preview&resourceType=Namespace + 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: 202 Accepted + code: 202 + duration: "" +- request: + body: "" + form: {} + headers: + Test-Request-Attempt: + - "4" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asotest-rg-cmripq/providers/Microsoft.ServiceBus/locations/westus2/operationStatus/asotest-namespace-njcypa?api-version=2022-10-01-preview&resourceType=Namespace + method: GET + response: + body: "" + headers: + Cache-Control: + - no-cache + 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: 204 No Content + code: 204 + 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-cmripq/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa?api-version=2022-10-01-preview + method: GET + response: + body: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.ServiceBus/namespaces/asotest-namespace-njcypa'' + under resource group ''asotest-rg-cmripq'' was not found. For more details please + go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "245" + 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-cmripq?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRDTVJJUFEtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRDTVJJUFEtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?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/samples/servicebus/v1api/v1api20210101preview_namespace.yaml b/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespace.yaml similarity index 100% rename from v2/samples/servicebus/v1api/v1api20210101preview_namespace.yaml rename to v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespace.yaml diff --git a/v2/samples/servicebus/v1api/v1api20210101preview_namespacesauthorizationrule.yaml b/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacesauthorizationrule.yaml similarity index 100% rename from v2/samples/servicebus/v1api/v1api20210101preview_namespacesauthorizationrule.yaml rename to v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacesauthorizationrule.yaml diff --git a/v2/samples/servicebus/v1api/v1api20210101preview_namespacesqueue.yaml b/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacesqueue.yaml similarity index 100% rename from v2/samples/servicebus/v1api/v1api20210101preview_namespacesqueue.yaml rename to v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacesqueue.yaml diff --git a/v2/samples/servicebus/v1api/v1api20210101preview_namespacestopic.yaml b/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacestopic.yaml similarity index 100% rename from v2/samples/servicebus/v1api/v1api20210101preview_namespacestopic.yaml rename to v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacestopic.yaml diff --git a/v2/samples/servicebus/v1api/v1api20210101preview_namespacestopicssubscription.yaml b/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacestopicssubscription.yaml similarity index 100% rename from v2/samples/servicebus/v1api/v1api20210101preview_namespacestopicssubscription.yaml rename to v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacestopicssubscription.yaml diff --git a/v2/samples/servicebus/v1api/v1api20210101preview_namespacestopicssubscriptionsrule.yaml b/v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacestopicssubscriptionsrule.yaml similarity index 100% rename from v2/samples/servicebus/v1api/v1api20210101preview_namespacestopicssubscriptionsrule.yaml rename to v2/samples/servicebus/v1api20210101preview/v1api20210101preview_namespacestopicssubscriptionsrule.yaml diff --git a/v2/samples/servicebus/v1api20211101/v1api20211101_namespace.yaml b/v2/samples/servicebus/v1api20211101/v1api20211101_namespace.yaml new file mode 100644 index 00000000000..8cba1ff152c --- /dev/null +++ b/v2/samples/servicebus/v1api20211101/v1api20211101_namespace.yaml @@ -0,0 +1,13 @@ +apiVersion: servicebus.azure.com/v1api20211101 +kind: Namespace +metadata: + name: aso-namespace + namespace: default +spec: + disableLocalAuth: true + location: westcentralus + owner: + name: aso-sample-rg + sku: + name: Standard + zoneRedundant: false diff --git a/v2/samples/servicebus/v1api20211101/v1api20211101_namespacesauthorizationrule.yaml b/v2/samples/servicebus/v1api20211101/v1api20211101_namespacesauthorizationrule.yaml new file mode 100644 index 00000000000..8c6497f9b03 --- /dev/null +++ b/v2/samples/servicebus/v1api20211101/v1api20211101_namespacesauthorizationrule.yaml @@ -0,0 +1,25 @@ +apiVersion: servicebus.azure.com/v1api20211101 +kind: NamespacesAuthorizationRule +metadata: + name: aso-namespace-rule + namespace: default +spec: + owner: + name: aso-namespace + rights: + - Listen + - Send + operatorSpec: + secrets: + primaryKey: + name: authsecret + key: primaryKey + primaryConnectionString: + name: authsecret + key: primaryConnectionString + secondaryKey: + name: authsecret + key: secondaryKey + secondaryConnectionString: + name: authsecret + key: secondaryConnectionString diff --git a/v2/samples/servicebus/v1api20211101/v1api20211101_namespacesqueue.yaml b/v2/samples/servicebus/v1api20211101/v1api20211101_namespacesqueue.yaml new file mode 100644 index 00000000000..fd2a5a5d198 --- /dev/null +++ b/v2/samples/servicebus/v1api20211101/v1api20211101_namespacesqueue.yaml @@ -0,0 +1,8 @@ +apiVersion: servicebus.azure.com/v1api20211101 +kind: NamespacesQueue +metadata: + name: samplequeue + namespace: default +spec: + owner: + name: aso-namespace diff --git a/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopic.yaml b/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopic.yaml new file mode 100644 index 00000000000..bb117e6bab9 --- /dev/null +++ b/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopic.yaml @@ -0,0 +1,8 @@ +apiVersion: servicebus.azure.com/v1api20211101 +kind: NamespacesTopic +metadata: + name: sampletopic + namespace: default +spec: + owner: + name: aso-namespace diff --git a/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopicssubscription.yaml b/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopicssubscription.yaml new file mode 100644 index 00000000000..e11805d9d34 --- /dev/null +++ b/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopicssubscription.yaml @@ -0,0 +1,8 @@ +apiVersion: servicebus.azure.com/v1api20211101 +kind: NamespacesTopicsSubscription +metadata: + name: sampletopicsubscription + namespace: default +spec: + owner: + name: sampletopic diff --git a/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopicssubscriptionsrule.yaml b/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopicssubscriptionsrule.yaml new file mode 100644 index 00000000000..426e99e5f4f --- /dev/null +++ b/v2/samples/servicebus/v1api20211101/v1api20211101_namespacestopicssubscriptionsrule.yaml @@ -0,0 +1,17 @@ +apiVersion: servicebus.azure.com/v1api20211101 +kind: NamespacesTopicsSubscriptionsRule +metadata: + name: samplesubscriptionsrule + namespace: default +spec: + owner: + name: sampletopicsubscription + action: + sqlExpression: "SET myproperty=myvalue" + requiresPreprocessing: false + compatibilityLevel: 20 + correlationFilter: + contentType: text + filterType: SqlFilter + sqlFilter: + sqlExpression: "StoreId IN ('Store1','Store2','Store3')" diff --git a/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespace.yaml b/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespace.yaml new file mode 100644 index 00000000000..3394e23d335 --- /dev/null +++ b/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespace.yaml @@ -0,0 +1,12 @@ +apiVersion: servicebus.azure.com/v1api20210101preview +kind: Namespace +metadata: + name: aso-namespace + namespace: default +spec: + location: westcentralus + owner: + name: aso-sample-rg + sku: + name: Standard + zoneRedundant: false diff --git a/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacesauthorizationrule.yaml b/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacesauthorizationrule.yaml new file mode 100644 index 00000000000..33944cb9a80 --- /dev/null +++ b/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacesauthorizationrule.yaml @@ -0,0 +1,25 @@ +apiVersion: servicebus.azure.com/v1api20210101preview +kind: NamespacesAuthorizationRule +metadata: + name: aso-namespace-rule + namespace: default +spec: + owner: + name: aso-namespace + rights: + - Listen + - Send + operatorSpec: + secrets: + primaryKey: + name: authsecret + key: primaryKey + primaryConnectionString: + name: authsecret + key: primaryConnectionString + secondaryKey: + name: authsecret + key: secondaryKey + secondaryConnectionString: + name: authsecret + key: secondaryConnectionString diff --git a/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacesqueue.yaml b/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacesqueue.yaml new file mode 100644 index 00000000000..d98bf9064c6 --- /dev/null +++ b/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacesqueue.yaml @@ -0,0 +1,8 @@ +apiVersion: servicebus.azure.com/v1api20210101preview +kind: NamespacesQueue +metadata: + name: samplequeue + namespace: default +spec: + owner: + name: aso-namespace diff --git a/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopic.yaml b/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopic.yaml new file mode 100644 index 00000000000..9c08efd1678 --- /dev/null +++ b/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopic.yaml @@ -0,0 +1,8 @@ +apiVersion: servicebus.azure.com/v1api20210101preview +kind: NamespacesTopic +metadata: + name: sampletopic + namespace: default +spec: + owner: + name: aso-namespace diff --git a/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopicssubscription.yaml b/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopicssubscription.yaml new file mode 100644 index 00000000000..ab8482ffa00 --- /dev/null +++ b/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopicssubscription.yaml @@ -0,0 +1,8 @@ +apiVersion: servicebus.azure.com/v1api20210101preview +kind: NamespacesTopicsSubscription +metadata: + name: sampletopicsubscription + namespace: default +spec: + owner: + name: sampletopic diff --git a/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopicssubscriptionsrule.yaml b/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopicssubscriptionsrule.yaml new file mode 100644 index 00000000000..49047310e1b --- /dev/null +++ b/v2/samples/servicebus/v1api20221001preview/v1api20221001preview_namespacestopicssubscriptionsrule.yaml @@ -0,0 +1,17 @@ +apiVersion: servicebus.azure.com/v1api20210101preview +kind: NamespacesTopicsSubscriptionsRule +metadata: + name: samplesubscriptionsrule + namespace: default +spec: + owner: + name: sampletopicsubscription + action: + sqlExpression: "SET myproperty=myvalue" + requiresPreprocessing: false + compatibilityLevel: 20 + correlationFilter: + contentType: text + filterType: SqlFilter + sqlFilter: + sqlExpression: "StoreId IN ('Store1','Store2','Store3')"