diff --git a/docs/hugo/content/reference/_index.md b/docs/hugo/content/reference/_index.md index 095457e0f35..b6d7e81af17 100644 --- a/docs/hugo/content/reference/_index.md +++ b/docs/hugo/content/reference/_index.md @@ -736,6 +736,19 @@ 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 | 2024-01-01 | v1api20240101 | v2.12.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20240101/v1api20240101_namespace.yaml) | +| NamespacesAuthorizationRule | 2024-01-01 | v1api20240101 | v2.12.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20240101/v1api20240101_namespacesauthorizationrule.yaml) | +| NamespacesQueue | 2024-01-01 | v1api20240101 | v2.12.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20240101/v1api20240101_namespacesqueue.yaml) | +| NamespacesTopic | 2024-01-01 | v1api20240101 | v2.12.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20240101/v1api20240101_namespacestopic.yaml) | +| NamespacesTopicsSubscription | 2024-01-01 | v1api20240101 | v2.12.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20240101/v1api20240101_namespacestopicssubscription.yaml) | +| NamespacesTopicsSubscriptionsRule | 2024-01-01 | v1api20240101 | v2.12.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20240101/v1api20240101_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. diff --git a/docs/hugo/content/reference/servicebus/_index.md b/docs/hugo/content/reference/servicebus/_index.md index 7d8589f7a61..b6b1c3971b6 100644 --- a/docs/hugo/content/reference/servicebus/_index.md +++ b/docs/hugo/content/reference/servicebus/_index.md @@ -5,6 +5,19 @@ 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 | 2024-01-01 | v1api20240101 | v2.12.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20240101/v1api20240101_namespace.yaml) | +| NamespacesAuthorizationRule | 2024-01-01 | v1api20240101 | v2.12.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20240101/v1api20240101_namespacesauthorizationrule.yaml) | +| NamespacesQueue | 2024-01-01 | v1api20240101 | v2.12.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20240101/v1api20240101_namespacesqueue.yaml) | +| NamespacesTopic | 2024-01-01 | v1api20240101 | v2.12.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20240101/v1api20240101_namespacestopic.yaml) | +| NamespacesTopicsSubscription | 2024-01-01 | v1api20240101 | v2.12.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20240101/v1api20240101_namespacestopicssubscription.yaml) | +| NamespacesTopicsSubscriptionsRule | 2024-01-01 | v1api20240101 | v2.12.0 | [View](https://github.com/Azure/azure-service-operator/tree/main/v2/samples/servicebus/v1api20240101/v1api20240101_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. diff --git a/v2/api/servicebus/customizations/namespace_extension_types_gen.go b/v2/api/servicebus/customizations/namespace_extension_types_gen.go index 3ffe777e084..ee3d1dfcc9f 100644 --- a/v2/api/servicebus/customizations/namespace_extension_types_gen.go +++ b/v2/api/servicebus/customizations/namespace_extension_types_gen.go @@ -10,6 +10,8 @@ import ( v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview/storage" + v20240101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -24,5 +26,7 @@ func (extension *NamespaceExtension) GetExtendedResources() []genruntime.Kuberne &v20211101.Namespace{}, &v20211101s.Namespace{}, &v20221001p.Namespace{}, - &v20221001ps.Namespace{}} + &v20221001ps.Namespace{}, + &v20240101.Namespace{}, + &v20240101s.Namespace{}} } diff --git a/v2/api/servicebus/customizations/namespace_extensions.go b/v2/api/servicebus/customizations/namespace_extensions.go index f266d530be3..4f0b49fc03a 100644 --- a/v2/api/servicebus/customizations/namespace_extensions.go +++ b/v2/api/servicebus/customizations/namespace_extensions.go @@ -16,7 +16,7 @@ import ( v1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/conversion" - servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/internal/genericarmclient" "github.com/Azure/azure-service-operator/v2/internal/set" "github.com/Azure/azure-service-operator/v2/internal/util/to" diff --git a/v2/api/servicebus/customizations/namespace_extensions_test.go b/v2/api/servicebus/customizations/namespace_extensions_test.go index 4ccd49c1609..d540bd00f37 100644 --- a/v2/api/servicebus/customizations/namespace_extensions_test.go +++ b/v2/api/servicebus/customizations/namespace_extensions_test.go @@ -11,7 +11,7 @@ import ( . "github.com/onsi/gomega" - servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" testreflect "github.com/Azure/azure-service-operator/v2/internal/testcommon/reflect" ) 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 6bd596fc765..dbbcc57d875 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 @@ -10,6 +10,8 @@ import ( v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview/storage" + v20240101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -24,5 +26,7 @@ func (extension *NamespacesAuthorizationRuleExtension) GetExtendedResources() [] &v20211101.NamespacesAuthorizationRule{}, &v20211101s.NamespacesAuthorizationRule{}, &v20221001p.NamespacesAuthorizationRule{}, - &v20221001ps.NamespacesAuthorizationRule{}} + &v20221001ps.NamespacesAuthorizationRule{}, + &v20240101.NamespacesAuthorizationRule{}, + &v20240101s.NamespacesAuthorizationRule{}} } diff --git a/v2/api/servicebus/customizations/namespaces_authorization_rule_extensions.go b/v2/api/servicebus/customizations/namespaces_authorization_rule_extensions.go index da88b4f8be7..8f1b8d3ec0f 100644 --- a/v2/api/servicebus/customizations/namespaces_authorization_rule_extensions.go +++ b/v2/api/servicebus/customizations/namespaces_authorization_rule_extensions.go @@ -16,7 +16,7 @@ import ( v1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/conversion" - servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/internal/genericarmclient" "github.com/Azure/azure-service-operator/v2/internal/set" "github.com/Azure/azure-service-operator/v2/internal/util/to" diff --git a/v2/api/servicebus/customizations/namespaces_authorization_rule_extensions_test.go b/v2/api/servicebus/customizations/namespaces_authorization_rule_extensions_test.go index 12e9f6698d1..eda18642588 100644 --- a/v2/api/servicebus/customizations/namespaces_authorization_rule_extensions_test.go +++ b/v2/api/servicebus/customizations/namespaces_authorization_rule_extensions_test.go @@ -11,7 +11,7 @@ import ( . "github.com/onsi/gomega" - servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + servicebus "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" testreflect "github.com/Azure/azure-service-operator/v2/internal/testcommon/reflect" ) 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 a08f4a010bc..d82caadfb70 100644 --- a/v2/api/servicebus/customizations/namespaces_queue_extension_types_gen.go +++ b/v2/api/servicebus/customizations/namespaces_queue_extension_types_gen.go @@ -10,6 +10,8 @@ import ( v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview/storage" + v20240101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -24,5 +26,7 @@ func (extension *NamespacesQueueExtension) GetExtendedResources() []genruntime.K &v20211101.NamespacesQueue{}, &v20211101s.NamespacesQueue{}, &v20221001p.NamespacesQueue{}, - &v20221001ps.NamespacesQueue{}} + &v20221001ps.NamespacesQueue{}, + &v20240101.NamespacesQueue{}, + &v20240101s.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 d57f81c7577..8b2e2fda1e9 100644 --- a/v2/api/servicebus/customizations/namespaces_topic_extension_types_gen.go +++ b/v2/api/servicebus/customizations/namespaces_topic_extension_types_gen.go @@ -10,6 +10,8 @@ import ( v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview/storage" + v20240101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -24,5 +26,7 @@ func (extension *NamespacesTopicExtension) GetExtendedResources() []genruntime.K &v20211101.NamespacesTopic{}, &v20211101s.NamespacesTopic{}, &v20221001p.NamespacesTopic{}, - &v20221001ps.NamespacesTopic{}} + &v20221001ps.NamespacesTopic{}, + &v20240101.NamespacesTopic{}, + &v20240101s.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 1f39bc9d393..0a4b88635d4 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 @@ -10,6 +10,8 @@ import ( v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview/storage" + v20240101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -24,5 +26,7 @@ func (extension *NamespacesTopicsSubscriptionExtension) GetExtendedResources() [ &v20211101.NamespacesTopicsSubscription{}, &v20211101s.NamespacesTopicsSubscription{}, &v20221001p.NamespacesTopicsSubscription{}, - &v20221001ps.NamespacesTopicsSubscription{}} + &v20221001ps.NamespacesTopicsSubscription{}, + &v20240101.NamespacesTopicsSubscription{}, + &v20240101s.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 8149258b4f0..d11d52f9235 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 @@ -10,6 +10,8 @@ import ( v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview/storage" + v20240101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" ) @@ -24,5 +26,7 @@ func (extension *NamespacesTopicsSubscriptionsRuleExtension) GetExtendedResource &v20211101.NamespacesTopicsSubscriptionsRule{}, &v20211101s.NamespacesTopicsSubscriptionsRule{}, &v20221001p.NamespacesTopicsSubscriptionsRule{}, - &v20221001ps.NamespacesTopicsSubscriptionsRule{}} + &v20221001ps.NamespacesTopicsSubscriptionsRule{}, + &v20240101.NamespacesTopicsSubscriptionsRule{}, + &v20240101s.NamespacesTopicsSubscriptionsRule{}} } diff --git a/v2/api/servicebus/v1api20210101preview/namespace_types_gen_test.go b/v2/api/servicebus/v1api20210101preview/namespace_types_gen_test.go index c3855a0fba9..32953a42bda 100644 --- a/v2/api/servicebus/v1api20210101preview/namespace_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/namespace_types_gen_test.go @@ -6,7 +6,7 @@ package v1api20210101preview import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview/storage" - v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -856,7 +856,7 @@ func RunResourceConversionTestForNamespace(subject Namespace) string { copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.Namespace + var hub v20240101s.Namespace err := copied.ConvertTo(&hub) if err != nil { return err.Error() 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 1e1be7c50bf..687a2f3e828 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,7 +6,7 @@ package v1api20210101preview import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview/storage" - v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -37,7 +37,7 @@ func RunResourceConversionTestForNamespacesAuthorizationRule(subject NamespacesA copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesAuthorizationRule + var hub v20240101s.NamespacesAuthorizationRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() 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 903f9cdf7a0..9e0ab7ffdeb 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_queue_types_gen_test.go @@ -6,7 +6,7 @@ package v1api20210101preview import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview/storage" - v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -144,7 +144,7 @@ func RunResourceConversionTestForNamespacesQueue(subject NamespacesQueue) string copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesQueue + var hub v20240101s.NamespacesQueue err := copied.ConvertTo(&hub) if err != nil { return err.Error() 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 08537d97f57..3c909e3169a 100644 --- a/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/namespaces_topic_types_gen_test.go @@ -6,7 +6,7 @@ package v1api20210101preview import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview/storage" - v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -37,7 +37,7 @@ func RunResourceConversionTestForNamespacesTopic(subject NamespacesTopic) string copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesTopic + var hub v20240101s.NamespacesTopic err := copied.ConvertTo(&hub) if err != nil { return err.Error() 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 889e7802eaf..5c95c917ca8 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,7 +6,7 @@ package v1api20210101preview import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview/storage" - v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -37,7 +37,7 @@ func RunResourceConversionTestForNamespacesTopicsSubscription(subject Namespaces copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesTopicsSubscription + var hub v20240101s.NamespacesTopicsSubscription err := copied.ConvertTo(&hub) if err != nil { return err.Error() 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 a2f925f9510..b289494f879 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,7 +6,7 @@ package v1api20210101preview import ( "encoding/json" v20210101ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20210101preview/storage" - v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -472,7 +472,7 @@ func RunResourceConversionTestForNamespacesTopicsSubscriptionsRule(subject Names copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesTopicsSubscriptionsRule + var hub v20240101s.NamespacesTopicsSubscriptionsRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespace_types_gen.go b/v2/api/servicebus/v1api20210101preview/storage/namespace_types_gen.go index 61b53468327..23486deddaa 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespace_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespace_types_gen.go @@ -4,7 +4,6 @@ package storage import ( - "fmt" storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -50,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.(*storage.Namespace) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/Namespace but received %T instead", hub) + // intermediate variable for conversion + var source storage.Namespace + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = namespace.AssignProperties_From_Namespace(&source) + if err != nil { + return eris.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.(*storage.Namespace) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/Namespace but received %T instead", hub) + // intermediate variable for conversion + var destination storage.Namespace + err := namespace.AssignProperties_To_Namespace(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from namespace") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return namespace.AssignProperties_To_Namespace(destination) + return nil } var _ configmaps.Exporter = &Namespace{} diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespace_types_gen_test.go b/v2/api/servicebus/v1api20210101preview/storage/namespace_types_gen_test.go index 4b50846c0a7..48cfa71e375 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespace_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespace_types_gen_test.go @@ -5,7 +5,8 @@ package storage import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -35,7 +36,7 @@ func RunPropertyAssignmentTestForDictionaryValue_STATUS(subject DictionaryValue_ copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.UserAssignedIdentity_STATUS + var other v20211101s.UserAssignedIdentity_STATUS err := copied.AssignProperties_To_UserAssignedIdentity_STATUS(&other) if err != nil { return err.Error() @@ -139,7 +140,7 @@ func RunPropertyAssignmentTestForEncryption(subject Encryption) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Encryption + var other v20211101s.Encryption err := copied.AssignProperties_To_Encryption(&other) if err != nil { return err.Error() @@ -256,7 +257,7 @@ func RunPropertyAssignmentTestForEncryption_STATUS(subject Encryption_STATUS) st copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Encryption_STATUS + var other v20211101s.Encryption_STATUS err := copied.AssignProperties_To_Encryption_STATUS(&other) if err != nil { return err.Error() @@ -373,7 +374,7 @@ func RunPropertyAssignmentTestForIdentity(subject Identity) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Identity + var other v20211101s.Identity err := copied.AssignProperties_To_Identity(&other) if err != nil { return err.Error() @@ -489,7 +490,7 @@ func RunPropertyAssignmentTestForIdentity_STATUS(subject Identity_STATUS) string copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Identity_STATUS + var other v20211101s.Identity_STATUS err := copied.AssignProperties_To_Identity_STATUS(&other) if err != nil { return err.Error() @@ -609,7 +610,7 @@ func RunPropertyAssignmentTestForKeyVaultProperties(subject KeyVaultProperties) copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.KeyVaultProperties + var other v20211101s.KeyVaultProperties err := copied.AssignProperties_To_KeyVaultProperties(&other) if err != nil { return err.Error() @@ -727,7 +728,7 @@ func RunPropertyAssignmentTestForKeyVaultProperties_STATUS(subject KeyVaultPrope copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.KeyVaultProperties_STATUS + var other v20211101s.KeyVaultProperties_STATUS err := copied.AssignProperties_To_KeyVaultProperties_STATUS(&other) if err != nil { return err.Error() @@ -847,7 +848,7 @@ func RunResourceConversionTestForNamespace(subject Namespace) string { copied := subject.DeepCopy() // Convert to our hub version - var hub storage.Namespace + var hub v20240101s.Namespace err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -889,7 +890,7 @@ func RunPropertyAssignmentTestForNamespace(subject Namespace) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Namespace + var other v20211101s.Namespace err := copied.AssignProperties_To_Namespace(&other) if err != nil { return err.Error() @@ -992,7 +993,7 @@ func RunPropertyAssignmentTestForNamespaceOperatorSecrets(subject NamespaceOpera copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespaceOperatorSecrets + var other v20211101s.NamespaceOperatorSecrets err := copied.AssignProperties_To_NamespaceOperatorSecrets(&other) if err != nil { return err.Error() @@ -1089,7 +1090,7 @@ func RunPropertyAssignmentTestForNamespaceOperatorSpec(subject NamespaceOperator copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespaceOperatorSpec + var other v20211101s.NamespaceOperatorSpec err := copied.AssignProperties_To_NamespaceOperatorSpec(&other) if err != nil { return err.Error() @@ -1192,7 +1193,7 @@ func RunPropertyAssignmentTestForNamespace_STATUS(subject Namespace_STATUS) stri copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Namespace_STATUS + var other v20211101s.Namespace_STATUS err := copied.AssignProperties_To_Namespace_STATUS(&other) if err != nil { return err.Error() @@ -1325,7 +1326,7 @@ func RunPropertyAssignmentTestForNamespace_Spec(subject Namespace_Spec) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Namespace_Spec + var other v20211101s.Namespace_Spec err := copied.AssignProperties_To_Namespace_Spec(&other) if err != nil { return err.Error() @@ -1450,7 +1451,7 @@ func RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS(subject Privat copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.PrivateEndpointConnection_STATUS + var other v20211101s.PrivateEndpointConnection_STATUS err := copied.AssignProperties_To_PrivateEndpointConnection_STATUS(&other) if err != nil { return err.Error() @@ -1553,7 +1554,7 @@ func RunPropertyAssignmentTestForSBSku(subject SBSku) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SBSku + var other v20211101s.SBSku err := copied.AssignProperties_To_SBSku(&other) if err != nil { return err.Error() @@ -1657,7 +1658,7 @@ func RunPropertyAssignmentTestForSBSku_STATUS(subject SBSku_STATUS) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SBSku_STATUS + var other v20211101s.SBSku_STATUS err := copied.AssignProperties_To_SBSku_STATUS(&other) if err != nil { return err.Error() @@ -1761,7 +1762,7 @@ func RunPropertyAssignmentTestForSystemData_STATUS(subject SystemData_STATUS) st copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SystemData_STATUS + var other v20211101s.SystemData_STATUS err := copied.AssignProperties_To_SystemData_STATUS(&other) if err != nil { return err.Error() @@ -1868,7 +1869,7 @@ func RunPropertyAssignmentTestForUserAssignedIdentityDetails(subject UserAssigne copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.UserAssignedIdentityDetails + var other v20211101s.UserAssignedIdentityDetails err := copied.AssignProperties_To_UserAssignedIdentityDetails(&other) if err != nil { return err.Error() @@ -1965,7 +1966,7 @@ func RunPropertyAssignmentTestForUserAssignedIdentityProperties(subject UserAssi copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.UserAssignedIdentityProperties + var other v20211101s.UserAssignedIdentityProperties err := copied.AssignProperties_To_UserAssignedIdentityProperties(&other) if err != nil { return err.Error() @@ -2062,7 +2063,7 @@ func RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS(subject U copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.UserAssignedIdentityProperties_STATUS + var other v20211101s.UserAssignedIdentityProperties_STATUS err := copied.AssignProperties_To_UserAssignedIdentityProperties_STATUS(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_authorization_rule_types_gen.go index 6b890c45220..ecba55a495f 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_authorization_rule_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_authorization_rule_types_gen.go @@ -4,7 +4,6 @@ package storage import ( - "fmt" storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -50,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.(*storage.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesAuthorizationRule but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesAuthorizationRule + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = rule.AssignProperties_From_NamespacesAuthorizationRule(&source) + if err != nil { + return eris.Wrap(err, "converting from source to rule") } - return rule.AssignProperties_From_NamespacesAuthorizationRule(source) + return nil } // ConvertTo populates the provided hub NamespacesAuthorizationRule from our NamespacesAuthorizationRule func (rule *NamespacesAuthorizationRule) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*storage.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesAuthorizationRule but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesAuthorizationRule + err := rule.AssignProperties_To_NamespacesAuthorizationRule(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from rule") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) + return nil } var _ configmaps.Exporter = &NamespacesAuthorizationRule{} diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_authorization_rule_types_gen_test.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_authorization_rule_types_gen_test.go index e6557fe00ef..bbf28919b4c 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_authorization_rule_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_authorization_rule_types_gen_test.go @@ -5,7 +5,8 @@ package storage import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesAuthorizationRule(subject NamespacesA copied := subject.DeepCopy() // Convert to our hub version - var hub storage.NamespacesAuthorizationRule + var hub v20240101s.NamespacesAuthorizationRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -78,7 +79,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRule(subject NamespacesA copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRule + var other v20211101s.NamespacesAuthorizationRule err := copied.AssignProperties_To_NamespacesAuthorizationRule(&other) if err != nil { return err.Error() @@ -182,7 +183,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets(subj copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRuleOperatorSecrets + var other v20211101s.NamespacesAuthorizationRuleOperatorSecrets err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&other) if err != nil { return err.Error() @@ -279,7 +280,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec(subject copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRuleOperatorSpec + var other v20211101s.NamespacesAuthorizationRuleOperatorSpec err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&other) if err != nil { return err.Error() @@ -382,7 +383,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRule_STATUS(subject Name copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRule_STATUS + var other v20211101s.NamespacesAuthorizationRule_STATUS err := copied.AssignProperties_To_NamespacesAuthorizationRule_STATUS(&other) if err != nil { return err.Error() @@ -502,7 +503,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRule_Spec(subject Namesp copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRule_Spec + var other v20211101s.NamespacesAuthorizationRule_Spec err := copied.AssignProperties_To_NamespacesAuthorizationRule_Spec(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_queue_types_gen.go index 8c6d96236a8..a7109faa366 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_queue_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_queue_types_gen.go @@ -4,7 +4,6 @@ package storage import ( - "fmt" storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -50,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.(*storage.NamespacesQueue) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesQueue but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesQueue + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = queue.AssignProperties_From_NamespacesQueue(&source) + if err != nil { + return eris.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.(*storage.NamespacesQueue) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesQueue but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesQueue + err := queue.AssignProperties_To_NamespacesQueue(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from queue") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return queue.AssignProperties_To_NamespacesQueue(destination) + return nil } var _ configmaps.Exporter = &NamespacesQueue{} diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_queue_types_gen_test.go index 60aa9aaaeae..5edfb83db69 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_queue_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_queue_types_gen_test.go @@ -5,7 +5,8 @@ package storage import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -35,7 +36,7 @@ func RunPropertyAssignmentTestForMessageCountDetails_STATUS(subject MessageCount copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.MessageCountDetails_STATUS + var other v20211101s.MessageCountDetails_STATUS err := copied.AssignProperties_To_MessageCountDetails_STATUS(&other) if err != nil { return err.Error() @@ -143,7 +144,7 @@ func RunResourceConversionTestForNamespacesQueue(subject NamespacesQueue) string copied := subject.DeepCopy() // Convert to our hub version - var hub storage.NamespacesQueue + var hub v20240101s.NamespacesQueue err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -185,7 +186,7 @@ func RunPropertyAssignmentTestForNamespacesQueue(subject NamespacesQueue) string copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesQueue + var other v20211101s.NamespacesQueue err := copied.AssignProperties_To_NamespacesQueue(&other) if err != nil { return err.Error() @@ -288,7 +289,7 @@ func RunPropertyAssignmentTestForNamespacesQueueOperatorSpec(subject NamespacesQ copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesQueueOperatorSpec + var other v20211101s.NamespacesQueueOperatorSpec err := copied.AssignProperties_To_NamespacesQueueOperatorSpec(&other) if err != nil { return err.Error() @@ -385,7 +386,7 @@ func RunPropertyAssignmentTestForNamespacesQueue_STATUS(subject NamespacesQueue_ copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesQueue_STATUS + var other v20211101s.NamespacesQueue_STATUS err := copied.AssignProperties_To_NamespacesQueue_STATUS(&other) if err != nil { return err.Error() @@ -525,7 +526,7 @@ func RunPropertyAssignmentTestForNamespacesQueue_Spec(subject NamespacesQueue_Sp copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesQueue_Spec + var other v20211101s.NamespacesQueue_Spec err := copied.AssignProperties_To_NamespacesQueue_Spec(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topic_types_gen.go index c651a990432..b83cdeec9af 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topic_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topic_types_gen.go @@ -4,7 +4,6 @@ package storage import ( - "fmt" storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -50,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.(*storage.NamespacesTopic) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopic but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesTopic + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = topic.AssignProperties_From_NamespacesTopic(&source) + if err != nil { + return eris.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.(*storage.NamespacesTopic) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopic but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesTopic + err := topic.AssignProperties_To_NamespacesTopic(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from topic") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return topic.AssignProperties_To_NamespacesTopic(destination) + return nil } var _ configmaps.Exporter = &NamespacesTopic{} diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topic_types_gen_test.go index 5336e078278..fa68be1a4f3 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topic_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topic_types_gen_test.go @@ -5,7 +5,8 @@ package storage import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "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 storage.NamespacesTopic + var hub v20240101s.NamespacesTopic err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -78,7 +79,7 @@ func RunPropertyAssignmentTestForNamespacesTopic(subject NamespacesTopic) string copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopic + var other v20211101s.NamespacesTopic err := copied.AssignProperties_To_NamespacesTopic(&other) if err != nil { return err.Error() @@ -181,7 +182,7 @@ func RunPropertyAssignmentTestForNamespacesTopicOperatorSpec(subject NamespacesT copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicOperatorSpec + var other v20211101s.NamespacesTopicOperatorSpec err := copied.AssignProperties_To_NamespacesTopicOperatorSpec(&other) if err != nil { return err.Error() @@ -278,7 +279,7 @@ func RunPropertyAssignmentTestForNamespacesTopic_STATUS(subject NamespacesTopic_ copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopic_STATUS + var other v20211101s.NamespacesTopic_STATUS err := copied.AssignProperties_To_NamespacesTopic_STATUS(&other) if err != nil { return err.Error() @@ -413,7 +414,7 @@ func RunPropertyAssignmentTestForNamespacesTopic_Spec(subject NamespacesTopic_Sp copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopic_Spec + var other v20211101s.NamespacesTopic_Spec err := copied.AssignProperties_To_NamespacesTopic_Spec(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscription_types_gen.go index cf30aa04ff5..f9dda201da1 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscription_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscription_types_gen.go @@ -4,7 +4,6 @@ package storage import ( - "fmt" storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -50,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.(*storage.NamespacesTopicsSubscription) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopicsSubscription but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesTopicsSubscription + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = subscription.AssignProperties_From_NamespacesTopicsSubscription(&source) + if err != nil { + return eris.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.(*storage.NamespacesTopicsSubscription) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopicsSubscription but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesTopicsSubscription + err := subscription.AssignProperties_To_NamespacesTopicsSubscription(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from subscription") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return subscription.AssignProperties_To_NamespacesTopicsSubscription(destination) + return nil } var _ configmaps.Exporter = &NamespacesTopicsSubscription{} diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscription_types_gen_test.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscription_types_gen_test.go index 6b0e4364ab2..2f7cc5eccc6 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscription_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscription_types_gen_test.go @@ -5,7 +5,8 @@ package storage import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "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 storage.NamespacesTopicsSubscription + var hub v20240101s.NamespacesTopicsSubscription err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -78,7 +79,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscription(subject Namespaces copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscription + var other v20211101s.NamespacesTopicsSubscription err := copied.AssignProperties_To_NamespacesTopicsSubscription(&other) if err != nil { return err.Error() @@ -182,7 +183,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionOperatorSpec(subjec copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionOperatorSpec + var other v20211101s.NamespacesTopicsSubscriptionOperatorSpec err := copied.AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec(&other) if err != nil { return err.Error() @@ -279,7 +280,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscription_STATUS(subject Nam copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscription_STATUS + var other v20211101s.NamespacesTopicsSubscription_STATUS err := copied.AssignProperties_To_NamespacesTopicsSubscription_STATUS(&other) if err != nil { return err.Error() @@ -415,7 +416,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscription_Spec(subject Names copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscription_Spec + var other v20211101s.NamespacesTopicsSubscription_Spec err := copied.AssignProperties_To_NamespacesTopicsSubscription_Spec(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscriptions_rule_types_gen.go index d2dd46189fe..a2f341aee4a 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscriptions_rule_types_gen.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscriptions_rule_types_gen.go @@ -4,7 +4,6 @@ package storage import ( - "fmt" storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -50,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.(*storage.NamespacesTopicsSubscriptionsRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesTopicsSubscriptionsRule + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule(&source) + if err != nil { + return eris.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.(*storage.NamespacesTopicsSubscriptionsRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesTopicsSubscriptionsRule + err := rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from rule") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(destination) + return nil } var _ configmaps.Exporter = &NamespacesTopicsSubscriptionsRule{} diff --git a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscriptions_rule_types_gen_test.go b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscriptions_rule_types_gen_test.go index 0ae83cb6f18..c6aa82aa159 100644 --- a/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscriptions_rule_types_gen_test.go +++ b/v2/api/servicebus/v1api20210101preview/storage/namespaces_topics_subscriptions_rule_types_gen_test.go @@ -5,7 +5,8 @@ package storage import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -35,7 +36,7 @@ func RunPropertyAssignmentTestForAction(subject Action) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Action + var other v20211101s.Action err := copied.AssignProperties_To_Action(&other) if err != nil { return err.Error() @@ -139,7 +140,7 @@ func RunPropertyAssignmentTestForAction_STATUS(subject Action_STATUS) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Action_STATUS + var other v20211101s.Action_STATUS err := copied.AssignProperties_To_Action_STATUS(&other) if err != nil { return err.Error() @@ -243,7 +244,7 @@ func RunPropertyAssignmentTestForCorrelationFilter(subject CorrelationFilter) st copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.CorrelationFilter + var other v20211101s.CorrelationFilter err := copied.AssignProperties_To_CorrelationFilter(&other) if err != nil { return err.Error() @@ -356,7 +357,7 @@ func RunPropertyAssignmentTestForCorrelationFilter_STATUS(subject CorrelationFil copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.CorrelationFilter_STATUS + var other v20211101s.CorrelationFilter_STATUS err := copied.AssignProperties_To_CorrelationFilter_STATUS(&other) if err != nil { return err.Error() @@ -471,7 +472,7 @@ func RunResourceConversionTestForNamespacesTopicsSubscriptionsRule(subject Names copied := subject.DeepCopy() // Convert to our hub version - var hub storage.NamespacesTopicsSubscriptionsRule + var hub v20240101s.NamespacesTopicsSubscriptionsRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -513,7 +514,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule(subject Names copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionsRule + var other v20211101s.NamespacesTopicsSubscriptionsRule err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule(&other) if err != nil { return err.Error() @@ -617,7 +618,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRuleOperatorSpec(s copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionsRuleOperatorSpec + var other v20211101s.NamespacesTopicsSubscriptionsRuleOperatorSpec err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec(&other) if err != nil { return err.Error() @@ -714,7 +715,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_STATUS(subjec copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionsRule_STATUS + var other v20211101s.NamespacesTopicsSubscriptionsRule_STATUS err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS(&other) if err != nil { return err.Error() @@ -837,7 +838,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_Spec(subject copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionsRule_Spec + var other v20211101s.NamespacesTopicsSubscriptionsRule_Spec err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec(&other) if err != nil { return err.Error() @@ -959,7 +960,7 @@ func RunPropertyAssignmentTestForSqlFilter(subject SqlFilter) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SqlFilter + var other v20211101s.SqlFilter err := copied.AssignProperties_To_SqlFilter(&other) if err != nil { return err.Error() @@ -1063,7 +1064,7 @@ func RunPropertyAssignmentTestForSqlFilter_STATUS(subject SqlFilter_STATUS) stri copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SqlFilter_STATUS + var other v20211101s.SqlFilter_STATUS err := copied.AssignProperties_To_SqlFilter_STATUS(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20211101/namespace_types_gen.go b/v2/api/servicebus/v1api20211101/namespace_types_gen.go index 21afe3e87d5..5cf767191c4 100644 --- a/v2/api/servicebus/v1api20211101/namespace_types_gen.go +++ b/v2/api/servicebus/v1api20211101/namespace_types_gen.go @@ -53,22 +53,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.(*storage.Namespace) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/Namespace but received %T instead", hub) + // intermediate variable for conversion + var source storage.Namespace + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = namespace.AssignProperties_From_Namespace(&source) + if err != nil { + return eris.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.(*storage.Namespace) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/Namespace but received %T instead", hub) + // intermediate variable for conversion + var destination storage.Namespace + err := namespace.AssignProperties_To_Namespace(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from namespace") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return namespace.AssignProperties_To_Namespace(destination) + return nil } // +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 @@ -114,17 +128,6 @@ func (namespace *Namespace) SecretDestinationExpressions() []*core.DestinationEx return namespace.Spec.OperatorSpec.SecretExpressions } -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 @@ -854,74 +857,6 @@ func (namespace *Namespace_Spec) AssignProperties_To_Namespace_Spec(destination return nil } -// Initialize_From_Namespace_STATUS populates our Namespace_Spec from the provided source Namespace_STATUS -func (namespace *Namespace_Spec) Initialize_From_Namespace_STATUS(source *Namespace_STATUS) error { - - // AlternateName - namespace.AlternateName = genruntime.ClonePointerToString(source.AlternateName) - - // 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 eris.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 eris.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 eris.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 @@ -1678,47 +1613,6 @@ func (encryption *Encryption) AssignProperties_To_Encryption(destination *storag 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 := genruntime.ToEnum(string(*source.KeySource), encryption_KeySource_Values) - 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 eris.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 @@ -2006,33 +1900,6 @@ func (identity *Identity) AssignProperties_To_Identity(destination *storage.Iden return nil } -// Initialize_From_Identity_STATUS populates our Identity from the provided source Identity_STATUS -func (identity *Identity) Initialize_From_Identity_STATUS(source *Identity_STATUS) error { - - // Type - if source.Type != nil { - typeVar := genruntime.ToEnum(string(*source.Type), identity_Type_Values) - identity.Type = &typeVar - } else { - identity.Type = nil - } - - // UserAssignedIdentities - if source.UserAssignedIdentities != nil { - userAssignedIdentityList := make([]UserAssignedIdentityDetails, 0, len(source.UserAssignedIdentities)) - for userAssignedIdentitiesKey := range source.UserAssignedIdentities { - userAssignedIdentitiesRef := genruntime.CreateResourceReferenceFromARMID(userAssignedIdentitiesKey) - userAssignedIdentityList = append(userAssignedIdentityList, UserAssignedIdentityDetails{Reference: userAssignedIdentitiesRef}) - } - identity.UserAssignedIdentities = userAssignedIdentityList - } else { - identity.UserAssignedIdentities = nil - } - - // No error - return nil -} - // Properties to configure User Assigned Identities for Bring your Own Keys type Identity_STATUS struct { // PrincipalId: ObjectId from the KeyVault @@ -2525,32 +2392,6 @@ func (sbSku *SBSku) AssignProperties_To_SBSku(destination *storage.SBSku) 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 := genruntime.ToEnum(string(*source.Name), sBSku_Name_Values) - sbSku.Name = &name - } else { - sbSku.Name = nil - } - - // Tier - if source.Tier != nil { - tier := genruntime.ToEnum(string(*source.Tier), sBSku_Tier_Values) - 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. @@ -3043,34 +2884,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 eris.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"` @@ -3608,13 +3421,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/v1api20211101/namespace_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespace_types_gen_test.go index 9fdb2b791f8..f2f998a7a12 100644 --- a/v2/api/servicebus/v1api20211101/namespace_types_gen_test.go +++ b/v2/api/servicebus/v1api20211101/namespace_types_gen_test.go @@ -5,7 +5,8 @@ package v1api20211101 import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -35,7 +36,7 @@ func RunPropertyAssignmentTestForEncryption(subject Encryption) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Encryption + var other v20211101s.Encryption err := copied.AssignProperties_To_Encryption(&other) if err != nil { return err.Error() @@ -152,7 +153,7 @@ func RunPropertyAssignmentTestForEncryption_STATUS(subject Encryption_STATUS) st copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Encryption_STATUS + var other v20211101s.Encryption_STATUS err := copied.AssignProperties_To_Encryption_STATUS(&other) if err != nil { return err.Error() @@ -269,7 +270,7 @@ func RunPropertyAssignmentTestForIdentity(subject Identity) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Identity + var other v20211101s.Identity err := copied.AssignProperties_To_Identity(&other) if err != nil { return err.Error() @@ -389,7 +390,7 @@ func RunPropertyAssignmentTestForIdentity_STATUS(subject Identity_STATUS) string copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Identity_STATUS + var other v20211101s.Identity_STATUS err := copied.AssignProperties_To_Identity_STATUS(&other) if err != nil { return err.Error() @@ -513,7 +514,7 @@ func RunPropertyAssignmentTestForKeyVaultProperties(subject KeyVaultProperties) copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.KeyVaultProperties + var other v20211101s.KeyVaultProperties err := copied.AssignProperties_To_KeyVaultProperties(&other) if err != nil { return err.Error() @@ -631,7 +632,7 @@ func RunPropertyAssignmentTestForKeyVaultProperties_STATUS(subject KeyVaultPrope copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.KeyVaultProperties_STATUS + var other v20211101s.KeyVaultProperties_STATUS err := copied.AssignProperties_To_KeyVaultProperties_STATUS(&other) if err != nil { return err.Error() @@ -751,7 +752,7 @@ func RunResourceConversionTestForNamespace(subject Namespace) string { copied := subject.DeepCopy() // Convert to our hub version - var hub storage.Namespace + var hub v20240101s.Namespace err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -793,7 +794,7 @@ func RunPropertyAssignmentTestForNamespace(subject Namespace) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Namespace + var other v20211101s.Namespace err := copied.AssignProperties_To_Namespace(&other) if err != nil { return err.Error() @@ -896,7 +897,7 @@ func RunPropertyAssignmentTestForNamespaceOperatorSecrets(subject NamespaceOpera copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespaceOperatorSecrets + var other v20211101s.NamespaceOperatorSecrets err := copied.AssignProperties_To_NamespaceOperatorSecrets(&other) if err != nil { return err.Error() @@ -993,7 +994,7 @@ func RunPropertyAssignmentTestForNamespaceOperatorSpec(subject NamespaceOperator copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespaceOperatorSpec + var other v20211101s.NamespaceOperatorSpec err := copied.AssignProperties_To_NamespaceOperatorSpec(&other) if err != nil { return err.Error() @@ -1096,7 +1097,7 @@ func RunPropertyAssignmentTestForNamespace_STATUS(subject Namespace_STATUS) stri copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Namespace_STATUS + var other v20211101s.Namespace_STATUS err := copied.AssignProperties_To_Namespace_STATUS(&other) if err != nil { return err.Error() @@ -1231,7 +1232,7 @@ func RunPropertyAssignmentTestForNamespace_Spec(subject Namespace_Spec) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Namespace_Spec + var other v20211101s.Namespace_Spec err := copied.AssignProperties_To_Namespace_Spec(&other) if err != nil { return err.Error() @@ -1357,7 +1358,7 @@ func RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS(subject Privat copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.PrivateEndpointConnection_STATUS + var other v20211101s.PrivateEndpointConnection_STATUS err := copied.AssignProperties_To_PrivateEndpointConnection_STATUS(&other) if err != nil { return err.Error() @@ -1460,7 +1461,7 @@ func RunPropertyAssignmentTestForSBSku(subject SBSku) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SBSku + var other v20211101s.SBSku err := copied.AssignProperties_To_SBSku(&other) if err != nil { return err.Error() @@ -1564,7 +1565,7 @@ func RunPropertyAssignmentTestForSBSku_STATUS(subject SBSku_STATUS) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SBSku_STATUS + var other v20211101s.SBSku_STATUS err := copied.AssignProperties_To_SBSku_STATUS(&other) if err != nil { return err.Error() @@ -1668,7 +1669,7 @@ func RunPropertyAssignmentTestForSystemData_STATUS(subject SystemData_STATUS) st copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SystemData_STATUS + var other v20211101s.SystemData_STATUS err := copied.AssignProperties_To_SystemData_STATUS(&other) if err != nil { return err.Error() @@ -1783,7 +1784,7 @@ func RunPropertyAssignmentTestForUserAssignedIdentityDetails(subject UserAssigne copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.UserAssignedIdentityDetails + var other v20211101s.UserAssignedIdentityDetails err := copied.AssignProperties_To_UserAssignedIdentityDetails(&other) if err != nil { return err.Error() @@ -1880,7 +1881,7 @@ func RunPropertyAssignmentTestForUserAssignedIdentityProperties(subject UserAssi copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.UserAssignedIdentityProperties + var other v20211101s.UserAssignedIdentityProperties err := copied.AssignProperties_To_UserAssignedIdentityProperties(&other) if err != nil { return err.Error() @@ -1977,7 +1978,7 @@ func RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS(subject U copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.UserAssignedIdentityProperties_STATUS + var other v20211101s.UserAssignedIdentityProperties_STATUS err := copied.AssignProperties_To_UserAssignedIdentityProperties_STATUS(&other) if err != nil { return err.Error() @@ -2080,7 +2081,7 @@ func RunPropertyAssignmentTestForUserAssignedIdentity_STATUS(subject UserAssigne copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.UserAssignedIdentity_STATUS + var other v20211101s.UserAssignedIdentity_STATUS err := copied.AssignProperties_To_UserAssignedIdentity_STATUS(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_types_gen.go index 36f9524c6a4..2a30414a9cb 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_types_gen.go +++ b/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_types_gen.go @@ -53,22 +53,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.(*storage.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesAuthorizationRule but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesAuthorizationRule + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") } - return rule.AssignProperties_From_NamespacesAuthorizationRule(source) + err = rule.AssignProperties_From_NamespacesAuthorizationRule(&source) + if err != nil { + return eris.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.(*storage.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesAuthorizationRule but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesAuthorizationRule + err := rule.AssignProperties_To_NamespacesAuthorizationRule(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from rule") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) + return nil } // +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 @@ -114,17 +128,6 @@ func (rule *NamespacesAuthorizationRule) SecretDestinationExpressions() []*core. return rule.Spec.OperatorSpec.SecretExpressions } -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.(*NamespacesAuthorizationRule_STATUS); ok { - return rule.Spec.Initialize_From_NamespacesAuthorizationRule_STATUS(s) - } - - return fmt.Errorf("expected Status of type NamespacesAuthorizationRule_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &NamespacesAuthorizationRule{} // AzureName returns the Azure name of the resource @@ -614,27 +617,6 @@ func (rule *NamespacesAuthorizationRule_Spec) AssignProperties_To_NamespacesAuth return nil } -// Initialize_From_NamespacesAuthorizationRule_STATUS populates our NamespacesAuthorizationRule_Spec from the provided source NamespacesAuthorizationRule_STATUS -func (rule *NamespacesAuthorizationRule_Spec) Initialize_From_NamespacesAuthorizationRule_STATUS(source *NamespacesAuthorizationRule_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 := genruntime.ToEnum(string(rightItem), namespaces_AuthorizationRule_Properties_Rights_Spec_Values) - 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 *NamespacesAuthorizationRule_Spec) OriginalVersion() string { return GroupVersion.Version 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 index 06282f4fcb1..5fe4bd1891f 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_types_gen_test.go +++ b/v2/api/servicebus/v1api20211101/namespaces_authorization_rule_types_gen_test.go @@ -5,7 +5,8 @@ package v1api20211101 import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesAuthorizationRule(subject NamespacesA copied := subject.DeepCopy() // Convert to our hub version - var hub storage.NamespacesAuthorizationRule + var hub v20240101s.NamespacesAuthorizationRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -78,7 +79,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRule(subject NamespacesA copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRule + var other v20211101s.NamespacesAuthorizationRule err := copied.AssignProperties_To_NamespacesAuthorizationRule(&other) if err != nil { return err.Error() @@ -182,7 +183,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets(subj copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRuleOperatorSecrets + var other v20211101s.NamespacesAuthorizationRuleOperatorSecrets err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&other) if err != nil { return err.Error() @@ -279,7 +280,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec(subject copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRuleOperatorSpec + var other v20211101s.NamespacesAuthorizationRuleOperatorSpec err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&other) if err != nil { return err.Error() @@ -382,7 +383,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRule_STATUS(subject Name copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRule_STATUS + var other v20211101s.NamespacesAuthorizationRule_STATUS err := copied.AssignProperties_To_NamespacesAuthorizationRule_STATUS(&other) if err != nil { return err.Error() @@ -503,7 +504,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRule_Spec(subject Namesp copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRule_Spec + var other v20211101s.NamespacesAuthorizationRule_Spec err := copied.AssignProperties_To_NamespacesAuthorizationRule_Spec(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen.go index b84d96bf09f..b48817c2d9c 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen.go +++ b/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen.go @@ -53,22 +53,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.(*storage.NamespacesQueue) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesQueue but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesQueue + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") } - return queue.AssignProperties_From_NamespacesQueue(source) + err = queue.AssignProperties_From_NamespacesQueue(&source) + if err != nil { + return eris.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 { - destination, ok := hub.(*storage.NamespacesQueue) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesQueue but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesQueue + err := queue.AssignProperties_To_NamespacesQueue(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from queue") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return queue.AssignProperties_To_NamespacesQueue(destination) + return nil } // +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 @@ -114,17 +128,6 @@ func (queue *NamespacesQueue) SecretDestinationExpressions() []*core.Destination return queue.Spec.OperatorSpec.SecretExpressions } -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.(*NamespacesQueue_STATUS); ok { - return queue.Spec.Initialize_From_NamespacesQueue_STATUS(s) - } - - return fmt.Errorf("expected Status of type NamespacesQueue_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &NamespacesQueue{} // AzureName returns the Azure name of the resource @@ -973,88 +976,6 @@ func (queue *NamespacesQueue_Spec) AssignProperties_To_NamespacesQueue_Spec(dest return nil } -// Initialize_From_NamespacesQueue_STATUS populates our NamespacesQueue_Spec from the provided source NamespacesQueue_STATUS -func (queue *NamespacesQueue_Spec) Initialize_From_NamespacesQueue_STATUS(source *NamespacesQueue_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 *NamespacesQueue_Spec) OriginalVersion() string { return GroupVersion.Version diff --git a/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen_test.go index 65b2a70e024..5df9f71b13e 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen_test.go +++ b/v2/api/servicebus/v1api20211101/namespaces_queue_types_gen_test.go @@ -5,7 +5,8 @@ package v1api20211101 import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -35,7 +36,7 @@ func RunPropertyAssignmentTestForMessageCountDetails_STATUS(subject MessageCount copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.MessageCountDetails_STATUS + var other v20211101s.MessageCountDetails_STATUS err := copied.AssignProperties_To_MessageCountDetails_STATUS(&other) if err != nil { return err.Error() @@ -143,7 +144,7 @@ func RunResourceConversionTestForNamespacesQueue(subject NamespacesQueue) string copied := subject.DeepCopy() // Convert to our hub version - var hub storage.NamespacesQueue + var hub v20240101s.NamespacesQueue err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -185,7 +186,7 @@ func RunPropertyAssignmentTestForNamespacesQueue(subject NamespacesQueue) string copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesQueue + var other v20211101s.NamespacesQueue err := copied.AssignProperties_To_NamespacesQueue(&other) if err != nil { return err.Error() @@ -288,7 +289,7 @@ func RunPropertyAssignmentTestForNamespacesQueueOperatorSpec(subject NamespacesQ copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesQueueOperatorSpec + var other v20211101s.NamespacesQueueOperatorSpec err := copied.AssignProperties_To_NamespacesQueueOperatorSpec(&other) if err != nil { return err.Error() @@ -385,7 +386,7 @@ func RunPropertyAssignmentTestForNamespacesQueue_STATUS(subject NamespacesQueue_ copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesQueue_STATUS + var other v20211101s.NamespacesQueue_STATUS err := copied.AssignProperties_To_NamespacesQueue_STATUS(&other) if err != nil { return err.Error() @@ -536,7 +537,7 @@ func RunPropertyAssignmentTestForNamespacesQueue_Spec(subject NamespacesQueue_Sp copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesQueue_Spec + var other v20211101s.NamespacesQueue_Spec err := copied.AssignProperties_To_NamespacesQueue_Spec(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen.go index 5800452ffee..3cbe5fd56bb 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen.go +++ b/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen.go @@ -53,22 +53,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.(*storage.NamespacesTopic) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopic but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesTopic + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = topic.AssignProperties_From_NamespacesTopic(&source) + if err != nil { + return eris.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.(*storage.NamespacesTopic) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopic but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesTopic + err := topic.AssignProperties_To_NamespacesTopic(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from topic") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return topic.AssignProperties_To_NamespacesTopic(destination) + return nil } // +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 @@ -114,17 +128,6 @@ func (topic *NamespacesTopic) SecretDestinationExpressions() []*core.Destination return topic.Spec.OperatorSpec.SecretExpressions } -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.(*NamespacesTopic_STATUS); ok { - return topic.Spec.Initialize_From_NamespacesTopic_STATUS(s) - } - - return fmt.Errorf("expected Status of type NamespacesTopic_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &NamespacesTopic{} // AzureName returns the Azure name of the resource @@ -845,68 +848,6 @@ func (topic *NamespacesTopic_Spec) AssignProperties_To_NamespacesTopic_Spec(dest return nil } -// Initialize_From_NamespacesTopic_STATUS populates our NamespacesTopic_Spec from the provided source NamespacesTopic_STATUS -func (topic *NamespacesTopic_Spec) Initialize_From_NamespacesTopic_STATUS(source *NamespacesTopic_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 *NamespacesTopic_Spec) OriginalVersion() string { return GroupVersion.Version diff --git a/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen_test.go index 535cb9ff3b5..17df4a9ed1d 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen_test.go +++ b/v2/api/servicebus/v1api20211101/namespaces_topic_types_gen_test.go @@ -5,7 +5,8 @@ package v1api20211101 import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "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 storage.NamespacesTopic + var hub v20240101s.NamespacesTopic err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -78,7 +79,7 @@ func RunPropertyAssignmentTestForNamespacesTopic(subject NamespacesTopic) string copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopic + var other v20211101s.NamespacesTopic err := copied.AssignProperties_To_NamespacesTopic(&other) if err != nil { return err.Error() @@ -181,7 +182,7 @@ func RunPropertyAssignmentTestForNamespacesTopicOperatorSpec(subject NamespacesT copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicOperatorSpec + var other v20211101s.NamespacesTopicOperatorSpec err := copied.AssignProperties_To_NamespacesTopicOperatorSpec(&other) if err != nil { return err.Error() @@ -278,7 +279,7 @@ func RunPropertyAssignmentTestForNamespacesTopic_STATUS(subject NamespacesTopic_ copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopic_STATUS + var other v20211101s.NamespacesTopic_STATUS err := copied.AssignProperties_To_NamespacesTopic_STATUS(&other) if err != nil { return err.Error() @@ -424,7 +425,7 @@ func RunPropertyAssignmentTestForNamespacesTopic_Spec(subject NamespacesTopic_Sp copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopic_Spec + var other v20211101s.NamespacesTopic_Spec err := copied.AssignProperties_To_NamespacesTopic_Spec(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen.go index 672cf4a2fdc..4b9164d9e27 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen.go +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen.go @@ -53,22 +53,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.(*storage.NamespacesTopicsSubscription) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopicsSubscription but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesTopicsSubscription + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = subscription.AssignProperties_From_NamespacesTopicsSubscription(&source) + if err != nil { + return eris.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.(*storage.NamespacesTopicsSubscription) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopicsSubscription but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesTopicsSubscription + err := subscription.AssignProperties_To_NamespacesTopicsSubscription(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from subscription") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return subscription.AssignProperties_To_NamespacesTopicsSubscription(destination) + return nil } // +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 @@ -114,17 +128,6 @@ func (subscription *NamespacesTopicsSubscription) SecretDestinationExpressions() return subscription.Spec.OperatorSpec.SecretExpressions } -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.(*NamespacesTopicsSubscription_STATUS); ok { - return subscription.Spec.Initialize_From_NamespacesTopicsSubscription_STATUS(s) - } - - return fmt.Errorf("expected Status of type NamespacesTopicsSubscription_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &NamespacesTopicsSubscription{} // AzureName returns the Azure name of the resource @@ -941,86 +944,6 @@ func (subscription *NamespacesTopicsSubscription_Spec) AssignProperties_To_Names return nil } -// Initialize_From_NamespacesTopicsSubscription_STATUS populates our NamespacesTopicsSubscription_Spec from the provided source NamespacesTopicsSubscription_STATUS -func (subscription *NamespacesTopicsSubscription_Spec) Initialize_From_NamespacesTopicsSubscription_STATUS(source *NamespacesTopicsSubscription_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 eris.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 *NamespacesTopicsSubscription_Spec) OriginalVersion() string { return GroupVersion.Version @@ -1931,32 +1854,6 @@ func (properties *SBClientAffineProperties) AssignProperties_To_SBClientAffinePr 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. 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 index 3a769828426..8a609e591b4 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen_test.go +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscription_types_gen_test.go @@ -5,7 +5,8 @@ package v1api20211101 import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "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 storage.NamespacesTopicsSubscription + var hub v20240101s.NamespacesTopicsSubscription err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -78,7 +79,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscription(subject Namespaces copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscription + var other v20211101s.NamespacesTopicsSubscription err := copied.AssignProperties_To_NamespacesTopicsSubscription(&other) if err != nil { return err.Error() @@ -182,7 +183,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionOperatorSpec(subjec copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionOperatorSpec + var other v20211101s.NamespacesTopicsSubscriptionOperatorSpec err := copied.AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec(&other) if err != nil { return err.Error() @@ -279,7 +280,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscription_STATUS(subject Nam copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscription_STATUS + var other v20211101s.NamespacesTopicsSubscription_STATUS err := copied.AssignProperties_To_NamespacesTopicsSubscription_STATUS(&other) if err != nil { return err.Error() @@ -427,7 +428,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscription_Spec(subject Names copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscription_Spec + var other v20211101s.NamespacesTopicsSubscription_Spec err := copied.AssignProperties_To_NamespacesTopicsSubscription_Spec(&other) if err != nil { return err.Error() @@ -557,7 +558,7 @@ func RunPropertyAssignmentTestForSBClientAffineProperties(subject SBClientAffine copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SBClientAffineProperties + var other v20211101s.SBClientAffineProperties err := copied.AssignProperties_To_SBClientAffineProperties(&other) if err != nil { return err.Error() @@ -662,7 +663,7 @@ func RunPropertyAssignmentTestForSBClientAffineProperties_STATUS(subject SBClien copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SBClientAffineProperties_STATUS + var other v20211101s.SBClientAffineProperties_STATUS err := copied.AssignProperties_To_SBClientAffineProperties_STATUS(&other) if err != nil { return err.Error() 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 index 3d713ddd622..79dd04ad3b8 100644 --- a/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_types_gen.go +++ b/v2/api/servicebus/v1api20211101/namespaces_topics_subscriptions_rule_types_gen.go @@ -53,22 +53,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.(*storage.NamespacesTopicsSubscriptionsRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesTopicsSubscriptionsRule + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") } - return rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule(source) + err = rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule(&source) + if err != nil { + return eris.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.(*storage.NamespacesTopicsSubscriptionsRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesTopicsSubscriptionsRule + err := rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from rule") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(destination) + return nil } // +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 @@ -114,17 +128,6 @@ func (rule *NamespacesTopicsSubscriptionsRule) SecretDestinationExpressions() [] return rule.Spec.OperatorSpec.SecretExpressions } -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.(*NamespacesTopicsSubscriptionsRule_STATUS); ok { - return rule.Spec.Initialize_From_NamespacesTopicsSubscriptionsRule_STATUS(s) - } - - return fmt.Errorf("expected Status of type NamespacesTopicsSubscriptionsRule_STATUS but received %T instead", status) -} - var _ genruntime.KubernetesResource = &NamespacesTopicsSubscriptionsRule{} // AzureName returns the Azure name of the resource @@ -748,57 +751,6 @@ func (rule *NamespacesTopicsSubscriptionsRule_Spec) AssignProperties_To_Namespac return nil } -// Initialize_From_NamespacesTopicsSubscriptionsRule_STATUS populates our NamespacesTopicsSubscriptionsRule_Spec from the provided source NamespacesTopicsSubscriptionsRule_STATUS -func (rule *NamespacesTopicsSubscriptionsRule_Spec) Initialize_From_NamespacesTopicsSubscriptionsRule_STATUS(source *NamespacesTopicsSubscriptionsRule_STATUS) error { - - // Action - if source.Action != nil { - var action Action - err := action.Initialize_From_Action_STATUS(source.Action) - if err != nil { - return eris.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 eris.Wrap(err, "calling Initialize_From_CorrelationFilter_STATUS() to populate field CorrelationFilter") - } - rule.CorrelationFilter = &correlationFilter - } else { - rule.CorrelationFilter = nil - } - - // FilterType - if source.FilterType != nil { - filterType := genruntime.ToEnum(string(*source.FilterType), filterType_Values) - 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 eris.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 *NamespacesTopicsSubscriptionsRule_Spec) OriginalVersion() string { return GroupVersion.Version @@ -1295,27 +1247,6 @@ func (action *Action) AssignProperties_To_Action(destination *storage.Action) er 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 { @@ -1694,48 +1625,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. @@ -2202,27 +2091,6 @@ func (filter *SqlFilter) AssignProperties_To_SqlFilter(destination *storage.SqlF 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, 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 index bb4c9fcd57c..0792c818d43 100644 --- 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 @@ -5,7 +5,8 @@ package v1api20211101 import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -35,7 +36,7 @@ func RunPropertyAssignmentTestForAction(subject Action) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Action + var other v20211101s.Action err := copied.AssignProperties_To_Action(&other) if err != nil { return err.Error() @@ -139,7 +140,7 @@ func RunPropertyAssignmentTestForAction_STATUS(subject Action_STATUS) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Action_STATUS + var other v20211101s.Action_STATUS err := copied.AssignProperties_To_Action_STATUS(&other) if err != nil { return err.Error() @@ -243,7 +244,7 @@ func RunPropertyAssignmentTestForCorrelationFilter(subject CorrelationFilter) st copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.CorrelationFilter + var other v20211101s.CorrelationFilter err := copied.AssignProperties_To_CorrelationFilter(&other) if err != nil { return err.Error() @@ -356,7 +357,7 @@ func RunPropertyAssignmentTestForCorrelationFilter_STATUS(subject CorrelationFil copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.CorrelationFilter_STATUS + var other v20211101s.CorrelationFilter_STATUS err := copied.AssignProperties_To_CorrelationFilter_STATUS(&other) if err != nil { return err.Error() @@ -471,7 +472,7 @@ func RunResourceConversionTestForNamespacesTopicsSubscriptionsRule(subject Names copied := subject.DeepCopy() // Convert to our hub version - var hub storage.NamespacesTopicsSubscriptionsRule + var hub v20240101s.NamespacesTopicsSubscriptionsRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -513,7 +514,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule(subject Names copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionsRule + var other v20211101s.NamespacesTopicsSubscriptionsRule err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule(&other) if err != nil { return err.Error() @@ -617,7 +618,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRuleOperatorSpec(s copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionsRuleOperatorSpec + var other v20211101s.NamespacesTopicsSubscriptionsRuleOperatorSpec err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec(&other) if err != nil { return err.Error() @@ -714,7 +715,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_STATUS(subjec copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionsRule_STATUS + var other v20211101s.NamespacesTopicsSubscriptionsRule_STATUS err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS(&other) if err != nil { return err.Error() @@ -838,7 +839,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_Spec(subject copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionsRule_Spec + var other v20211101s.NamespacesTopicsSubscriptionsRule_Spec err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec(&other) if err != nil { return err.Error() @@ -959,7 +960,7 @@ func RunPropertyAssignmentTestForSqlFilter(subject SqlFilter) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SqlFilter + var other v20211101s.SqlFilter err := copied.AssignProperties_To_SqlFilter(&other) if err != nil { return err.Error() @@ -1063,7 +1064,7 @@ func RunPropertyAssignmentTestForSqlFilter_STATUS(subject SqlFilter_STATUS) stri copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SqlFilter_STATUS + var other v20211101s.SqlFilter_STATUS err := copied.AssignProperties_To_SqlFilter_STATUS(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20211101/storage/namespace_types_gen.go b/v2/api/servicebus/v1api20211101/storage/namespace_types_gen.go index fe07cee73a0..c0a28ae3d89 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespace_types_gen.go +++ b/v2/api/servicebus/v1api20211101/storage/namespace_types_gen.go @@ -4,6 +4,8 @@ package storage import ( + "fmt" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" @@ -12,14 +14,11 @@ import ( "github.com/rotisserie/eris" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// +kubebuilder:rbac:groups=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" @@ -47,6 +46,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.(*storage.Namespace) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/Namespace but received %T instead", hub) + } + + return namespace.AssignProperties_From_Namespace(source) +} + +// ConvertTo populates the provided hub Namespace from our Namespace +func (namespace *Namespace) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*storage.Namespace) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/Namespace but received %T instead", hub) + } + + return namespace.AssignProperties_To_Namespace(destination) +} + var _ configmaps.Exporter = &Namespace{} // ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property @@ -142,8 +163,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 *storage.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 eris.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 eris.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 eris.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 *storage.Namespace) error { + + // ObjectMeta + destination.ObjectMeta = *namespace.ObjectMeta.DeepCopy() + + // Spec + var spec storage.Namespace_Spec + err := namespace.Spec.AssignProperties_To_Namespace_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Namespace_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.Namespace_STATUS + err = namespace.Status.AssignProperties_To_Namespace_STATUS(&status) + if err != nil { + return eris.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (namespace *Namespace) OriginalGVK() *schema.GroupVersionKind { @@ -171,6 +259,11 @@ type APIVersion string const APIVersion_Value = APIVersion("2021-11-01") +type augmentConversionForNamespace interface { + AssignPropertiesFrom(src *storage.Namespace) error + AssignPropertiesTo(dst *storage.Namespace) error +} + // Storage version of v1api20211101.Namespace_Spec type Namespace_Spec struct { AlternateName *string `json:"alternateName,omitempty"` @@ -200,20 +293,334 @@ 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 eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*storage.Namespace_Spec) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_Spec(src) + } + + // Convert to an intermediate form + src = &storage.Namespace_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.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 eris.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 eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*storage.Namespace_Spec) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_Spec(dst) + } + + // Convert to an intermediate form + dst = &storage.Namespace_Spec{} + err := namespace.AssignProperties_To_Namespace_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignProperties_From_Namespace_Spec populates our Namespace_Spec from the provided source Namespace_Spec +func (namespace *Namespace_Spec) AssignProperties_From_Namespace_Spec(source *storage.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 eris.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 eris.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 { + propertyBag.Add("MinimumTlsVersion", *source.MinimumTlsVersion) + } else { + propertyBag.Remove("MinimumTlsVersion") + } + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespaceOperatorSpec + err := operatorSpec.AssignProperties_From_NamespaceOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.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 source.PremiumMessagingPartitions != nil { + propertyBag.Add("PremiumMessagingPartitions", *source.PremiumMessagingPartitions) + } else { + propertyBag.Remove("PremiumMessagingPartitions") + } + + // PublicNetworkAccess + if source.PublicNetworkAccess != nil { + propertyBag.Add("PublicNetworkAccess", *source.PublicNetworkAccess) + } else { + propertyBag.Remove("PublicNetworkAccess") + } + + // Sku + if source.Sku != nil { + var sku SBSku + err := sku.AssignProperties_From_SBSku(source.Sku) + if err != nil { + return eris.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 eris.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 *storage.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 storage.Encryption + err := namespace.Encryption.AssignProperties_To_Encryption(&encryption) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Encryption() to populate field Encryption") + } + destination.Encryption = &encryption + } else { + destination.Encryption = nil + } + + // Identity + if namespace.Identity != nil { + var identity storage.Identity + err := namespace.Identity.AssignProperties_To_Identity(&identity) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Identity() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // MinimumTlsVersion + if propertyBag.Contains("MinimumTlsVersion") { + var minimumTlsVersion string + err := propertyBag.Pull("MinimumTlsVersion", &minimumTlsVersion) + if err != nil { + return eris.Wrap(err, "pulling 'MinimumTlsVersion' from propertyBag") + } + + destination.MinimumTlsVersion = &minimumTlsVersion + } else { + destination.MinimumTlsVersion = nil + } + + // OperatorSpec + if namespace.OperatorSpec != nil { + var operatorSpec storage.NamespaceOperatorSpec + err := namespace.OperatorSpec.AssignProperties_To_NamespaceOperatorSpec(&operatorSpec) + if err != nil { + return eris.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 propertyBag.Contains("PremiumMessagingPartitions") { + var premiumMessagingPartition int + err := propertyBag.Pull("PremiumMessagingPartitions", &premiumMessagingPartition) + if err != nil { + return eris.Wrap(err, "pulling 'PremiumMessagingPartitions' from propertyBag") + } + + destination.PremiumMessagingPartitions = &premiumMessagingPartition + } else { + destination.PremiumMessagingPartitions = nil + } + + // PublicNetworkAccess + if propertyBag.Contains("PublicNetworkAccess") { + var publicNetworkAccess string + err := propertyBag.Pull("PublicNetworkAccess", &publicNetworkAccess) + if err != nil { + return eris.Wrap(err, "pulling 'PublicNetworkAccess' from propertyBag") + } + + destination.PublicNetworkAccess = &publicNetworkAccess + } else { + destination.PublicNetworkAccess = nil + } + + // Sku + if namespace.Sku != nil { + var sku storage.SBSku + err := namespace.Sku.AssignProperties_To_SBSku(&sku) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SBSku() to populate field Sku") + } + destination.Sku = &sku + } else { + destination.Sku = nil } - return destination.ConvertSpecFrom(namespace) + // 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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20211101.Namespace_STATUS @@ -245,20 +652,412 @@ 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 eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*storage.Namespace_STATUS) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_STATUS(src) } - return source.ConvertStatusTo(namespace) + // Convert to an intermediate form + src = &storage.Namespace_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = namespace.AssignProperties_From_Namespace_STATUS(src) + if err != nil { + return eris.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 eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*storage.Namespace_STATUS) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_STATUS(dst) + } + + // Convert to an intermediate form + dst = &storage.Namespace_STATUS{} + err := namespace.AssignProperties_To_Namespace_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +// AssignProperties_From_Namespace_STATUS populates our Namespace_STATUS from the provided source Namespace_STATUS +func (namespace *Namespace_STATUS) AssignProperties_From_Namespace_STATUS(source *storage.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 eris.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 eris.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 { + propertyBag.Add("MinimumTlsVersion", *source.MinimumTlsVersion) + } else { + propertyBag.Remove("MinimumTlsVersion") + } + + // Name + namespace.Name = genruntime.ClonePointerToString(source.Name) + + // PremiumMessagingPartitions + if source.PremiumMessagingPartitions != nil { + propertyBag.Add("PremiumMessagingPartitions", *source.PremiumMessagingPartitions) + } else { + propertyBag.Remove("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 eris.Wrap(err, "calling AssignProperties_From_PrivateEndpointConnection_STATUS() to populate field PrivateEndpointConnections") + } + privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection + } + namespace.PrivateEndpointConnections = privateEndpointConnectionList + } else { + namespace.PrivateEndpointConnections = nil + } + + // ProvisioningState + namespace.ProvisioningState = genruntime.ClonePointerToString(source.ProvisioningState) + + // PublicNetworkAccess + if source.PublicNetworkAccess != nil { + propertyBag.Add("PublicNetworkAccess", *source.PublicNetworkAccess) + } else { + propertyBag.Remove("PublicNetworkAccess") + } + + // ServiceBusEndpoint + namespace.ServiceBusEndpoint = genruntime.ClonePointerToString(source.ServiceBusEndpoint) + + // Sku + if source.Sku != nil { + var sku SBSku_STATUS + err := sku.AssignProperties_From_SBSku_STATUS(source.Sku) + if err != nil { + return eris.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 eris.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 eris.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 *storage.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 storage.Encryption_STATUS + err := namespace.Encryption.AssignProperties_To_Encryption_STATUS(&encryption) + if err != nil { + return eris.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 storage.Identity_STATUS + err := namespace.Identity.AssignProperties_To_Identity_STATUS(&identity) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Identity_STATUS() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(namespace.Location) + + // MetricId + destination.MetricId = genruntime.ClonePointerToString(namespace.MetricId) + + // MinimumTlsVersion + if propertyBag.Contains("MinimumTlsVersion") { + var minimumTlsVersion string + err := propertyBag.Pull("MinimumTlsVersion", &minimumTlsVersion) + if err != nil { + return eris.Wrap(err, "pulling 'MinimumTlsVersion' from propertyBag") + } + + destination.MinimumTlsVersion = &minimumTlsVersion + } else { + destination.MinimumTlsVersion = nil + } + + // Name + destination.Name = genruntime.ClonePointerToString(namespace.Name) + + // PremiumMessagingPartitions + if propertyBag.Contains("PremiumMessagingPartitions") { + var premiumMessagingPartition int + err := propertyBag.Pull("PremiumMessagingPartitions", &premiumMessagingPartition) + if err != nil { + return eris.Wrap(err, "pulling 'PremiumMessagingPartitions' from propertyBag") + } + + destination.PremiumMessagingPartitions = &premiumMessagingPartition + } else { + destination.PremiumMessagingPartitions = nil + } + + // PrivateEndpointConnections + if namespace.PrivateEndpointConnections != nil { + privateEndpointConnectionList := make([]storage.PrivateEndpointConnection_STATUS, len(namespace.PrivateEndpointConnections)) + for privateEndpointConnectionIndex, privateEndpointConnectionItem := range namespace.PrivateEndpointConnections { + // Shadow the loop variable to avoid aliasing + privateEndpointConnectionItem := privateEndpointConnectionItem + var privateEndpointConnection storage.PrivateEndpointConnection_STATUS + err := privateEndpointConnectionItem.AssignProperties_To_PrivateEndpointConnection_STATUS(&privateEndpointConnection) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_PrivateEndpointConnection_STATUS() to populate field PrivateEndpointConnections") + } + privateEndpointConnectionList[privateEndpointConnectionIndex] = privateEndpointConnection + } + destination.PrivateEndpointConnections = privateEndpointConnectionList + } else { + destination.PrivateEndpointConnections = nil + } + + // ProvisioningState + destination.ProvisioningState = genruntime.ClonePointerToString(namespace.ProvisioningState) + + // PublicNetworkAccess + if propertyBag.Contains("PublicNetworkAccess") { + var publicNetworkAccess string + err := propertyBag.Pull("PublicNetworkAccess", &publicNetworkAccess) + if err != nil { + return eris.Wrap(err, "pulling 'PublicNetworkAccess' from propertyBag") + } + + destination.PublicNetworkAccess = &publicNetworkAccess + } else { + destination.PublicNetworkAccess = nil + } + + // ServiceBusEndpoint + destination.ServiceBusEndpoint = genruntime.ClonePointerToString(namespace.ServiceBusEndpoint) + + // Sku + if namespace.Sku != nil { + var sku storage.SBSku_STATUS + err := namespace.Sku.AssignProperties_To_SBSku_STATUS(&sku) + if err != nil { + return eris.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 storage.SystemData_STATUS + err := namespace.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(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 } - return destination.ConvertStatusFrom(namespace) + // 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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespace_Spec interface { + AssignPropertiesFrom(src *storage.Namespace_Spec) error + AssignPropertiesTo(dst *storage.Namespace_Spec) error +} + +type augmentConversionForNamespace_STATUS interface { + AssignPropertiesFrom(src *storage.Namespace_STATUS) error + AssignPropertiesTo(dst *storage.Namespace_STATUS) error } // Storage version of v1api20211101.Encryption @@ -270,6 +1069,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 *storage.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 eris.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 eris.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 *storage.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([]storage.KeyVaultProperties, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty storage.KeyVaultProperties + err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties(&keyVaultProperty) + if err != nil { + return eris.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.Encryption_STATUS // Properties to configure Encryption type Encryption_STATUS struct { @@ -279,13 +1186,213 @@ type Encryption_STATUS struct { 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"` -} +// AssignProperties_From_Encryption_STATUS populates our Encryption_STATUS from the provided source Encryption_STATUS +func (encryption *Encryption_STATUS) AssignProperties_From_Encryption_STATUS(source *storage.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 eris.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 eris.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 *storage.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([]storage.KeyVaultProperties_STATUS, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty storage.KeyVaultProperties_STATUS + err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties_STATUS(&keyVaultProperty) + if err != nil { + return eris.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +// 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"` +} + +// AssignProperties_From_Identity populates our Identity from the provided source Identity +func (identity *Identity) AssignProperties_From_Identity(source *storage.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 eris.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 eris.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 *storage.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([]storage.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities)) + for userAssignedIdentityIndex, userAssignedIdentityItem := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityItem := userAssignedIdentityItem + var userAssignedIdentity storage.UserAssignedIdentityDetails + err := userAssignedIdentityItem.AssignProperties_To_UserAssignedIdentityDetails(&userAssignedIdentity) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityDetails() to populate field UserAssignedIdentities") + } + userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity + } + destination.UserAssignedIdentities = userAssignedIdentityList + } else { + destination.UserAssignedIdentities = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // 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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} // Storage version of v1api20211101.Identity_STATUS // Properties to configure User Assigned Identities for Bring your Own Keys @@ -297,6 +1404,110 @@ type Identity_STATUS struct { 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 *storage.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 eris.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 eris.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 *storage.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]storage.UserAssignedIdentity_STATUS, len(identity.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + var userAssignedIdentity storage.UserAssignedIdentity_STATUS + err := userAssignedIdentityValue.AssignProperties_To_UserAssignedIdentity_STATUS(&userAssignedIdentity) + if err != nil { + return eris.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.NamespaceOperatorSpec // Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure type NamespaceOperatorSpec struct { @@ -306,6 +1517,152 @@ 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 *storage.NamespaceOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // Secrets + if source.Secrets != nil { + var secret NamespaceOperatorSecrets + err := secret.AssignProperties_From_NamespaceOperatorSecrets(source.Secrets) + if err != nil { + return eris.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 eris.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 *storage.NamespaceOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Secrets + if operator.Secrets != nil { + var secret storage.NamespaceOperatorSecrets + err := operator.Secrets.AssignProperties_To_NamespaceOperatorSecrets(&secret) + if err != nil { + return eris.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.PrivateEndpointConnection_STATUS // Properties of the PrivateEndpointConnection. type PrivateEndpointConnection_STATUS struct { @@ -313,6 +1670,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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.SBSku // SKU of the namespace. type SBSku struct { @@ -322,6 +1735,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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.SBSku_STATUS // SKU of the namespace. type SBSku_STATUS struct { @@ -331,6 +1812,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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.SystemData_STATUS // Metadata pertaining to creation and last modification of the resource. type SystemData_STATUS struct { @@ -343,6 +1892,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 *storage.SystemData_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // CreatedAt + data.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // CreatedBy + data.CreatedBy = genruntime.ClonePointerToString(source.CreatedBy) + + // CreatedByType + data.CreatedByType = genruntime.ClonePointerToString(source.CreatedByType) + + // LastModifiedAt + data.LastModifiedAt = genruntime.ClonePointerToString(source.LastModifiedAt) + + // LastModifiedBy + data.LastModifiedBy = genruntime.ClonePointerToString(source.LastModifiedBy) + + // LastModifiedByType + data.LastModifiedByType = genruntime.ClonePointerToString(source.LastModifiedByType) + + // Update the property bag + if len(propertyBag) > 0 { + data.PropertyBag = propertyBag + } else { + data.PropertyBag = nil + } + + // Invoke the augmentConversionForSystemData_STATUS interface (if implemented) to customize the conversion + var dataAsAny any = data + if augmentedData, ok := dataAsAny.(augmentConversionForSystemData_STATUS); ok { + err := augmentedData.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_SystemData_STATUS populates the provided destination SystemData_STATUS from our SystemData_STATUS +func (data *SystemData_STATUS) AssignProperties_To_SystemData_STATUS(destination *storage.SystemData_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(data.PropertyBag) + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(data.CreatedAt) + + // CreatedBy + destination.CreatedBy = genruntime.ClonePointerToString(data.CreatedBy) + + // CreatedByType + destination.CreatedByType = genruntime.ClonePointerToString(data.CreatedByType) + + // LastModifiedAt + destination.LastModifiedAt = genruntime.ClonePointerToString(data.LastModifiedAt) + + // LastModifiedBy + destination.LastModifiedBy = genruntime.ClonePointerToString(data.LastModifiedBy) + + // LastModifiedByType + destination.LastModifiedByType = genruntime.ClonePointerToString(data.LastModifiedByType) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForSystemData_STATUS interface (if implemented) to customize the conversion + var dataAsAny any = data + if augmentedData, ok := dataAsAny.(augmentConversionForSystemData_STATUS); ok { + err := augmentedData.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForEncryption interface { + AssignPropertiesFrom(src *storage.Encryption) error + AssignPropertiesTo(dst *storage.Encryption) error +} + +type augmentConversionForEncryption_STATUS interface { + AssignPropertiesFrom(src *storage.Encryption_STATUS) error + AssignPropertiesTo(dst *storage.Encryption_STATUS) error +} + +type augmentConversionForIdentity interface { + AssignPropertiesFrom(src *storage.Identity) error + AssignPropertiesTo(dst *storage.Identity) error +} + +type augmentConversionForIdentity_STATUS interface { + AssignPropertiesFrom(src *storage.Identity_STATUS) error + AssignPropertiesTo(dst *storage.Identity_STATUS) error +} + +type augmentConversionForNamespaceOperatorSpec interface { + AssignPropertiesFrom(src *storage.NamespaceOperatorSpec) error + AssignPropertiesTo(dst *storage.NamespaceOperatorSpec) error +} + +type augmentConversionForPrivateEndpointConnection_STATUS interface { + AssignPropertiesFrom(src *storage.PrivateEndpointConnection_STATUS) error + AssignPropertiesTo(dst *storage.PrivateEndpointConnection_STATUS) error +} + +type augmentConversionForSBSku interface { + AssignPropertiesFrom(src *storage.SBSku) error + AssignPropertiesTo(dst *storage.SBSku) error +} + +type augmentConversionForSBSku_STATUS interface { + AssignPropertiesFrom(src *storage.SBSku_STATUS) error + AssignPropertiesTo(dst *storage.SBSku_STATUS) error +} + +type augmentConversionForSystemData_STATUS interface { + AssignPropertiesFrom(src *storage.SystemData_STATUS) error + AssignPropertiesTo(dst *storage.SystemData_STATUS) error +} + // Storage version of v1api20211101.KeyVaultProperties // Properties to configure keyVault Properties type KeyVaultProperties struct { @@ -353,6 +2033,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 *storage.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 eris.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 eris.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 *storage.KeyVaultProperties) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) + + // Identity + if properties.Identity != nil { + var identity storage.UserAssignedIdentityProperties + err := properties.Identity.AssignProperties_To_UserAssignedIdentityProperties(&identity) + if err != nil { + return eris.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.KeyVaultProperties_STATUS // Properties to configure keyVault Properties type KeyVaultProperties_STATUS struct { @@ -363,6 +2135,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 *storage.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 eris.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 eris.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 *storage.KeyVaultProperties_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(properties.PropertyBag) + + // Identity + if properties.Identity != nil { + var identity storage.UserAssignedIdentityProperties_STATUS + err := properties.Identity.AssignProperties_To_UserAssignedIdentityProperties_STATUS(&identity) + if err != nil { + return eris.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.NamespaceOperatorSecrets type NamespaceOperatorSecrets struct { Endpoint *genruntime.SecretDestination `json:"endpoint,omitempty"` @@ -373,6 +2237,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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.UserAssignedIdentity_STATUS // Recognized Dictionary value. type UserAssignedIdentity_STATUS struct { @@ -381,6 +2375,68 @@ type UserAssignedIdentity_STATUS struct { 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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.UserAssignedIdentityDetails // Information about the user assigned identity for the resource type UserAssignedIdentityDetails struct { @@ -388,6 +2444,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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForKeyVaultProperties interface { + AssignPropertiesFrom(src *storage.KeyVaultProperties) error + AssignPropertiesTo(dst *storage.KeyVaultProperties) error +} + +type augmentConversionForKeyVaultProperties_STATUS interface { + AssignPropertiesFrom(src *storage.KeyVaultProperties_STATUS) error + AssignPropertiesTo(dst *storage.KeyVaultProperties_STATUS) error +} + +type augmentConversionForNamespaceOperatorSecrets interface { + AssignPropertiesFrom(src *storage.NamespaceOperatorSecrets) error + AssignPropertiesTo(dst *storage.NamespaceOperatorSecrets) error +} + +type augmentConversionForUserAssignedIdentity_STATUS interface { + AssignPropertiesFrom(src *storage.UserAssignedIdentity_STATUS) error + AssignPropertiesTo(dst *storage.UserAssignedIdentity_STATUS) error +} + +type augmentConversionForUserAssignedIdentityDetails interface { + AssignPropertiesFrom(src *storage.UserAssignedIdentityDetails) error + AssignPropertiesTo(dst *storage.UserAssignedIdentityDetails) error +} + // Storage version of v1api20211101.UserAssignedIdentityProperties type UserAssignedIdentityProperties struct { PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` @@ -396,12 +2533,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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.UserAssignedIdentityProperties_STATUS type UserAssignedIdentityProperties_STATUS struct { PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` } +// AssignProperties_From_UserAssignedIdentityProperties_STATUS populates our UserAssignedIdentityProperties_STATUS from the provided source UserAssignedIdentityProperties_STATUS +func (properties *UserAssignedIdentityProperties_STATUS) AssignProperties_From_UserAssignedIdentityProperties_STATUS(source *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForUserAssignedIdentityProperties interface { + AssignPropertiesFrom(src *storage.UserAssignedIdentityProperties) error + AssignPropertiesTo(dst *storage.UserAssignedIdentityProperties) error +} + +type augmentConversionForUserAssignedIdentityProperties_STATUS interface { + AssignPropertiesFrom(src *storage.UserAssignedIdentityProperties_STATUS) error + AssignPropertiesTo(dst *storage.UserAssignedIdentityProperties_STATUS) error +} + func init() { SchemeBuilder.Register(&Namespace{}, &NamespaceList{}) } diff --git a/v2/api/servicebus/v1api20211101/storage/namespace_types_gen_test.go b/v2/api/servicebus/v1api20211101/storage/namespace_types_gen_test.go index 470c6b7a6c2..300264852cc 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespace_types_gen_test.go +++ b/v2/api/servicebus/v1api20211101/storage/namespace_types_gen_test.go @@ -5,6 +5,7 @@ package storage import ( "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -17,6 +18,48 @@ import ( "testing" ) +func Test_Encryption_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Encryption to Encryption via AssignProperties_To_Encryption & AssignProperties_From_Encryption returns original", + prop.ForAll(RunPropertyAssignmentTestForEncryption, EncryptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForEncryption tests if a specific instance of Encryption can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForEncryption(subject Encryption) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() @@ -92,6 +135,48 @@ func AddRelatedPropertyGeneratorsForEncryption(gens map[string]gopter.Gen) { gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultPropertiesGenerator()) } +func Test_Encryption_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Encryption_STATUS to Encryption_STATUS via AssignProperties_To_Encryption_STATUS & AssignProperties_From_Encryption_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForEncryption_STATUS, Encryption_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForEncryption_STATUS tests if a specific instance of Encryption_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForEncryption_STATUS(subject Encryption_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() @@ -167,6 +252,48 @@ func AddRelatedPropertyGeneratorsForEncryption_STATUS(gens map[string]gopter.Gen gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultProperties_STATUSGenerator()) } +func Test_Identity_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Identity to Identity via AssignProperties_To_Identity & AssignProperties_From_Identity returns original", + prop.ForAll(RunPropertyAssignmentTestForIdentity, IdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForIdentity tests if a specific instance of Identity can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForIdentity(subject Identity) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.Identity + err := copied.AssignProperties_To_Identity(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Identity + err = actual.AssignProperties_From_Identity(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Identity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -241,6 +368,48 @@ func AddRelatedPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { gens["UserAssignedIdentities"] = gen.SliceOf(UserAssignedIdentityDetailsGenerator()) } +func Test_Identity_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Identity_STATUS to Identity_STATUS via AssignProperties_To_Identity_STATUS & AssignProperties_From_Identity_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForIdentity_STATUS, Identity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForIdentity_STATUS tests if a specific instance of Identity_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForIdentity_STATUS(subject Identity_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.Identity_STATUS + err := copied.AssignProperties_To_Identity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Identity_STATUS + err = actual.AssignProperties_From_Identity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_Identity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -319,6 +488,48 @@ func AddRelatedPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) UserAssignedIdentity_STATUSGenerator()) } +func Test_KeyVaultProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from KeyVaultProperties to KeyVaultProperties via AssignProperties_To_KeyVaultProperties & AssignProperties_From_KeyVaultProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForKeyVaultProperties, KeyVaultPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForKeyVaultProperties tests if a specific instance of KeyVaultProperties can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForKeyVaultProperties(subject KeyVaultProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() @@ -395,6 +606,48 @@ func AddRelatedPropertyGeneratorsForKeyVaultProperties(gens map[string]gopter.Ge gens["Identity"] = gen.PtrOf(UserAssignedIdentityPropertiesGenerator()) } +func Test_KeyVaultProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from KeyVaultProperties_STATUS to KeyVaultProperties_STATUS via AssignProperties_To_KeyVaultProperties_STATUS & AssignProperties_From_KeyVaultProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForKeyVaultProperties_STATUS, KeyVaultProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForKeyVaultProperties_STATUS tests if a specific instance of KeyVaultProperties_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForKeyVaultProperties_STATUS(subject KeyVaultProperties_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() @@ -472,6 +725,91 @@ func AddRelatedPropertyGeneratorsForKeyVaultProperties_STATUS(gens map[string]go gens["Identity"] = gen.PtrOf(UserAssignedIdentityProperties_STATUSGenerator()) } +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 storage.Namespace + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual Namespace + err = actual.ConvertFrom(&hub) + if err != nil { + return err.Error() + } + + // Compare actual with what we started with + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Namespace_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace to Namespace via AssignProperties_To_Namespace & AssignProperties_From_Namespace returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespace, NamespaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespace tests if a specific instance of Namespace can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespace(subject Namespace) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() @@ -533,6 +871,48 @@ func AddRelatedPropertyGeneratorsForNamespace(gens map[string]gopter.Gen) { gens["Status"] = Namespace_STATUSGenerator() } +func Test_NamespaceOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespaceOperatorSecrets to NamespaceOperatorSecrets via AssignProperties_To_NamespaceOperatorSecrets & AssignProperties_From_NamespaceOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSecrets, NamespaceOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaceOperatorSecrets tests if a specific instance of NamespaceOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaceOperatorSecrets(subject NamespaceOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() @@ -588,6 +968,48 @@ func NamespaceOperatorSecretsGenerator() gopter.Gen { return namespaceOperatorSecretsGenerator } +func Test_NamespaceOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespaceOperatorSpec to NamespaceOperatorSpec via AssignProperties_To_NamespaceOperatorSpec & AssignProperties_From_NamespaceOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSpec, NamespaceOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaceOperatorSpec tests if a specific instance of NamespaceOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaceOperatorSpec(subject NamespaceOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() @@ -641,12 +1063,54 @@ func NamespaceOperatorSpecGenerator() gopter.Gen { AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(generators) namespaceOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespaceOperatorSpec{}), generators) - return namespaceOperatorSpecGenerator -} + 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_Namespace_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace_STATUS to Namespace_STATUS via AssignProperties_To_Namespace_STATUS & AssignProperties_From_Namespace_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespace_STATUS, Namespace_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespace_STATUS tests if a specific instance of Namespace_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespace_STATUS(subject Namespace_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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 + } -// AddRelatedPropertyGeneratorsForNamespaceOperatorSpec is a factory method for creating gopter generators -func AddRelatedPropertyGeneratorsForNamespaceOperatorSpec(gens map[string]gopter.Gen) { - gens["Secrets"] = gen.PtrOf(NamespaceOperatorSecretsGenerator()) + return "" } func Test_Namespace_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { @@ -742,6 +1206,48 @@ func AddRelatedPropertyGeneratorsForNamespace_STATUS(gens map[string]gopter.Gen) gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } +func Test_Namespace_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace_Spec to Namespace_Spec via AssignProperties_To_Namespace_Spec & AssignProperties_From_Namespace_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespace_Spec, Namespace_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespace_Spec tests if a specific instance of Namespace_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespace_Spec(subject Namespace_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() @@ -827,6 +1333,48 @@ func AddRelatedPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { gens["Sku"] = gen.PtrOf(SBSkuGenerator()) } +func Test_PrivateEndpointConnection_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from PrivateEndpointConnection_STATUS to PrivateEndpointConnection_STATUS via AssignProperties_To_PrivateEndpointConnection_STATUS & AssignProperties_From_PrivateEndpointConnection_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS tests if a specific instance of PrivateEndpointConnection_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() @@ -888,6 +1436,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 storage 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 storage.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() @@ -950,6 +1540,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 storage 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 storage.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() @@ -1012,6 +1644,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 storage and back losslessly +func RunPropertyAssignmentTestForSystemData_STATUS(subject SystemData_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.SystemData_STATUS + err := copied.AssignProperties_To_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SystemData_STATUS + err = actual.AssignProperties_From_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_SystemData_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1077,6 +1751,48 @@ func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter gens["LastModifiedByType"] = gen.PtrOf(gen.AlphaString()) } +func Test_UserAssignedIdentityDetails_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentityDetails to UserAssignedIdentityDetails via AssignProperties_To_UserAssignedIdentityDetails & AssignProperties_From_UserAssignedIdentityDetails returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityDetails tests if a specific instance of UserAssignedIdentityDetails can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.UserAssignedIdentityDetails + err := copied.AssignProperties_To_UserAssignedIdentityDetails(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAssignedIdentityDetails + err = actual.AssignProperties_From_UserAssignedIdentityDetails(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_UserAssignedIdentityDetails_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -1132,6 +1848,48 @@ func UserAssignedIdentityDetailsGenerator() gopter.Gen { return userAssignedIdentityDetailsGenerator } +func Test_UserAssignedIdentityProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentityProperties to UserAssignedIdentityProperties via AssignProperties_To_UserAssignedIdentityProperties & AssignProperties_From_UserAssignedIdentityProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityProperties, UserAssignedIdentityPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityProperties tests if a specific instance of UserAssignedIdentityProperties can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityProperties(subject UserAssignedIdentityProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() @@ -1187,6 +1945,48 @@ func UserAssignedIdentityPropertiesGenerator() gopter.Gen { return userAssignedIdentityPropertiesGenerator } +func Test_UserAssignedIdentityProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentityProperties_STATUS to UserAssignedIdentityProperties_STATUS via AssignProperties_To_UserAssignedIdentityProperties_STATUS & AssignProperties_From_UserAssignedIdentityProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS, UserAssignedIdentityProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS tests if a specific instance of UserAssignedIdentityProperties_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS(subject UserAssignedIdentityProperties_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() @@ -1248,6 +2048,48 @@ func AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties_STATUS(ge gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) } +func Test_UserAssignedIdentity_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentity_STATUS to UserAssignedIdentity_STATUS via AssignProperties_To_UserAssignedIdentity_STATUS & AssignProperties_From_UserAssignedIdentity_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentity_STATUS, UserAssignedIdentity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentity_STATUS tests if a specific instance of UserAssignedIdentity_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentity_STATUS(subject UserAssignedIdentity_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20211101/storage/namespaces_authorization_rule_types_gen.go index fad6fa316d0..0929a3921a3 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_authorization_rule_types_gen.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_authorization_rule_types_gen.go @@ -4,6 +4,8 @@ package storage import ( + "fmt" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" @@ -12,14 +14,11 @@ import ( "github.com/rotisserie/eris" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// +kubebuilder:rbac:groups=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" @@ -47,6 +46,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.(*storage.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/NamespacesAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_From_NamespacesAuthorizationRule(source) +} + +// ConvertTo populates the provided hub NamespacesAuthorizationRule from our NamespacesAuthorizationRule +func (rule *NamespacesAuthorizationRule) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*storage.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/NamespacesAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) +} + var _ configmaps.Exporter = &NamespacesAuthorizationRule{} // ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property @@ -142,8 +163,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 *storage.NamespacesAuthorizationRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec NamespacesAuthorizationRule_Spec + err := spec.AssignProperties_From_NamespacesAuthorizationRule_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status NamespacesAuthorizationRule_STATUS + err = status.AssignProperties_From_NamespacesAuthorizationRule_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRule_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 eris.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 *storage.NamespacesAuthorizationRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec storage.NamespacesAuthorizationRule_Spec + err := rule.Spec.AssignProperties_To_NamespacesAuthorizationRule_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.NamespacesAuthorizationRule_STATUS + err = rule.Status.AssignProperties_To_NamespacesAuthorizationRule_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRule_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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (rule *NamespacesAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { @@ -165,6 +253,11 @@ type NamespacesAuthorizationRuleList struct { Items []NamespacesAuthorizationRule `json:"items"` } +type augmentConversionForNamespacesAuthorizationRule interface { + AssignPropertiesFrom(src *storage.NamespacesAuthorizationRule) error + AssignPropertiesTo(dst *storage.NamespacesAuthorizationRule) error +} + // Storage version of v1api20211101.NamespacesAuthorizationRule_Spec type NamespacesAuthorizationRule_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 @@ -186,20 +279,158 @@ var _ genruntime.ConvertibleSpec = &NamespacesAuthorizationRule_Spec{} // ConvertSpecFrom populates our NamespacesAuthorizationRule_Spec from the provided source func (rule *NamespacesAuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == rule { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*storage.NamespacesAuthorizationRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_NamespacesAuthorizationRule_Spec(src) } - return source.ConvertSpecTo(rule) + // Convert to an intermediate form + src = &storage.NamespacesAuthorizationRule_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_NamespacesAuthorizationRule_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil } // ConvertSpecTo populates the provided destination from our NamespacesAuthorizationRule_Spec func (rule *NamespacesAuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == rule { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*storage.NamespacesAuthorizationRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_NamespacesAuthorizationRule_Spec(dst) } - return destination.ConvertSpecFrom(rule) + // Convert to an intermediate form + dst = &storage.NamespacesAuthorizationRule_Spec{} + err := rule.AssignProperties_To_NamespacesAuthorizationRule_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesAuthorizationRule_Spec populates our NamespacesAuthorizationRule_Spec from the provided source NamespacesAuthorizationRule_Spec +func (rule *NamespacesAuthorizationRule_Spec) AssignProperties_From_NamespacesAuthorizationRule_Spec(source *storage.NamespacesAuthorizationRule_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 eris.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 augmentConversionForNamespacesAuthorizationRule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesAuthorizationRule_Spec); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesAuthorizationRule_Spec populates the provided destination NamespacesAuthorizationRule_Spec from our NamespacesAuthorizationRule_Spec +func (rule *NamespacesAuthorizationRule_Spec) AssignProperties_To_NamespacesAuthorizationRule_Spec(destination *storage.NamespacesAuthorizationRule_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) + + // AzureName + destination.AzureName = rule.AzureName + + // OperatorSpec + if rule.OperatorSpec != nil { + var operatorSpec storage.NamespacesAuthorizationRuleOperatorSpec + err := rule.OperatorSpec.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&operatorSpec) + if err != nil { + return eris.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 augmentConversionForNamespacesAuthorizationRule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesAuthorizationRule_Spec); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20211101.NamespacesAuthorizationRule_STATUS @@ -218,20 +449,170 @@ var _ genruntime.ConvertibleStatus = &NamespacesAuthorizationRule_STATUS{} // ConvertStatusFrom populates our NamespacesAuthorizationRule_STATUS from the provided source func (rule *NamespacesAuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == rule { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*storage.NamespacesAuthorizationRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_NamespacesAuthorizationRule_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesAuthorizationRule_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_NamespacesAuthorizationRule_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") } - return source.ConvertStatusTo(rule) + return nil } // ConvertStatusTo populates the provided destination from our NamespacesAuthorizationRule_STATUS func (rule *NamespacesAuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == rule { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*storage.NamespacesAuthorizationRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_NamespacesAuthorizationRule_STATUS(dst) } - return destination.ConvertStatusFrom(rule) + // Convert to an intermediate form + dst = &storage.NamespacesAuthorizationRule_STATUS{} + err := rule.AssignProperties_To_NamespacesAuthorizationRule_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesAuthorizationRule_STATUS populates our NamespacesAuthorizationRule_STATUS from the provided source NamespacesAuthorizationRule_STATUS +func (rule *NamespacesAuthorizationRule_STATUS) AssignProperties_From_NamespacesAuthorizationRule_STATUS(source *storage.NamespacesAuthorizationRule_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 eris.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 augmentConversionForNamespacesAuthorizationRule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesAuthorizationRule_STATUS); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesAuthorizationRule_STATUS populates the provided destination NamespacesAuthorizationRule_STATUS from our NamespacesAuthorizationRule_STATUS +func (rule *NamespacesAuthorizationRule_STATUS) AssignProperties_To_NamespacesAuthorizationRule_STATUS(destination *storage.NamespacesAuthorizationRule_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 storage.SystemData_STATUS + err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Type + destination.Type = genruntime.ClonePointerToString(rule.Type) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesAuthorizationRule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesAuthorizationRule_STATUS); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespacesAuthorizationRule_Spec interface { + AssignPropertiesFrom(src *storage.NamespacesAuthorizationRule_Spec) error + AssignPropertiesTo(dst *storage.NamespacesAuthorizationRule_Spec) error +} + +type augmentConversionForNamespacesAuthorizationRule_STATUS interface { + AssignPropertiesFrom(src *storage.NamespacesAuthorizationRule_STATUS) error + AssignPropertiesTo(dst *storage.NamespacesAuthorizationRule_STATUS) error } // Storage version of v1api20211101.NamespacesAuthorizationRuleOperatorSpec @@ -243,6 +624,157 @@ 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 *storage.NamespacesAuthorizationRuleOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // Secrets + if source.Secrets != nil { + var secret NamespacesAuthorizationRuleOperatorSecrets + err := secret.AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source.Secrets) + if err != nil { + return eris.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 eris.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 *storage.NamespacesAuthorizationRuleOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Secrets + if operator.Secrets != nil { + var secret storage.NamespacesAuthorizationRuleOperatorSecrets + err := operator.Secrets.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&secret) + if err != nil { + return eris.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespacesAuthorizationRuleOperatorSpec interface { + AssignPropertiesFrom(src *storage.NamespacesAuthorizationRuleOperatorSpec) error + AssignPropertiesTo(dst *storage.NamespacesAuthorizationRuleOperatorSpec) error +} + // Storage version of v1api20211101.NamespacesAuthorizationRuleOperatorSecrets type NamespacesAuthorizationRuleOperatorSecrets struct { PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` @@ -252,6 +784,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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespacesAuthorizationRuleOperatorSecrets interface { + AssignPropertiesFrom(src *storage.NamespacesAuthorizationRuleOperatorSecrets) error + AssignPropertiesTo(dst *storage.NamespacesAuthorizationRuleOperatorSecrets) error +} + func init() { SchemeBuilder.Register(&NamespacesAuthorizationRule{}, &NamespacesAuthorizationRuleList{}) } diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_authorization_rule_types_gen_test.go b/v2/api/servicebus/v1api20211101/storage/namespaces_authorization_rule_types_gen_test.go index ba52d02d54b..d8a45374dd9 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_authorization_rule_types_gen_test.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_authorization_rule_types_gen_test.go @@ -5,6 +5,7 @@ package storage import ( "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -17,6 +18,91 @@ import ( "testing" ) +func Test_NamespacesAuthorizationRule_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRule to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesAuthorizationRule tests if a specific instance of NamespacesAuthorizationRule round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub storage.NamespacesAuthorizationRule + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesAuthorizationRule + err = actual.ConvertFrom(&hub) + if err != nil { + return err.Error() + } + + // Compare actual with what we started with + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesAuthorizationRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRule to NamespacesAuthorizationRule via AssignProperties_To_NamespacesAuthorizationRule & AssignProperties_From_NamespacesAuthorizationRule returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRule tests if a specific instance of NamespacesAuthorizationRule can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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"] = NamespacesAuthorizationRule_STATUSGenerator() } +func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRuleOperatorSecrets to NamespacesAuthorizationRuleOperatorSecrets via AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets & AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets, NamespacesAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets tests if a specific instance of NamespacesAuthorizationRuleOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets(subject NamespacesAuthorizationRuleOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() @@ -134,6 +262,48 @@ func NamespacesAuthorizationRuleOperatorSecretsGenerator() gopter.Gen { return namespacesAuthorizationRuleOperatorSecretsGenerator } +func Test_NamespacesAuthorizationRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRuleOperatorSpec to NamespacesAuthorizationRuleOperatorSpec via AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec & AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec, NamespacesAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec tests if a specific instance of NamespacesAuthorizationRuleOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec(subject NamespacesAuthorizationRuleOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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() @@ -195,6 +365,48 @@ func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRuleOperatorSpec(gens gens["Secrets"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSecretsGenerator()) } +func Test_NamespacesAuthorizationRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRule_STATUS to NamespacesAuthorizationRule_STATUS via AssignProperties_To_NamespacesAuthorizationRule_STATUS & AssignProperties_From_NamespacesAuthorizationRule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRule_STATUS, NamespacesAuthorizationRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRule_STATUS tests if a specific instance of NamespacesAuthorizationRule_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRule_STATUS(subject NamespacesAuthorizationRule_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesAuthorizationRule_STATUS + err := copied.AssignProperties_To_NamespacesAuthorizationRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesAuthorizationRule_STATUS + err = actual.AssignProperties_From_NamespacesAuthorizationRule_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_NamespacesAuthorizationRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -274,6 +486,48 @@ func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_STATUS(gens map[ gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } +func Test_NamespacesAuthorizationRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRule_Spec to NamespacesAuthorizationRule_Spec via AssignProperties_To_NamespacesAuthorizationRule_Spec & AssignProperties_From_NamespacesAuthorizationRule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRule_Spec, NamespacesAuthorizationRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRule_Spec tests if a specific instance of NamespacesAuthorizationRule_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRule_Spec(subject NamespacesAuthorizationRule_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesAuthorizationRule_Spec + err := copied.AssignProperties_To_NamespacesAuthorizationRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesAuthorizationRule_Spec + err = actual.AssignProperties_From_NamespacesAuthorizationRule_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_NamespacesAuthorizationRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20211101/storage/namespaces_queue_types_gen.go index f446a8443e2..635d8e8b2f0 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_queue_types_gen.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_queue_types_gen.go @@ -4,6 +4,8 @@ package storage import ( + "fmt" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" @@ -12,14 +14,11 @@ import ( "github.com/rotisserie/eris" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// +kubebuilder:rbac:groups=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" @@ -47,6 +46,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.(*storage.NamespacesQueue) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/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.(*storage.NamespacesQueue) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/NamespacesQueue but received %T instead", hub) + } + + return queue.AssignProperties_To_NamespacesQueue(destination) +} + var _ configmaps.Exporter = &NamespacesQueue{} // ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property @@ -142,8 +163,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 *storage.NamespacesQueue) error { + + // ObjectMeta + queue.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec NamespacesQueue_Spec + err := spec.AssignProperties_From_NamespacesQueue_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesQueue_Spec() to populate field Spec") + } + queue.Spec = spec + + // Status + var status NamespacesQueue_STATUS + err = status.AssignProperties_From_NamespacesQueue_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesQueue_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 eris.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 *storage.NamespacesQueue) error { + + // ObjectMeta + destination.ObjectMeta = *queue.ObjectMeta.DeepCopy() + + // Spec + var spec storage.NamespacesQueue_Spec + err := queue.Spec.AssignProperties_To_NamespacesQueue_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesQueue_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.NamespacesQueue_STATUS + err = queue.Status.AssignProperties_To_NamespacesQueue_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesQueue_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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (queue *NamespacesQueue) OriginalGVK() *schema.GroupVersionKind { @@ -165,6 +253,11 @@ type NamespacesQueueList struct { Items []NamespacesQueue `json:"items"` } +type augmentConversionForNamespacesQueue interface { + AssignPropertiesFrom(src *storage.NamespacesQueue) error + AssignPropertiesTo(dst *storage.NamespacesQueue) error +} + // Storage version of v1api20211101.NamespacesQueue_Spec type NamespacesQueue_Spec struct { AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` @@ -201,20 +294,302 @@ var _ genruntime.ConvertibleSpec = &NamespacesQueue_Spec{} // ConvertSpecFrom populates our NamespacesQueue_Spec from the provided source func (queue *NamespacesQueue_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == queue { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*storage.NamespacesQueue_Spec) + if ok { + // Populate our instance from source + return queue.AssignProperties_From_NamespacesQueue_Spec(src) } - return source.ConvertSpecTo(queue) + // Convert to an intermediate form + src = &storage.NamespacesQueue_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = queue.AssignProperties_From_NamespacesQueue_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil } // ConvertSpecTo populates the provided destination from our NamespacesQueue_Spec func (queue *NamespacesQueue_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == queue { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*storage.NamespacesQueue_Spec) + if ok { + // Populate destination from our instance + return queue.AssignProperties_To_NamespacesQueue_Spec(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesQueue_Spec{} + err := queue.AssignProperties_To_NamespacesQueue_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") } - return destination.ConvertSpecFrom(queue) + return nil +} + +// AssignProperties_From_NamespacesQueue_Spec populates our NamespacesQueue_Spec from the provided source NamespacesQueue_Spec +func (queue *NamespacesQueue_Spec) AssignProperties_From_NamespacesQueue_Spec(source *storage.NamespacesQueue_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) + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesQueueOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesQueueOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesQueueOperatorSpec() to populate field OperatorSpec") + } + queue.OperatorSpec = &operatorSpec + } else { + queue.OperatorSpec = nil + } + + // 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 augmentConversionForNamespacesQueue_Spec interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespacesQueue_Spec); ok { + err := augmentedQueue.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesQueue_Spec populates the provided destination NamespacesQueue_Spec from our NamespacesQueue_Spec +func (queue *NamespacesQueue_Spec) AssignProperties_To_NamespacesQueue_Spec(destination *storage.NamespacesQueue_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) + + // OperatorSpec + if queue.OperatorSpec != nil { + var operatorSpec storage.NamespacesQueueOperatorSpec + err := queue.OperatorSpec.AssignProperties_To_NamespacesQueueOperatorSpec(&operatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesQueueOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // 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 augmentConversionForNamespacesQueue_Spec interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespacesQueue_Spec); ok { + err := augmentedQueue.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20211101.NamespacesQueue_STATUS @@ -254,20 +629,374 @@ var _ genruntime.ConvertibleStatus = &NamespacesQueue_STATUS{} // ConvertStatusFrom populates our NamespacesQueue_STATUS from the provided source func (queue *NamespacesQueue_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == queue { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*storage.NamespacesQueue_STATUS) + if ok { + // Populate our instance from source + return queue.AssignProperties_From_NamespacesQueue_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesQueue_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") } - return source.ConvertStatusTo(queue) + // Update our instance from src + err = queue.AssignProperties_From_NamespacesQueue_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil } // ConvertStatusTo populates the provided destination from our NamespacesQueue_STATUS func (queue *NamespacesQueue_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == queue { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*storage.NamespacesQueue_STATUS) + if ok { + // Populate destination from our instance + return queue.AssignProperties_To_NamespacesQueue_STATUS(dst) } - return destination.ConvertStatusFrom(queue) + // Convert to an intermediate form + dst = &storage.NamespacesQueue_STATUS{} + err := queue.AssignProperties_To_NamespacesQueue_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesQueue_STATUS populates our NamespacesQueue_STATUS from the provided source NamespacesQueue_STATUS +func (queue *NamespacesQueue_STATUS) AssignProperties_From_NamespacesQueue_STATUS(source *storage.NamespacesQueue_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 eris.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 eris.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 augmentConversionForNamespacesQueue_STATUS interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespacesQueue_STATUS); ok { + err := augmentedQueue.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesQueue_STATUS populates the provided destination NamespacesQueue_STATUS from our NamespacesQueue_STATUS +func (queue *NamespacesQueue_STATUS) AssignProperties_To_NamespacesQueue_STATUS(destination *storage.NamespacesQueue_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 storage.MessageCountDetails_STATUS + err := queue.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return eris.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 storage.SystemData_STATUS + err := queue.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // 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 augmentConversionForNamespacesQueue_STATUS interface (if implemented) to customize the conversion + var queueAsAny any = queue + if augmentedQueue, ok := queueAsAny.(augmentConversionForNamespacesQueue_STATUS); ok { + err := augmentedQueue.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespacesQueue_Spec interface { + AssignPropertiesFrom(src *storage.NamespacesQueue_Spec) error + AssignPropertiesTo(dst *storage.NamespacesQueue_Spec) error +} + +type augmentConversionForNamespacesQueue_STATUS interface { + AssignPropertiesFrom(src *storage.NamespacesQueue_STATUS) error + AssignPropertiesTo(dst *storage.NamespacesQueue_STATUS) error } // Storage version of v1api20211101.MessageCountDetails_STATUS @@ -281,6 +1010,86 @@ 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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.NamespacesQueueOperatorSpec // Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure type NamespacesQueueOperatorSpec struct { @@ -289,6 +1098,138 @@ type NamespacesQueueOperatorSpec struct { SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` } +// AssignProperties_From_NamespacesQueueOperatorSpec populates our NamespacesQueueOperatorSpec from the provided source NamespacesQueueOperatorSpec +func (operator *NamespacesQueueOperatorSpec) AssignProperties_From_NamespacesQueueOperatorSpec(source *storage.NamespacesQueueOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + operator.PropertyBag = propertyBag + } else { + operator.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesQueueOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesQueueOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesQueueOperatorSpec populates the provided destination NamespacesQueueOperatorSpec from our NamespacesQueueOperatorSpec +func (operator *NamespacesQueueOperatorSpec) AssignProperties_To_NamespacesQueueOperatorSpec(destination *storage.NamespacesQueueOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesQueueOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesQueueOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForMessageCountDetails_STATUS interface { + AssignPropertiesFrom(src *storage.MessageCountDetails_STATUS) error + AssignPropertiesTo(dst *storage.MessageCountDetails_STATUS) error +} + +type augmentConversionForNamespacesQueueOperatorSpec interface { + AssignPropertiesFrom(src *storage.NamespacesQueueOperatorSpec) error + AssignPropertiesTo(dst *storage.NamespacesQueueOperatorSpec) error +} + func init() { SchemeBuilder.Register(&NamespacesQueue{}, &NamespacesQueueList{}) } diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1api20211101/storage/namespaces_queue_types_gen_test.go index 040f02b9e2e..49c9eca0fcf 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_queue_types_gen_test.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_queue_types_gen_test.go @@ -5,6 +5,7 @@ package storage import ( "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -17,6 +18,48 @@ import ( "testing" ) +func Test_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 storage 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 storage.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() @@ -82,6 +125,91 @@ func AddIndependentPropertyGeneratorsForMessageCountDetails_STATUS(gens map[stri gens["TransferMessageCount"] = gen.PtrOf(gen.Int()) } +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 storage.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 storage 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 storage.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() @@ -143,6 +271,48 @@ func AddRelatedPropertyGeneratorsForNamespacesQueue(gens map[string]gopter.Gen) gens["Status"] = NamespacesQueue_STATUSGenerator() } +func Test_NamespacesQueueOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesQueueOperatorSpec to NamespacesQueueOperatorSpec via AssignProperties_To_NamespacesQueueOperatorSpec & AssignProperties_From_NamespacesQueueOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesQueueOperatorSpec, NamespacesQueueOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesQueueOperatorSpec tests if a specific instance of NamespacesQueueOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesQueueOperatorSpec(subject NamespacesQueueOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesQueueOperatorSpec + err := copied.AssignProperties_To_NamespacesQueueOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesQueueOperatorSpec + err = actual.AssignProperties_From_NamespacesQueueOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_NamespacesQueueOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -198,6 +368,48 @@ func NamespacesQueueOperatorSpecGenerator() gopter.Gen { return namespacesQueueOperatorSpecGenerator } +func Test_NamespacesQueue_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesQueue_STATUS to NamespacesQueue_STATUS via AssignProperties_To_NamespacesQueue_STATUS & AssignProperties_From_NamespacesQueue_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesQueue_STATUS, NamespacesQueue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesQueue_STATUS tests if a specific instance of NamespacesQueue_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesQueue_STATUS(subject NamespacesQueue_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesQueue_STATUS + err := copied.AssignProperties_To_NamespacesQueue_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesQueue_STATUS + err = actual.AssignProperties_From_NamespacesQueue_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_NamespacesQueue_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -298,6 +510,48 @@ func AddRelatedPropertyGeneratorsForNamespacesQueue_STATUS(gens map[string]gopte gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } +func Test_NamespacesQueue_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesQueue_Spec to NamespacesQueue_Spec via AssignProperties_To_NamespacesQueue_Spec & AssignProperties_From_NamespacesQueue_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesQueue_Spec, NamespacesQueue_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesQueue_Spec tests if a specific instance of NamespacesQueue_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesQueue_Spec(subject NamespacesQueue_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesQueue_Spec + err := copied.AssignProperties_To_NamespacesQueue_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesQueue_Spec + err = actual.AssignProperties_From_NamespacesQueue_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_NamespacesQueue_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20211101/storage/namespaces_topic_types_gen.go index c01fddb1b31..e2d0de7b6a1 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_topic_types_gen.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_topic_types_gen.go @@ -4,6 +4,8 @@ package storage import ( + "fmt" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" @@ -12,14 +14,11 @@ import ( "github.com/rotisserie/eris" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// +kubebuilder:rbac:groups=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" @@ -47,6 +46,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.(*storage.NamespacesTopic) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/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.(*storage.NamespacesTopic) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/NamespacesTopic but received %T instead", hub) + } + + return topic.AssignProperties_To_NamespacesTopic(destination) +} + var _ configmaps.Exporter = &NamespacesTopic{} // ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property @@ -142,8 +163,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 *storage.NamespacesTopic) error { + + // ObjectMeta + topic.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec NamespacesTopic_Spec + err := spec.AssignProperties_From_NamespacesTopic_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopic_Spec() to populate field Spec") + } + topic.Spec = spec + + // Status + var status NamespacesTopic_STATUS + err = status.AssignProperties_From_NamespacesTopic_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopic_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 eris.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 *storage.NamespacesTopic) error { + + // ObjectMeta + destination.ObjectMeta = *topic.ObjectMeta.DeepCopy() + + // Spec + var spec storage.NamespacesTopic_Spec + err := topic.Spec.AssignProperties_To_NamespacesTopic_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopic_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.NamespacesTopic_STATUS + err = topic.Status.AssignProperties_To_NamespacesTopic_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopic_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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (topic *NamespacesTopic) OriginalGVK() *schema.GroupVersionKind { @@ -165,6 +253,11 @@ type NamespacesTopicList struct { Items []NamespacesTopic `json:"items"` } +type augmentConversionForNamespacesTopic interface { + AssignPropertiesFrom(src *storage.NamespacesTopic) error + AssignPropertiesTo(dst *storage.NamespacesTopic) error +} + // Storage version of v1api20211101.NamespacesTopic_Spec type NamespacesTopic_Spec struct { AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` @@ -196,20 +289,262 @@ var _ genruntime.ConvertibleSpec = &NamespacesTopic_Spec{} // ConvertSpecFrom populates our NamespacesTopic_Spec from the provided source func (topic *NamespacesTopic_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == topic { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*storage.NamespacesTopic_Spec) + if ok { + // Populate our instance from source + return topic.AssignProperties_From_NamespacesTopic_Spec(src) } - return source.ConvertSpecTo(topic) + // Convert to an intermediate form + src = &storage.NamespacesTopic_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = topic.AssignProperties_From_NamespacesTopic_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil } // ConvertSpecTo populates the provided destination from our NamespacesTopic_Spec func (topic *NamespacesTopic_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == topic { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*storage.NamespacesTopic_Spec) + if ok { + // Populate destination from our instance + return topic.AssignProperties_To_NamespacesTopic_Spec(dst) } - return destination.ConvertSpecFrom(topic) + // Convert to an intermediate form + dst = &storage.NamespacesTopic_Spec{} + err := topic.AssignProperties_To_NamespacesTopic_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesTopic_Spec populates our NamespacesTopic_Spec from the provided source NamespacesTopic_Spec +func (topic *NamespacesTopic_Spec) AssignProperties_From_NamespacesTopic_Spec(source *storage.NamespacesTopic_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) + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesTopicOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesTopicOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicOperatorSpec() to populate field OperatorSpec") + } + topic.OperatorSpec = &operatorSpec + } else { + topic.OperatorSpec = nil + } + + // 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 augmentConversionForNamespacesTopic_Spec interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespacesTopic_Spec); ok { + err := augmentedTopic.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopic_Spec populates the provided destination NamespacesTopic_Spec from our NamespacesTopic_Spec +func (topic *NamespacesTopic_Spec) AssignProperties_To_NamespacesTopic_Spec(destination *storage.NamespacesTopic_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) + + // OperatorSpec + if topic.OperatorSpec != nil { + var operatorSpec storage.NamespacesTopicOperatorSpec + err := topic.OperatorSpec.AssignProperties_To_NamespacesTopicOperatorSpec(&operatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // 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 augmentConversionForNamespacesTopic_Spec interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespacesTopic_Spec); ok { + err := augmentedTopic.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20211101.NamespacesTopic_STATUS @@ -244,20 +579,334 @@ var _ genruntime.ConvertibleStatus = &NamespacesTopic_STATUS{} // ConvertStatusFrom populates our NamespacesTopic_STATUS from the provided source func (topic *NamespacesTopic_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == topic { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*storage.NamespacesTopic_STATUS) + if ok { + // Populate our instance from source + return topic.AssignProperties_From_NamespacesTopic_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesTopic_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = topic.AssignProperties_From_NamespacesTopic_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") } - return source.ConvertStatusTo(topic) + return nil } // ConvertStatusTo populates the provided destination from our NamespacesTopic_STATUS func (topic *NamespacesTopic_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == topic { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*storage.NamespacesTopic_STATUS) + if ok { + // Populate destination from our instance + return topic.AssignProperties_To_NamespacesTopic_STATUS(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesTopic_STATUS{} + err := topic.AssignProperties_To_NamespacesTopic_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesTopic_STATUS populates our NamespacesTopic_STATUS from the provided source NamespacesTopic_STATUS +func (topic *NamespacesTopic_STATUS) AssignProperties_From_NamespacesTopic_STATUS(source *storage.NamespacesTopic_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 eris.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 eris.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 augmentConversionForNamespacesTopic_STATUS interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespacesTopic_STATUS); ok { + err := augmentedTopic.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopic_STATUS populates the provided destination NamespacesTopic_STATUS from our NamespacesTopic_STATUS +func (topic *NamespacesTopic_STATUS) AssignProperties_To_NamespacesTopic_STATUS(destination *storage.NamespacesTopic_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 storage.MessageCountDetails_STATUS + err := topic.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return eris.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 } - return destination.ConvertStatusFrom(topic) + // 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 storage.SystemData_STATUS + err := topic.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // 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 augmentConversionForNamespacesTopic_STATUS interface (if implemented) to customize the conversion + var topicAsAny any = topic + if augmentedTopic, ok := topicAsAny.(augmentConversionForNamespacesTopic_STATUS); ok { + err := augmentedTopic.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespacesTopic_Spec interface { + AssignPropertiesFrom(src *storage.NamespacesTopic_Spec) error + AssignPropertiesTo(dst *storage.NamespacesTopic_Spec) error +} + +type augmentConversionForNamespacesTopic_STATUS interface { + AssignPropertiesFrom(src *storage.NamespacesTopic_STATUS) error + AssignPropertiesTo(dst *storage.NamespacesTopic_STATUS) error } // Storage version of v1api20211101.NamespacesTopicOperatorSpec @@ -268,6 +917,133 @@ type NamespacesTopicOperatorSpec struct { SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` } +// AssignProperties_From_NamespacesTopicOperatorSpec populates our NamespacesTopicOperatorSpec from the provided source NamespacesTopicOperatorSpec +func (operator *NamespacesTopicOperatorSpec) AssignProperties_From_NamespacesTopicOperatorSpec(source *storage.NamespacesTopicOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + operator.PropertyBag = propertyBag + } else { + operator.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesTopicOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesTopicOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicOperatorSpec populates the provided destination NamespacesTopicOperatorSpec from our NamespacesTopicOperatorSpec +func (operator *NamespacesTopicOperatorSpec) AssignProperties_To_NamespacesTopicOperatorSpec(destination *storage.NamespacesTopicOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesTopicOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesTopicOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespacesTopicOperatorSpec interface { + AssignPropertiesFrom(src *storage.NamespacesTopicOperatorSpec) error + AssignPropertiesTo(dst *storage.NamespacesTopicOperatorSpec) error +} + func init() { SchemeBuilder.Register(&NamespacesTopic{}, &NamespacesTopicList{}) } diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1api20211101/storage/namespaces_topic_types_gen_test.go index a9bde2ff7b6..9102a69fd38 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_topic_types_gen_test.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_topic_types_gen_test.go @@ -5,6 +5,7 @@ package storage import ( "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -17,6 +18,91 @@ import ( "testing" ) +func Test_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 storage.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 storage 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 storage.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"] = NamespacesTopic_STATUSGenerator() } +func Test_NamespacesTopicOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicOperatorSpec to NamespacesTopicOperatorSpec via AssignProperties_To_NamespacesTopicOperatorSpec & AssignProperties_From_NamespacesTopicOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicOperatorSpec, NamespacesTopicOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicOperatorSpec tests if a specific instance of NamespacesTopicOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicOperatorSpec(subject NamespacesTopicOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicOperatorSpec + err := copied.AssignProperties_To_NamespacesTopicOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicOperatorSpec + err = actual.AssignProperties_From_NamespacesTopicOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_NamespacesTopicOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -133,6 +261,48 @@ func NamespacesTopicOperatorSpecGenerator() gopter.Gen { return namespacesTopicOperatorSpecGenerator } +func Test_NamespacesTopic_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopic_STATUS to NamespacesTopic_STATUS via AssignProperties_To_NamespacesTopic_STATUS & AssignProperties_From_NamespacesTopic_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopic_STATUS, NamespacesTopic_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopic_STATUS tests if a specific instance of NamespacesTopic_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopic_STATUS(subject NamespacesTopic_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopic_STATUS + err := copied.AssignProperties_To_NamespacesTopic_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopic_STATUS + err = actual.AssignProperties_From_NamespacesTopic_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_NamespacesTopic_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -228,6 +398,48 @@ func AddRelatedPropertyGeneratorsForNamespacesTopic_STATUS(gens map[string]gopte gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } +func Test_NamespacesTopic_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopic_Spec to NamespacesTopic_Spec via AssignProperties_To_NamespacesTopic_Spec & AssignProperties_From_NamespacesTopic_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopic_Spec, NamespacesTopic_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopic_Spec tests if a specific instance of NamespacesTopic_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopic_Spec(subject NamespacesTopic_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopic_Spec + err := copied.AssignProperties_To_NamespacesTopic_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopic_Spec + err = actual.AssignProperties_From_NamespacesTopic_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_NamespacesTopic_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscription_types_gen.go index 653d8e1a948..0f94ce0a3ea 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscription_types_gen.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscription_types_gen.go @@ -4,6 +4,8 @@ package storage import ( + "fmt" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" @@ -12,14 +14,11 @@ import ( "github.com/rotisserie/eris" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// +kubebuilder:rbac:groups=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" @@ -47,6 +46,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.(*storage.NamespacesTopicsSubscription) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/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.(*storage.NamespacesTopicsSubscription) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/NamespacesTopicsSubscription but received %T instead", hub) + } + + return subscription.AssignProperties_To_NamespacesTopicsSubscription(destination) +} + var _ configmaps.Exporter = &NamespacesTopicsSubscription{} // ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property @@ -142,8 +163,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 *storage.NamespacesTopicsSubscription) error { + + // ObjectMeta + subscription.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec NamespacesTopicsSubscription_Spec + err := spec.AssignProperties_From_NamespacesTopicsSubscription_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicsSubscription_Spec() to populate field Spec") + } + subscription.Spec = spec + + // Status + var status NamespacesTopicsSubscription_STATUS + err = status.AssignProperties_From_NamespacesTopicsSubscription_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicsSubscription_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 eris.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 *storage.NamespacesTopicsSubscription) error { + + // ObjectMeta + destination.ObjectMeta = *subscription.ObjectMeta.DeepCopy() + + // Spec + var spec storage.NamespacesTopicsSubscription_Spec + err := subscription.Spec.AssignProperties_To_NamespacesTopicsSubscription_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicsSubscription_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.NamespacesTopicsSubscription_STATUS + err = subscription.Status.AssignProperties_To_NamespacesTopicsSubscription_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicsSubscription_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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (subscription *NamespacesTopicsSubscription) OriginalGVK() *schema.GroupVersionKind { @@ -165,6 +253,11 @@ type NamespacesTopicsSubscriptionList struct { Items []NamespacesTopicsSubscription `json:"items"` } +type augmentConversionForNamespacesTopicsSubscription interface { + AssignPropertiesFrom(src *storage.NamespacesTopicsSubscription) error + AssignPropertiesTo(dst *storage.NamespacesTopicsSubscription) error +} + // Storage version of v1api20211101.NamespacesTopicsSubscription_Spec type NamespacesTopicsSubscription_Spec struct { AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,omitempty"` @@ -199,20 +292,298 @@ var _ genruntime.ConvertibleSpec = &NamespacesTopicsSubscription_Spec{} // ConvertSpecFrom populates our NamespacesTopicsSubscription_Spec from the provided source func (subscription *NamespacesTopicsSubscription_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == subscription { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*storage.NamespacesTopicsSubscription_Spec) + if ok { + // Populate our instance from source + return subscription.AssignProperties_From_NamespacesTopicsSubscription_Spec(src) } - return source.ConvertSpecTo(subscription) + // Convert to an intermediate form + src = &storage.NamespacesTopicsSubscription_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = subscription.AssignProperties_From_NamespacesTopicsSubscription_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil } // ConvertSpecTo populates the provided destination from our NamespacesTopicsSubscription_Spec func (subscription *NamespacesTopicsSubscription_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == subscription { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*storage.NamespacesTopicsSubscription_Spec) + if ok { + // Populate destination from our instance + return subscription.AssignProperties_To_NamespacesTopicsSubscription_Spec(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesTopicsSubscription_Spec{} + err := subscription.AssignProperties_To_NamespacesTopicsSubscription_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesTopicsSubscription_Spec populates our NamespacesTopicsSubscription_Spec from the provided source NamespacesTopicsSubscription_Spec +func (subscription *NamespacesTopicsSubscription_Spec) AssignProperties_From_NamespacesTopicsSubscription_Spec(source *storage.NamespacesTopicsSubscription_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 eris.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) + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesTopicsSubscriptionOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesTopicsSubscriptionOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicsSubscriptionOperatorSpec() to populate field OperatorSpec") + } + subscription.OperatorSpec = &operatorSpec + } else { + subscription.OperatorSpec = nil + } + + // 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 augmentConversionForNamespacesTopicsSubscription_Spec interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespacesTopicsSubscription_Spec); ok { + err := augmentedSubscription.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } } - return destination.ConvertSpecFrom(subscription) + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscription_Spec populates the provided destination NamespacesTopicsSubscription_Spec from our NamespacesTopicsSubscription_Spec +func (subscription *NamespacesTopicsSubscription_Spec) AssignProperties_To_NamespacesTopicsSubscription_Spec(destination *storage.NamespacesTopicsSubscription_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 storage.SBClientAffineProperties + err := subscription.ClientAffineProperties.AssignProperties_To_SBClientAffineProperties(&clientAffineProperty) + if err != nil { + return eris.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) + + // OperatorSpec + if subscription.OperatorSpec != nil { + var operatorSpec storage.NamespacesTopicsSubscriptionOperatorSpec + err := subscription.OperatorSpec.AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec(&operatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // 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 augmentConversionForNamespacesTopicsSubscription_Spec interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespacesTopicsSubscription_Spec); ok { + err := augmentedSubscription.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20211101.NamespacesTopicsSubscription_STATUS @@ -249,20 +620,364 @@ var _ genruntime.ConvertibleStatus = &NamespacesTopicsSubscription_STATUS{} // ConvertStatusFrom populates our NamespacesTopicsSubscription_STATUS from the provided source func (subscription *NamespacesTopicsSubscription_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == subscription { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*storage.NamespacesTopicsSubscription_STATUS) + if ok { + // Populate our instance from source + return subscription.AssignProperties_From_NamespacesTopicsSubscription_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesTopicsSubscription_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = subscription.AssignProperties_From_NamespacesTopicsSubscription_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") } - return source.ConvertStatusTo(subscription) + return nil } // ConvertStatusTo populates the provided destination from our NamespacesTopicsSubscription_STATUS func (subscription *NamespacesTopicsSubscription_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == subscription { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*storage.NamespacesTopicsSubscription_STATUS) + if ok { + // Populate destination from our instance + return subscription.AssignProperties_To_NamespacesTopicsSubscription_STATUS(dst) } - return destination.ConvertStatusFrom(subscription) + // Convert to an intermediate form + dst = &storage.NamespacesTopicsSubscription_STATUS{} + err := subscription.AssignProperties_To_NamespacesTopicsSubscription_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesTopicsSubscription_STATUS populates our NamespacesTopicsSubscription_STATUS from the provided source NamespacesTopicsSubscription_STATUS +func (subscription *NamespacesTopicsSubscription_STATUS) AssignProperties_From_NamespacesTopicsSubscription_STATUS(source *storage.NamespacesTopicsSubscription_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 eris.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 eris.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 eris.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 augmentConversionForNamespacesTopicsSubscription_STATUS interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespacesTopicsSubscription_STATUS); ok { + err := augmentedSubscription.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscription_STATUS populates the provided destination NamespacesTopicsSubscription_STATUS from our NamespacesTopicsSubscription_STATUS +func (subscription *NamespacesTopicsSubscription_STATUS) AssignProperties_To_NamespacesTopicsSubscription_STATUS(destination *storage.NamespacesTopicsSubscription_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 storage.SBClientAffineProperties_STATUS + err := subscription.ClientAffineProperties.AssignProperties_To_SBClientAffineProperties_STATUS(&clientAffineProperty) + if err != nil { + return eris.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 storage.MessageCountDetails_STATUS + err := subscription.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return eris.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 storage.SystemData_STATUS + err := subscription.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // 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 augmentConversionForNamespacesTopicsSubscription_STATUS interface (if implemented) to customize the conversion + var subscriptionAsAny any = subscription + if augmentedSubscription, ok := subscriptionAsAny.(augmentConversionForNamespacesTopicsSubscription_STATUS); ok { + err := augmentedSubscription.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespacesTopicsSubscription_Spec interface { + AssignPropertiesFrom(src *storage.NamespacesTopicsSubscription_Spec) error + AssignPropertiesTo(dst *storage.NamespacesTopicsSubscription_Spec) error +} + +type augmentConversionForNamespacesTopicsSubscription_STATUS interface { + AssignPropertiesFrom(src *storage.NamespacesTopicsSubscription_STATUS) error + AssignPropertiesTo(dst *storage.NamespacesTopicsSubscription_STATUS) error } // Storage version of v1api20211101.NamespacesTopicsSubscriptionOperatorSpec @@ -273,6 +988,128 @@ type NamespacesTopicsSubscriptionOperatorSpec struct { SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` } +// AssignProperties_From_NamespacesTopicsSubscriptionOperatorSpec populates our NamespacesTopicsSubscriptionOperatorSpec from the provided source NamespacesTopicsSubscriptionOperatorSpec +func (operator *NamespacesTopicsSubscriptionOperatorSpec) AssignProperties_From_NamespacesTopicsSubscriptionOperatorSpec(source *storage.NamespacesTopicsSubscriptionOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + operator.PropertyBag = propertyBag + } else { + operator.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesTopicsSubscriptionOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesTopicsSubscriptionOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec populates the provided destination NamespacesTopicsSubscriptionOperatorSpec from our NamespacesTopicsSubscriptionOperatorSpec +func (operator *NamespacesTopicsSubscriptionOperatorSpec) AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec(destination *storage.NamespacesTopicsSubscriptionOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesTopicsSubscriptionOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesTopicsSubscriptionOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.SBClientAffineProperties // Properties specific to client affine subscriptions. type SBClientAffineProperties struct { @@ -282,6 +1119,94 @@ type SBClientAffineProperties struct { PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` } +// AssignProperties_From_SBClientAffineProperties populates our SBClientAffineProperties from the provided source SBClientAffineProperties +func (properties *SBClientAffineProperties) AssignProperties_From_SBClientAffineProperties(source *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.SBClientAffineProperties_STATUS // Properties specific to client affine subscriptions. type SBClientAffineProperties_STATUS struct { @@ -291,6 +1216,109 @@ type SBClientAffineProperties_STATUS struct { 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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespacesTopicsSubscriptionOperatorSpec interface { + AssignPropertiesFrom(src *storage.NamespacesTopicsSubscriptionOperatorSpec) error + AssignPropertiesTo(dst *storage.NamespacesTopicsSubscriptionOperatorSpec) error +} + +type augmentConversionForSBClientAffineProperties interface { + AssignPropertiesFrom(src *storage.SBClientAffineProperties) error + AssignPropertiesTo(dst *storage.SBClientAffineProperties) error +} + +type augmentConversionForSBClientAffineProperties_STATUS interface { + AssignPropertiesFrom(src *storage.SBClientAffineProperties_STATUS) error + AssignPropertiesTo(dst *storage.SBClientAffineProperties_STATUS) error +} + func init() { SchemeBuilder.Register(&NamespacesTopicsSubscription{}, &NamespacesTopicsSubscriptionList{}) } diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscription_types_gen_test.go b/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscription_types_gen_test.go index b93cfa1ccc6..a251714e4c6 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscription_types_gen_test.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscription_types_gen_test.go @@ -5,6 +5,7 @@ package storage import ( "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -17,6 +18,91 @@ import ( "testing" ) +func Test_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 storage.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 storage 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 storage.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"] = NamespacesTopicsSubscription_STATUSGenerator() } +func Test_NamespacesTopicsSubscriptionOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscriptionOperatorSpec to NamespacesTopicsSubscriptionOperatorSpec via AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec & AssignProperties_From_NamespacesTopicsSubscriptionOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscriptionOperatorSpec, NamespacesTopicsSubscriptionOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscriptionOperatorSpec tests if a specific instance of NamespacesTopicsSubscriptionOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionOperatorSpec(subject NamespacesTopicsSubscriptionOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicsSubscriptionOperatorSpec + err := copied.AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscriptionOperatorSpec + err = actual.AssignProperties_From_NamespacesTopicsSubscriptionOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_NamespacesTopicsSubscriptionOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -134,6 +262,48 @@ func NamespacesTopicsSubscriptionOperatorSpecGenerator() gopter.Gen { return namespacesTopicsSubscriptionOperatorSpecGenerator } +func Test_NamespacesTopicsSubscription_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscription_STATUS to NamespacesTopicsSubscription_STATUS via AssignProperties_To_NamespacesTopicsSubscription_STATUS & AssignProperties_From_NamespacesTopicsSubscription_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscription_STATUS, NamespacesTopicsSubscription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscription_STATUS tests if a specific instance of NamespacesTopicsSubscription_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscription_STATUS(subject NamespacesTopicsSubscription_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicsSubscription_STATUS + err := copied.AssignProperties_To_NamespacesTopicsSubscription_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscription_STATUS + err = actual.AssignProperties_From_NamespacesTopicsSubscription_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_NamespacesTopicsSubscription_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -231,6 +401,48 @@ func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_STATUS(gens map gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } +func Test_NamespacesTopicsSubscription_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscription_Spec to NamespacesTopicsSubscription_Spec via AssignProperties_To_NamespacesTopicsSubscription_Spec & AssignProperties_From_NamespacesTopicsSubscription_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscription_Spec, NamespacesTopicsSubscription_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscription_Spec tests if a specific instance of NamespacesTopicsSubscription_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscription_Spec(subject NamespacesTopicsSubscription_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicsSubscription_Spec + err := copied.AssignProperties_To_NamespacesTopicsSubscription_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscription_Spec + err = actual.AssignProperties_From_NamespacesTopicsSubscription_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_NamespacesTopicsSubscription_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -320,6 +532,48 @@ func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_Spec(gens map[s gens["OperatorSpec"] = gen.PtrOf(NamespacesTopicsSubscriptionOperatorSpecGenerator()) } +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 storage 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 storage.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() @@ -383,6 +637,48 @@ func AddIndependentPropertyGeneratorsForSBClientAffineProperties(gens map[string 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 storage 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 storage.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() diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscriptions_rule_types_gen.go index db139790201..0ba4523ab00 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscriptions_rule_types_gen.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscriptions_rule_types_gen.go @@ -4,6 +4,8 @@ package storage import ( + "fmt" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" @@ -12,14 +14,11 @@ import ( "github.com/rotisserie/eris" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// +kubebuilder:rbac:groups=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" @@ -47,6 +46,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.(*storage.NamespacesTopicsSubscriptionsRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/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.(*storage.NamespacesTopicsSubscriptionsRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(destination) +} + var _ configmaps.Exporter = &NamespacesTopicsSubscriptionsRule{} // ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property @@ -142,8 +163,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 *storage.NamespacesTopicsSubscriptionsRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec NamespacesTopicsSubscriptionsRule_Spec + err := spec.AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status NamespacesTopicsSubscriptionsRule_STATUS + err = status.AssignProperties_From_NamespacesTopicsSubscriptionsRule_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicsSubscriptionsRule_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 eris.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 *storage.NamespacesTopicsSubscriptionsRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec storage.NamespacesTopicsSubscriptionsRule_Spec + err := rule.Spec.AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.NamespacesTopicsSubscriptionsRule_STATUS + err = rule.Status.AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicsSubscriptionsRule_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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} // OriginalGVK returns a GroupValueKind for the original API version used to create the resource func (rule *NamespacesTopicsSubscriptionsRule) OriginalGVK() *schema.GroupVersionKind { @@ -165,6 +253,11 @@ type NamespacesTopicsSubscriptionsRuleList struct { Items []NamespacesTopicsSubscriptionsRule `json:"items"` } +type augmentConversionForNamespacesTopicsSubscriptionsRule interface { + AssignPropertiesFrom(src *storage.NamespacesTopicsSubscriptionsRule) error + AssignPropertiesTo(dst *storage.NamespacesTopicsSubscriptionsRule) error +} + // Storage version of v1api20211101.NamespacesTopicsSubscriptionsRule_Spec type NamespacesTopicsSubscriptionsRule_Spec struct { Action *Action `json:"action,omitempty"` @@ -190,20 +283,230 @@ var _ genruntime.ConvertibleSpec = &NamespacesTopicsSubscriptionsRule_Spec{} // ConvertSpecFrom populates our NamespacesTopicsSubscriptionsRule_Spec from the provided source func (rule *NamespacesTopicsSubscriptionsRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { - if source == rule { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + src, ok := source.(*storage.NamespacesTopicsSubscriptionsRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesTopicsSubscriptionsRule_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") } - return source.ConvertSpecTo(rule) + // Update our instance from src + err = rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil } // ConvertSpecTo populates the provided destination from our NamespacesTopicsSubscriptionsRule_Spec func (rule *NamespacesTopicsSubscriptionsRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { - if destination == rule { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + dst, ok := destination.(*storage.NamespacesTopicsSubscriptionsRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesTopicsSubscriptionsRule_Spec{} + err := rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec populates our NamespacesTopicsSubscriptionsRule_Spec from the provided source NamespacesTopicsSubscriptionsRule_Spec +func (rule *NamespacesTopicsSubscriptionsRule_Spec) AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec(source *storage.NamespacesTopicsSubscriptionsRule_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 eris.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 eris.Wrap(err, "calling AssignProperties_From_CorrelationFilter() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil + } + + // FilterType + rule.FilterType = genruntime.ClonePointerToString(source.FilterType) + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesTopicsSubscriptionsRuleOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesTopicsSubscriptionsRuleOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicsSubscriptionsRuleOperatorSpec() 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 + } + + // SqlFilter + if source.SqlFilter != nil { + var sqlFilter SqlFilter + err := sqlFilter.AssignProperties_From_SqlFilter(source.SqlFilter) + if err != nil { + return eris.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 augmentConversionForNamespacesTopicsSubscriptionsRule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesTopicsSubscriptionsRule_Spec); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec populates the provided destination NamespacesTopicsSubscriptionsRule_Spec from our NamespacesTopicsSubscriptionsRule_Spec +func (rule *NamespacesTopicsSubscriptionsRule_Spec) AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec(destination *storage.NamespacesTopicsSubscriptionsRule_Spec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) + + // Action + if rule.Action != nil { + var action storage.Action + err := rule.Action.AssignProperties_To_Action(&action) + if err != nil { + return eris.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 storage.CorrelationFilter + err := rule.CorrelationFilter.AssignProperties_To_CorrelationFilter(&correlationFilter) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_CorrelationFilter() to populate field CorrelationFilter") + } + destination.CorrelationFilter = &correlationFilter + } else { + destination.CorrelationFilter = nil + } + + // FilterType + destination.FilterType = genruntime.ClonePointerToString(rule.FilterType) + + // OperatorSpec + if rule.OperatorSpec != nil { + var operatorSpec storage.NamespacesTopicsSubscriptionsRuleOperatorSpec + err := rule.OperatorSpec.AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec(&operatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec() 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 + } + + // SqlFilter + if rule.SqlFilter != nil { + var sqlFilter storage.SqlFilter + err := rule.SqlFilter.AssignProperties_To_SqlFilter(&sqlFilter) + if err != nil { + return eris.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 augmentConversionForNamespacesTopicsSubscriptionsRule_Spec interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesTopicsSubscriptionsRule_Spec); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20211101.NamespacesTopicsSubscriptionsRule_STATUS @@ -225,20 +528,232 @@ var _ genruntime.ConvertibleStatus = &NamespacesTopicsSubscriptionsRule_STATUS{} // ConvertStatusFrom populates our NamespacesTopicsSubscriptionsRule_STATUS from the provided source func (rule *NamespacesTopicsSubscriptionsRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { - if source == rule { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + src, ok := source.(*storage.NamespacesTopicsSubscriptionsRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesTopicsSubscriptionsRule_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") } - return source.ConvertStatusTo(rule) + return nil } // ConvertStatusTo populates the provided destination from our NamespacesTopicsSubscriptionsRule_STATUS func (rule *NamespacesTopicsSubscriptionsRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { - if destination == rule { - return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + dst, ok := destination.(*storage.NamespacesTopicsSubscriptionsRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesTopicsSubscriptionsRule_STATUS{} + err := rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesTopicsSubscriptionsRule_STATUS populates our NamespacesTopicsSubscriptionsRule_STATUS from the provided source NamespacesTopicsSubscriptionsRule_STATUS +func (rule *NamespacesTopicsSubscriptionsRule_STATUS) AssignProperties_From_NamespacesTopicsSubscriptionsRule_STATUS(source *storage.NamespacesTopicsSubscriptionsRule_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 eris.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 eris.Wrap(err, "calling AssignProperties_From_CorrelationFilter_STATUS() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil } - return destination.ConvertStatusFrom(rule) + // 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 eris.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 eris.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 augmentConversionForNamespacesTopicsSubscriptionsRule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesTopicsSubscriptionsRule_STATUS); ok { + err := augmentedRule.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS populates the provided destination NamespacesTopicsSubscriptionsRule_STATUS from our NamespacesTopicsSubscriptionsRule_STATUS +func (rule *NamespacesTopicsSubscriptionsRule_STATUS) AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS(destination *storage.NamespacesTopicsSubscriptionsRule_STATUS) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(rule.PropertyBag) + + // Action + if rule.Action != nil { + var action storage.Action_STATUS + err := rule.Action.AssignProperties_To_Action_STATUS(&action) + if err != nil { + return eris.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 storage.CorrelationFilter_STATUS + err := rule.CorrelationFilter.AssignProperties_To_CorrelationFilter_STATUS(&correlationFilter) + if err != nil { + return eris.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 storage.SqlFilter_STATUS + err := rule.SqlFilter.AssignProperties_To_SqlFilter_STATUS(&sqlFilter) + if err != nil { + return eris.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 storage.SystemData_STATUS + err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Type + destination.Type = genruntime.ClonePointerToString(rule.Type) + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesTopicsSubscriptionsRule_STATUS interface (if implemented) to customize the conversion + var ruleAsAny any = rule + if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesTopicsSubscriptionsRule_STATUS); ok { + err := augmentedRule.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil } // Storage version of v1api20211101.Action @@ -251,6 +766,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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // 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. @@ -261,6 +854,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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForNamespacesTopicsSubscriptionsRule_Spec interface { + AssignPropertiesFrom(src *storage.NamespacesTopicsSubscriptionsRule_Spec) error + AssignPropertiesTo(dst *storage.NamespacesTopicsSubscriptionsRule_Spec) error +} + +type augmentConversionForNamespacesTopicsSubscriptionsRule_STATUS interface { + AssignPropertiesFrom(src *storage.NamespacesTopicsSubscriptionsRule_STATUS) error + AssignPropertiesTo(dst *storage.NamespacesTopicsSubscriptionsRule_STATUS) error +} + // Storage version of v1api20211101.CorrelationFilter // Represents the correlation filter expression. type CorrelationFilter struct { @@ -277,6 +958,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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.CorrelationFilter_STATUS // Represents the correlation filter expression. type CorrelationFilter_STATUS struct { @@ -293,6 +1094,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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // Storage version of v1api20211101.NamespacesTopicsSubscriptionsRuleOperatorSpec // Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure type NamespacesTopicsSubscriptionsRuleOperatorSpec struct { @@ -301,6 +1222,128 @@ type NamespacesTopicsSubscriptionsRuleOperatorSpec struct { SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` } +// AssignProperties_From_NamespacesTopicsSubscriptionsRuleOperatorSpec populates our NamespacesTopicsSubscriptionsRuleOperatorSpec from the provided source NamespacesTopicsSubscriptionsRuleOperatorSpec +func (operator *NamespacesTopicsSubscriptionsRuleOperatorSpec) AssignProperties_From_NamespacesTopicsSubscriptionsRuleOperatorSpec(source *storage.NamespacesTopicsSubscriptionsRuleOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(source.PropertyBag) + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + operator.PropertyBag = propertyBag + } else { + operator.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesTopicsSubscriptionsRuleOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesTopicsSubscriptionsRuleOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesFrom(source) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion") + } + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec populates the provided destination NamespacesTopicsSubscriptionsRuleOperatorSpec from our NamespacesTopicsSubscriptionsRuleOperatorSpec +func (operator *NamespacesTopicsSubscriptionsRuleOperatorSpec) AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec(destination *storage.NamespacesTopicsSubscriptionsRuleOperatorSpec) error { + // Clone the existing property bag + propertyBag := genruntime.NewPropertyBag(operator.PropertyBag) + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // Invoke the augmentConversionForNamespacesTopicsSubscriptionsRuleOperatorSpec interface (if implemented) to customize the conversion + var operatorAsAny any = operator + if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesTopicsSubscriptionsRuleOperatorSpec); ok { + err := augmentedOperator.AssignPropertiesTo(destination) + if err != nil { + return eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // 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 { @@ -310,6 +1353,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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + // 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 { @@ -319,6 +1440,119 @@ 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 *storage.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 eris.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 *storage.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 eris.Wrap(err, "calling augmented AssignPropertiesTo() for conversion") + } + } + + // No error + return nil +} + +type augmentConversionForAction interface { + AssignPropertiesFrom(src *storage.Action) error + AssignPropertiesTo(dst *storage.Action) error +} + +type augmentConversionForAction_STATUS interface { + AssignPropertiesFrom(src *storage.Action_STATUS) error + AssignPropertiesTo(dst *storage.Action_STATUS) error +} + +type augmentConversionForCorrelationFilter interface { + AssignPropertiesFrom(src *storage.CorrelationFilter) error + AssignPropertiesTo(dst *storage.CorrelationFilter) error +} + +type augmentConversionForCorrelationFilter_STATUS interface { + AssignPropertiesFrom(src *storage.CorrelationFilter_STATUS) error + AssignPropertiesTo(dst *storage.CorrelationFilter_STATUS) error +} + +type augmentConversionForNamespacesTopicsSubscriptionsRuleOperatorSpec interface { + AssignPropertiesFrom(src *storage.NamespacesTopicsSubscriptionsRuleOperatorSpec) error + AssignPropertiesTo(dst *storage.NamespacesTopicsSubscriptionsRuleOperatorSpec) error +} + +type augmentConversionForSqlFilter interface { + AssignPropertiesFrom(src *storage.SqlFilter) error + AssignPropertiesTo(dst *storage.SqlFilter) error +} + +type augmentConversionForSqlFilter_STATUS interface { + AssignPropertiesFrom(src *storage.SqlFilter_STATUS) error + AssignPropertiesTo(dst *storage.SqlFilter_STATUS) error +} + func init() { SchemeBuilder.Register(&NamespacesTopicsSubscriptionsRule{}, &NamespacesTopicsSubscriptionsRuleList{}) } diff --git a/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscriptions_rule_types_gen_test.go b/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscriptions_rule_types_gen_test.go index ae7a756de2a..df5bae8b05c 100644 --- a/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscriptions_rule_types_gen_test.go +++ b/v2/api/servicebus/v1api20211101/storage/namespaces_topics_subscriptions_rule_types_gen_test.go @@ -5,6 +5,7 @@ package storage import ( "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -17,6 +18,48 @@ import ( "testing" ) +func Test_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 storage 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 storage.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() @@ -79,6 +122,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 storage 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 storage.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() @@ -141,6 +226,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 storage 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 storage.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() @@ -212,6 +339,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 storage 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 storage.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() @@ -284,6 +453,91 @@ func AddIndependentPropertyGeneratorsForCorrelationFilter_STATUS(gens map[string gens["To"] = gen.PtrOf(gen.AlphaString()) } +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 storage.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 storage 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 storage.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() @@ -346,6 +600,48 @@ func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule(gens map[s gens["Status"] = NamespacesTopicsSubscriptionsRule_STATUSGenerator() } +func Test_NamespacesTopicsSubscriptionsRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscriptionsRuleOperatorSpec to NamespacesTopicsSubscriptionsRuleOperatorSpec via AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec & AssignProperties_From_NamespacesTopicsSubscriptionsRuleOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRuleOperatorSpec, NamespacesTopicsSubscriptionsRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRuleOperatorSpec tests if a specific instance of NamespacesTopicsSubscriptionsRuleOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRuleOperatorSpec(subject NamespacesTopicsSubscriptionsRuleOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicsSubscriptionsRuleOperatorSpec + err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscriptionsRuleOperatorSpec + err = actual.AssignProperties_From_NamespacesTopicsSubscriptionsRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + func Test_NamespacesTopicsSubscriptionsRuleOperatorSpec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -401,6 +697,48 @@ func NamespacesTopicsSubscriptionsRuleOperatorSpecGenerator() gopter.Gen { return namespacesTopicsSubscriptionsRuleOperatorSpecGenerator } +func Test_NamespacesTopicsSubscriptionsRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscriptionsRule_STATUS to NamespacesTopicsSubscriptionsRule_STATUS via AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS & AssignProperties_From_NamespacesTopicsSubscriptionsRule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_STATUS, NamespacesTopicsSubscriptionsRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_STATUS tests if a specific instance of NamespacesTopicsSubscriptionsRule_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_STATUS(subject NamespacesTopicsSubscriptionsRule_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicsSubscriptionsRule_STATUS + err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscriptionsRule_STATUS + err = actual.AssignProperties_From_NamespacesTopicsSubscriptionsRule_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_NamespacesTopicsSubscriptionsRule_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -483,6 +821,48 @@ func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS(gen gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) } +func Test_NamespacesTopicsSubscriptionsRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscriptionsRule_Spec to NamespacesTopicsSubscriptionsRule_Spec via AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec & AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_Spec, NamespacesTopicsSubscriptionsRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_Spec tests if a specific instance of NamespacesTopicsSubscriptionsRule_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_Spec(subject NamespacesTopicsSubscriptionsRule_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicsSubscriptionsRule_Spec + err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscriptionsRule_Spec + err = actual.AssignProperties_From_NamespacesTopicsSubscriptionsRule_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_NamespacesTopicsSubscriptionsRule_Spec_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { t.Parallel() parameters := gopter.DefaultTestParameters() @@ -563,6 +943,48 @@ func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(gens gens["SqlFilter"] = gen.PtrOf(SqlFilterGenerator()) } +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 storage 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 storage.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() @@ -625,6 +1047,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 storage 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 storage.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/v1api20211101/storage/structure.txt b/v2/api/servicebus/v1api20211101/storage/structure.txt index 4e58d174302..b46709cd05f 100644 --- a/v2/api/servicebus/v1api20211101/storage/structure.txt +++ b/v2/api/servicebus/v1api20211101/storage/structure.txt @@ -409,3 +409,52 @@ NamespacesTopicsSubscriptionsRule: Resource │ ├── 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 +augmentConversionForNamespacesAuthorizationRule_STATUS: Interface +augmentConversionForNamespacesAuthorizationRule_Spec: Interface +augmentConversionForNamespacesQueue: Interface +augmentConversionForNamespacesQueueOperatorSpec: Interface +augmentConversionForNamespacesQueue_STATUS: Interface +augmentConversionForNamespacesQueue_Spec: Interface +augmentConversionForNamespacesTopic: Interface +augmentConversionForNamespacesTopicOperatorSpec: Interface +augmentConversionForNamespacesTopic_STATUS: Interface +augmentConversionForNamespacesTopic_Spec: Interface +augmentConversionForNamespacesTopicsSubscription: Interface +augmentConversionForNamespacesTopicsSubscriptionOperatorSpec: Interface +augmentConversionForNamespacesTopicsSubscription_STATUS: Interface +augmentConversionForNamespacesTopicsSubscription_Spec: Interface +augmentConversionForNamespacesTopicsSubscriptionsRule: Interface +augmentConversionForNamespacesTopicsSubscriptionsRuleOperatorSpec: Interface +augmentConversionForNamespacesTopicsSubscriptionsRule_STATUS: Interface +augmentConversionForNamespacesTopicsSubscriptionsRule_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/v1api20221001preview/namespace_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespace_types_gen_test.go index 614adb0ae4b..e41a9a40bac 100644 --- a/v2/api/servicebus/v1api20221001preview/namespace_types_gen_test.go +++ b/v2/api/servicebus/v1api20221001preview/namespace_types_gen_test.go @@ -5,8 +5,8 @@ package v1api20221001preview import ( "encoding/json" - v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -752,7 +752,7 @@ func RunResourceConversionTestForNamespace(subject Namespace) string { copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.Namespace + var hub v20240101s.Namespace err := copied.ConvertTo(&hub) if err != nil { return err.Error() 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 index 0dda47b928f..860665ddc84 100644 --- a/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_types_gen_test.go +++ b/v2/api/servicebus/v1api20221001preview/namespaces_authorization_rule_types_gen_test.go @@ -5,8 +5,8 @@ package v1api20221001preview import ( "encoding/json" - v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -37,7 +37,7 @@ func RunResourceConversionTestForNamespacesAuthorizationRule(subject NamespacesA copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesAuthorizationRule + var hub v20240101s.NamespacesAuthorizationRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen_test.go index 60d7c13e65a..6f019d90cfa 100644 --- a/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen_test.go +++ b/v2/api/servicebus/v1api20221001preview/namespaces_queue_types_gen_test.go @@ -5,8 +5,8 @@ package v1api20221001preview import ( "encoding/json" - v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -144,7 +144,7 @@ func RunResourceConversionTestForNamespacesQueue(subject NamespacesQueue) string copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesQueue + var hub v20240101s.NamespacesQueue err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen_test.go index 38981d838b4..8b09e66af7a 100644 --- a/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen_test.go +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topic_types_gen_test.go @@ -5,8 +5,8 @@ package v1api20221001preview import ( "encoding/json" - v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -37,7 +37,7 @@ func RunResourceConversionTestForNamespacesTopic(subject NamespacesTopic) string copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesTopic + var hub v20240101s.NamespacesTopic err := copied.ConvertTo(&hub) if err != nil { return err.Error() 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 index bc0fe8a8250..716202a657b 100644 --- a/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_types_gen_test.go +++ b/v2/api/servicebus/v1api20221001preview/namespaces_topics_subscription_types_gen_test.go @@ -5,8 +5,8 @@ package v1api20221001preview import ( "encoding/json" - v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -37,7 +37,7 @@ func RunResourceConversionTestForNamespacesTopicsSubscription(subject Namespaces copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesTopicsSubscription + var hub v20240101s.NamespacesTopicsSubscription err := copied.ConvertTo(&hub) if err != nil { return err.Error() 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 index 991603c16ce..1cc0ce2c391 100644 --- 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 @@ -5,8 +5,8 @@ package v1api20221001preview import ( "encoding/json" - v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -472,7 +472,7 @@ func RunResourceConversionTestForNamespacesTopicsSubscriptionsRule(subject Names copied := subject.DeepCopy() // Convert to our hub version - var hub v20211101s.NamespacesTopicsSubscriptionsRule + var hub v20240101s.NamespacesTopicsSubscriptionsRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespace_types_gen.go b/v2/api/servicebus/v1api20221001preview/storage/namespace_types_gen.go index 20ef7b2d15a..3037f66cd98 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespace_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespace_types_gen.go @@ -4,7 +4,6 @@ package storage import ( - "fmt" storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -50,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.(*storage.Namespace) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/Namespace but received %T instead", hub) + // intermediate variable for conversion + var source storage.Namespace + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = namespace.AssignProperties_From_Namespace(&source) + if err != nil { + return eris.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.(*storage.Namespace) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/Namespace but received %T instead", hub) + // intermediate variable for conversion + var destination storage.Namespace + err := namespace.AssignProperties_To_Namespace(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from namespace") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return namespace.AssignProperties_To_Namespace(destination) + return nil } var _ configmaps.Exporter = &Namespace{} diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespace_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/storage/namespace_types_gen_test.go index be521a64def..ed328fefe89 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespace_types_gen_test.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespace_types_gen_test.go @@ -5,7 +5,8 @@ package storage import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -35,7 +36,7 @@ func RunPropertyAssignmentTestForEncryption(subject Encryption) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Encryption + var other v20211101s.Encryption err := copied.AssignProperties_To_Encryption(&other) if err != nil { return err.Error() @@ -152,7 +153,7 @@ func RunPropertyAssignmentTestForEncryption_STATUS(subject Encryption_STATUS) st copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Encryption_STATUS + var other v20211101s.Encryption_STATUS err := copied.AssignProperties_To_Encryption_STATUS(&other) if err != nil { return err.Error() @@ -269,7 +270,7 @@ func RunPropertyAssignmentTestForIdentity(subject Identity) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Identity + var other v20211101s.Identity err := copied.AssignProperties_To_Identity(&other) if err != nil { return err.Error() @@ -385,7 +386,7 @@ func RunPropertyAssignmentTestForIdentity_STATUS(subject Identity_STATUS) string copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Identity_STATUS + var other v20211101s.Identity_STATUS err := copied.AssignProperties_To_Identity_STATUS(&other) if err != nil { return err.Error() @@ -505,7 +506,7 @@ func RunPropertyAssignmentTestForKeyVaultProperties(subject KeyVaultProperties) copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.KeyVaultProperties + var other v20211101s.KeyVaultProperties err := copied.AssignProperties_To_KeyVaultProperties(&other) if err != nil { return err.Error() @@ -623,7 +624,7 @@ func RunPropertyAssignmentTestForKeyVaultProperties_STATUS(subject KeyVaultPrope copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.KeyVaultProperties_STATUS + var other v20211101s.KeyVaultProperties_STATUS err := copied.AssignProperties_To_KeyVaultProperties_STATUS(&other) if err != nil { return err.Error() @@ -743,7 +744,7 @@ func RunResourceConversionTestForNamespace(subject Namespace) string { copied := subject.DeepCopy() // Convert to our hub version - var hub storage.Namespace + var hub v20240101s.Namespace err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -785,7 +786,7 @@ func RunPropertyAssignmentTestForNamespace(subject Namespace) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Namespace + var other v20211101s.Namespace err := copied.AssignProperties_To_Namespace(&other) if err != nil { return err.Error() @@ -888,7 +889,7 @@ func RunPropertyAssignmentTestForNamespaceOperatorSecrets(subject NamespaceOpera copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespaceOperatorSecrets + var other v20211101s.NamespaceOperatorSecrets err := copied.AssignProperties_To_NamespaceOperatorSecrets(&other) if err != nil { return err.Error() @@ -985,7 +986,7 @@ func RunPropertyAssignmentTestForNamespaceOperatorSpec(subject NamespaceOperator copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespaceOperatorSpec + var other v20211101s.NamespaceOperatorSpec err := copied.AssignProperties_To_NamespaceOperatorSpec(&other) if err != nil { return err.Error() @@ -1088,7 +1089,7 @@ func RunPropertyAssignmentTestForNamespace_STATUS(subject Namespace_STATUS) stri copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Namespace_STATUS + var other v20211101s.Namespace_STATUS err := copied.AssignProperties_To_Namespace_STATUS(&other) if err != nil { return err.Error() @@ -1226,7 +1227,7 @@ func RunPropertyAssignmentTestForNamespace_Spec(subject Namespace_Spec) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Namespace_Spec + var other v20211101s.Namespace_Spec err := copied.AssignProperties_To_Namespace_Spec(&other) if err != nil { return err.Error() @@ -1356,7 +1357,7 @@ func RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS(subject Privat copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.PrivateEndpointConnection_STATUS + var other v20211101s.PrivateEndpointConnection_STATUS err := copied.AssignProperties_To_PrivateEndpointConnection_STATUS(&other) if err != nil { return err.Error() @@ -1459,7 +1460,7 @@ func RunPropertyAssignmentTestForSBSku(subject SBSku) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SBSku + var other v20211101s.SBSku err := copied.AssignProperties_To_SBSku(&other) if err != nil { return err.Error() @@ -1563,7 +1564,7 @@ func RunPropertyAssignmentTestForSBSku_STATUS(subject SBSku_STATUS) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SBSku_STATUS + var other v20211101s.SBSku_STATUS err := copied.AssignProperties_To_SBSku_STATUS(&other) if err != nil { return err.Error() @@ -1667,7 +1668,7 @@ func RunPropertyAssignmentTestForSystemData_STATUS(subject SystemData_STATUS) st copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SystemData_STATUS + var other v20211101s.SystemData_STATUS err := copied.AssignProperties_To_SystemData_STATUS(&other) if err != nil { return err.Error() @@ -1774,7 +1775,7 @@ func RunPropertyAssignmentTestForUserAssignedIdentityDetails(subject UserAssigne copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.UserAssignedIdentityDetails + var other v20211101s.UserAssignedIdentityDetails err := copied.AssignProperties_To_UserAssignedIdentityDetails(&other) if err != nil { return err.Error() @@ -1871,7 +1872,7 @@ func RunPropertyAssignmentTestForUserAssignedIdentityProperties(subject UserAssi copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.UserAssignedIdentityProperties + var other v20211101s.UserAssignedIdentityProperties err := copied.AssignProperties_To_UserAssignedIdentityProperties(&other) if err != nil { return err.Error() @@ -1968,7 +1969,7 @@ func RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS(subject U copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.UserAssignedIdentityProperties_STATUS + var other v20211101s.UserAssignedIdentityProperties_STATUS err := copied.AssignProperties_To_UserAssignedIdentityProperties_STATUS(&other) if err != nil { return err.Error() @@ -2071,7 +2072,7 @@ func RunPropertyAssignmentTestForUserAssignedIdentity_STATUS(subject UserAssigne copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.UserAssignedIdentity_STATUS + var other v20211101s.UserAssignedIdentity_STATUS err := copied.AssignProperties_To_UserAssignedIdentity_STATUS(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_authorization_rule_types_gen.go index 94915e44e50..49c6e04a7df 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_authorization_rule_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_authorization_rule_types_gen.go @@ -4,7 +4,6 @@ package storage import ( - "fmt" storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -50,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.(*storage.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesAuthorizationRule but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesAuthorizationRule + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = rule.AssignProperties_From_NamespacesAuthorizationRule(&source) + if err != nil { + return eris.Wrap(err, "converting from source to rule") } - return rule.AssignProperties_From_NamespacesAuthorizationRule(source) + return nil } // ConvertTo populates the provided hub NamespacesAuthorizationRule from our NamespacesAuthorizationRule func (rule *NamespacesAuthorizationRule) ConvertTo(hub conversion.Hub) error { - destination, ok := hub.(*storage.NamespacesAuthorizationRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesAuthorizationRule but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesAuthorizationRule + err := rule.AssignProperties_To_NamespacesAuthorizationRule(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from rule") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) + return nil } var _ configmaps.Exporter = &NamespacesAuthorizationRule{} diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_authorization_rule_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_authorization_rule_types_gen_test.go index 8936ae64005..0ee988f63a5 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_authorization_rule_types_gen_test.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_authorization_rule_types_gen_test.go @@ -5,7 +5,8 @@ package storage import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -36,7 +37,7 @@ func RunResourceConversionTestForNamespacesAuthorizationRule(subject NamespacesA copied := subject.DeepCopy() // Convert to our hub version - var hub storage.NamespacesAuthorizationRule + var hub v20240101s.NamespacesAuthorizationRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -78,7 +79,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRule(subject NamespacesA copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRule + var other v20211101s.NamespacesAuthorizationRule err := copied.AssignProperties_To_NamespacesAuthorizationRule(&other) if err != nil { return err.Error() @@ -182,7 +183,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets(subj copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRuleOperatorSecrets + var other v20211101s.NamespacesAuthorizationRuleOperatorSecrets err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&other) if err != nil { return err.Error() @@ -279,7 +280,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec(subject copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRuleOperatorSpec + var other v20211101s.NamespacesAuthorizationRuleOperatorSpec err := copied.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&other) if err != nil { return err.Error() @@ -382,7 +383,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRule_STATUS(subject Name copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRule_STATUS + var other v20211101s.NamespacesAuthorizationRule_STATUS err := copied.AssignProperties_To_NamespacesAuthorizationRule_STATUS(&other) if err != nil { return err.Error() @@ -503,7 +504,7 @@ func RunPropertyAssignmentTestForNamespacesAuthorizationRule_Spec(subject Namesp copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesAuthorizationRule_Spec + var other v20211101s.NamespacesAuthorizationRule_Spec err := copied.AssignProperties_To_NamespacesAuthorizationRule_Spec(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_queue_types_gen.go index c7be19d7e29..61f45c947b2 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_queue_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_queue_types_gen.go @@ -4,7 +4,6 @@ package storage import ( - "fmt" storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -50,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.(*storage.NamespacesQueue) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesQueue but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesQueue + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = queue.AssignProperties_From_NamespacesQueue(&source) + if err != nil { + return eris.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.(*storage.NamespacesQueue) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesQueue but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesQueue + err := queue.AssignProperties_To_NamespacesQueue(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from queue") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return queue.AssignProperties_To_NamespacesQueue(destination) + return nil } var _ configmaps.Exporter = &NamespacesQueue{} diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_queue_types_gen_test.go index e39fd09ca1b..f0a53cc5582 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_queue_types_gen_test.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_queue_types_gen_test.go @@ -5,7 +5,8 @@ package storage import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -35,7 +36,7 @@ func RunPropertyAssignmentTestForMessageCountDetails_STATUS(subject MessageCount copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.MessageCountDetails_STATUS + var other v20211101s.MessageCountDetails_STATUS err := copied.AssignProperties_To_MessageCountDetails_STATUS(&other) if err != nil { return err.Error() @@ -143,7 +144,7 @@ func RunResourceConversionTestForNamespacesQueue(subject NamespacesQueue) string copied := subject.DeepCopy() // Convert to our hub version - var hub storage.NamespacesQueue + var hub v20240101s.NamespacesQueue err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -185,7 +186,7 @@ func RunPropertyAssignmentTestForNamespacesQueue(subject NamespacesQueue) string copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesQueue + var other v20211101s.NamespacesQueue err := copied.AssignProperties_To_NamespacesQueue(&other) if err != nil { return err.Error() @@ -288,7 +289,7 @@ func RunPropertyAssignmentTestForNamespacesQueueOperatorSpec(subject NamespacesQ copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesQueueOperatorSpec + var other v20211101s.NamespacesQueueOperatorSpec err := copied.AssignProperties_To_NamespacesQueueOperatorSpec(&other) if err != nil { return err.Error() @@ -385,7 +386,7 @@ func RunPropertyAssignmentTestForNamespacesQueue_STATUS(subject NamespacesQueue_ copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesQueue_STATUS + var other v20211101s.NamespacesQueue_STATUS err := copied.AssignProperties_To_NamespacesQueue_STATUS(&other) if err != nil { return err.Error() @@ -527,7 +528,7 @@ func RunPropertyAssignmentTestForNamespacesQueue_Spec(subject NamespacesQueue_Sp copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesQueue_Spec + var other v20211101s.NamespacesQueue_Spec err := copied.AssignProperties_To_NamespacesQueue_Spec(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topic_types_gen.go index fc89579901b..540060ad62e 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topic_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topic_types_gen.go @@ -4,7 +4,6 @@ package storage import ( - "fmt" storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -50,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.(*storage.NamespacesTopic) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopic but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesTopic + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = topic.AssignProperties_From_NamespacesTopic(&source) + if err != nil { + return eris.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.(*storage.NamespacesTopic) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopic but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesTopic + err := topic.AssignProperties_To_NamespacesTopic(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from topic") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return topic.AssignProperties_To_NamespacesTopic(destination) + return nil } var _ configmaps.Exporter = &NamespacesTopic{} diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topic_types_gen_test.go index 67673a31209..4362c9b2dec 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topic_types_gen_test.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topic_types_gen_test.go @@ -5,7 +5,8 @@ package storage import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "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 storage.NamespacesTopic + var hub v20240101s.NamespacesTopic err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -78,7 +79,7 @@ func RunPropertyAssignmentTestForNamespacesTopic(subject NamespacesTopic) string copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopic + var other v20211101s.NamespacesTopic err := copied.AssignProperties_To_NamespacesTopic(&other) if err != nil { return err.Error() @@ -181,7 +182,7 @@ func RunPropertyAssignmentTestForNamespacesTopicOperatorSpec(subject NamespacesT copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicOperatorSpec + var other v20211101s.NamespacesTopicOperatorSpec err := copied.AssignProperties_To_NamespacesTopicOperatorSpec(&other) if err != nil { return err.Error() @@ -278,7 +279,7 @@ func RunPropertyAssignmentTestForNamespacesTopic_STATUS(subject NamespacesTopic_ copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopic_STATUS + var other v20211101s.NamespacesTopic_STATUS err := copied.AssignProperties_To_NamespacesTopic_STATUS(&other) if err != nil { return err.Error() @@ -415,7 +416,7 @@ func RunPropertyAssignmentTestForNamespacesTopic_Spec(subject NamespacesTopic_Sp copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopic_Spec + var other v20211101s.NamespacesTopic_Spec err := copied.AssignProperties_To_NamespacesTopic_Spec(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscription_types_gen.go index 47d5c701a66..64229ae4749 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscription_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscription_types_gen.go @@ -4,7 +4,6 @@ package storage import ( - "fmt" storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -50,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.(*storage.NamespacesTopicsSubscription) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopicsSubscription but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesTopicsSubscription + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = subscription.AssignProperties_From_NamespacesTopicsSubscription(&source) + if err != nil { + return eris.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.(*storage.NamespacesTopicsSubscription) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopicsSubscription but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesTopicsSubscription + err := subscription.AssignProperties_To_NamespacesTopicsSubscription(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from subscription") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return subscription.AssignProperties_To_NamespacesTopicsSubscription(destination) + return nil } var _ configmaps.Exporter = &NamespacesTopicsSubscription{} diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscription_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscription_types_gen_test.go index c2c28cf7b4a..34215314e2f 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscription_types_gen_test.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscription_types_gen_test.go @@ -5,7 +5,8 @@ package storage import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "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 storage.NamespacesTopicsSubscription + var hub v20240101s.NamespacesTopicsSubscription err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -78,7 +79,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscription(subject Namespaces copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscription + var other v20211101s.NamespacesTopicsSubscription err := copied.AssignProperties_To_NamespacesTopicsSubscription(&other) if err != nil { return err.Error() @@ -182,7 +183,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionOperatorSpec(subjec copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionOperatorSpec + var other v20211101s.NamespacesTopicsSubscriptionOperatorSpec err := copied.AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec(&other) if err != nil { return err.Error() @@ -279,7 +280,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscription_STATUS(subject Nam copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscription_STATUS + var other v20211101s.NamespacesTopicsSubscription_STATUS err := copied.AssignProperties_To_NamespacesTopicsSubscription_STATUS(&other) if err != nil { return err.Error() @@ -418,7 +419,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscription_Spec(subject Names copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscription_Spec + var other v20211101s.NamespacesTopicsSubscription_Spec err := copied.AssignProperties_To_NamespacesTopicsSubscription_Spec(&other) if err != nil { return err.Error() @@ -549,7 +550,7 @@ func RunPropertyAssignmentTestForSBClientAffineProperties(subject SBClientAffine copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SBClientAffineProperties + var other v20211101s.SBClientAffineProperties err := copied.AssignProperties_To_SBClientAffineProperties(&other) if err != nil { return err.Error() @@ -654,7 +655,7 @@ func RunPropertyAssignmentTestForSBClientAffineProperties_STATUS(subject SBClien copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SBClientAffineProperties_STATUS + var other v20211101s.SBClientAffineProperties_STATUS err := copied.AssignProperties_To_SBClientAffineProperties_STATUS(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscriptions_rule_types_gen.go index fe7c85c4867..08704368c0f 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscriptions_rule_types_gen.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscriptions_rule_types_gen.go @@ -4,7 +4,6 @@ package storage import ( - "fmt" storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" "github.com/Azure/azure-service-operator/v2/pkg/genruntime" "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" @@ -50,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.(*storage.NamespacesTopicsSubscriptionsRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + // intermediate variable for conversion + var source storage.NamespacesTopicsSubscriptionsRule + + err := source.ConvertFrom(hub) + if err != nil { + return eris.Wrap(err, "converting from hub to source") + } + + err = rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule(&source) + if err != nil { + return eris.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.(*storage.NamespacesTopicsSubscriptionsRule) - if !ok { - return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + // intermediate variable for conversion + var destination storage.NamespacesTopicsSubscriptionsRule + err := rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(&destination) + if err != nil { + return eris.Wrap(err, "converting to destination from rule") + } + err = destination.ConvertTo(hub) + if err != nil { + return eris.Wrap(err, "converting from destination to hub") } - return rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(destination) + return nil } var _ configmaps.Exporter = &NamespacesTopicsSubscriptionsRule{} diff --git a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscriptions_rule_types_gen_test.go b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscriptions_rule_types_gen_test.go index 842f23ec77d..37081101899 100644 --- a/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscriptions_rule_types_gen_test.go +++ b/v2/api/servicebus/v1api20221001preview/storage/namespaces_topics_subscriptions_rule_types_gen_test.go @@ -5,7 +5,8 @@ package storage import ( "encoding/json" - storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" + v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/kr/pretty" @@ -35,7 +36,7 @@ func RunPropertyAssignmentTestForAction(subject Action) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Action + var other v20211101s.Action err := copied.AssignProperties_To_Action(&other) if err != nil { return err.Error() @@ -139,7 +140,7 @@ func RunPropertyAssignmentTestForAction_STATUS(subject Action_STATUS) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.Action_STATUS + var other v20211101s.Action_STATUS err := copied.AssignProperties_To_Action_STATUS(&other) if err != nil { return err.Error() @@ -243,7 +244,7 @@ func RunPropertyAssignmentTestForCorrelationFilter(subject CorrelationFilter) st copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.CorrelationFilter + var other v20211101s.CorrelationFilter err := copied.AssignProperties_To_CorrelationFilter(&other) if err != nil { return err.Error() @@ -356,7 +357,7 @@ func RunPropertyAssignmentTestForCorrelationFilter_STATUS(subject CorrelationFil copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.CorrelationFilter_STATUS + var other v20211101s.CorrelationFilter_STATUS err := copied.AssignProperties_To_CorrelationFilter_STATUS(&other) if err != nil { return err.Error() @@ -471,7 +472,7 @@ func RunResourceConversionTestForNamespacesTopicsSubscriptionsRule(subject Names copied := subject.DeepCopy() // Convert to our hub version - var hub storage.NamespacesTopicsSubscriptionsRule + var hub v20240101s.NamespacesTopicsSubscriptionsRule err := copied.ConvertTo(&hub) if err != nil { return err.Error() @@ -513,7 +514,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule(subject Names copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionsRule + var other v20211101s.NamespacesTopicsSubscriptionsRule err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule(&other) if err != nil { return err.Error() @@ -617,7 +618,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRuleOperatorSpec(s copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionsRuleOperatorSpec + var other v20211101s.NamespacesTopicsSubscriptionsRuleOperatorSpec err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec(&other) if err != nil { return err.Error() @@ -714,7 +715,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_STATUS(subjec copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionsRule_STATUS + var other v20211101s.NamespacesTopicsSubscriptionsRule_STATUS err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS(&other) if err != nil { return err.Error() @@ -838,7 +839,7 @@ func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_Spec(subject copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.NamespacesTopicsSubscriptionsRule_Spec + var other v20211101s.NamespacesTopicsSubscriptionsRule_Spec err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec(&other) if err != nil { return err.Error() @@ -960,7 +961,7 @@ func RunPropertyAssignmentTestForSqlFilter(subject SqlFilter) string { copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SqlFilter + var other v20211101s.SqlFilter err := copied.AssignProperties_To_SqlFilter(&other) if err != nil { return err.Error() @@ -1064,7 +1065,7 @@ func RunPropertyAssignmentTestForSqlFilter_STATUS(subject SqlFilter_STATUS) stri copied := subject.DeepCopy() // Use AssignPropertiesTo() for the first stage of conversion - var other storage.SqlFilter_STATUS + var other v20211101s.SqlFilter_STATUS err := copied.AssignProperties_To_SqlFilter_STATUS(&other) if err != nil { return err.Error() diff --git a/v2/api/servicebus/v1api20240101/arm/namespace_spec_types_gen.go b/v2/api/servicebus/v1api20240101/arm/namespace_spec_types_gen.go new file mode 100644 index 00000000000..8b146b8f7b4 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespace_spec_types_gen.go @@ -0,0 +1,214 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type Namespace_Spec struct { + // Identity: Properties of BYOK Identity description + Identity *Identity `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 `json:"properties,omitempty"` + + // Sku: Properties of SKU + Sku *SBSku `json:"sku,omitempty"` + + // Tags: Resource tags + Tags map[string]string `json:"tags,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &Namespace_Spec{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (namespace Namespace_Spec) GetAPIVersion() string { + return "2024-01-01" +} + +// GetName returns the Name of the resource +func (namespace *Namespace_Spec) GetName() string { + return namespace.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces" +func (namespace *Namespace_Spec) GetType() string { + return "Microsoft.ServiceBus/namespaces" +} + +// 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 map[string]UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"` +} + +// Properties of the namespace. +type SBNamespaceProperties 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 `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 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 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"` +} + +// +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") +) + +// Mapping from string to Identity_Type +var identity_Type_Values = map[string]Identity_Type{ + "none": Identity_Type_None, + "systemassigned": Identity_Type_SystemAssigned, + "systemassigned, userassigned": Identity_Type_SystemAssignedUserAssigned, + "userassigned": Identity_Type_UserAssigned, +} + +// +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") +) + +// Mapping from string to SBNamespaceProperties_MinimumTlsVersion +var sBNamespaceProperties_MinimumTlsVersion_Values = map[string]SBNamespaceProperties_MinimumTlsVersion{ + "1.0": SBNamespaceProperties_MinimumTlsVersion_10, + "1.1": SBNamespaceProperties_MinimumTlsVersion_11, + "1.2": SBNamespaceProperties_MinimumTlsVersion_12, +} + +// +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") +) + +// Mapping from string to SBNamespaceProperties_PublicNetworkAccess +var sBNamespaceProperties_PublicNetworkAccess_Values = map[string]SBNamespaceProperties_PublicNetworkAccess{ + "disabled": SBNamespaceProperties_PublicNetworkAccess_Disabled, + "enabled": SBNamespaceProperties_PublicNetworkAccess_Enabled, + "securedbyperimeter": SBNamespaceProperties_PublicNetworkAccess_SecuredByPerimeter, +} + +// +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") +) + +// Mapping from string to SBSku_Name +var sBSku_Name_Values = map[string]SBSku_Name{ + "basic": SBSku_Name_Basic, + "premium": SBSku_Name_Premium, + "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") +) + +// Mapping from string to SBSku_Tier +var sBSku_Tier_Values = map[string]SBSku_Tier{ + "basic": SBSku_Tier_Basic, + "premium": SBSku_Tier_Premium, + "standard": SBSku_Tier_Standard, +} + +// Information about the user assigned identity for the resource +type UserAssignedIdentityDetails struct { +} + +// +kubebuilder:validation:Enum={"Microsoft.KeyVault"} +type Encryption_KeySource string + +const Encryption_KeySource_MicrosoftKeyVault = Encryption_KeySource("Microsoft.KeyVault") + +// Mapping from string to Encryption_KeySource +var encryption_KeySource_Values = map[string]Encryption_KeySource{ + "microsoft.keyvault": Encryption_KeySource_MicrosoftKeyVault, +} + +// 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"` +} + +type UserAssignedIdentityProperties struct { + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespace_spec_types_gen_test.go b/v2/api/servicebus/v1api20240101/arm/namespace_spec_types_gen_test.go new file mode 100644 index 00000000000..1d064283f0a --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespace_spec_types_gen_test.go @@ -0,0 +1,587 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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_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.MapOf( + gen.AlphaString(), + UserAssignedIdentityDetailsGenerator()) +} + +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_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["Location"] = gen.PtrOf(gen.AlphaString()) + gens["Name"] = gen.AlphaString() + gens["Tags"] = gen.MapOf( + gen.AlphaString(), + gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespace_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespace_Spec(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(IdentityGenerator()) + gens["Properties"] = gen.PtrOf(SBNamespacePropertiesGenerator()) + gens["Sku"] = gen.PtrOf(SBSkuGenerator()) +} + +func Test_SBNamespaceProperties_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 via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBNamespaceProperties, SBNamespacePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBNamespaceProperties runs a test to see if a specific instance of SBNamespaceProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForSBNamespaceProperties(subject SBNamespaceProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBNamespaceProperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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 instances for property testing - lazily instantiated by +// SBNamespacePropertiesGenerator() +var sbNamespacePropertiesGenerator gopter.Gen + +// SBNamespacePropertiesGenerator returns a generator of SBNamespaceProperties instances for property testing. +// We first initialize sbNamespacePropertiesGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func SBNamespacePropertiesGenerator() gopter.Gen { + if sbNamespacePropertiesGenerator != nil { + return sbNamespacePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBNamespaceProperties(generators) + sbNamespacePropertiesGenerator = gen.Struct(reflect.TypeOf(SBNamespaceProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBNamespaceProperties(generators) + AddRelatedPropertyGeneratorsForSBNamespaceProperties(generators) + sbNamespacePropertiesGenerator = gen.Struct(reflect.TypeOf(SBNamespaceProperties{}), generators) + + return sbNamespacePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForSBNamespaceProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBNamespaceProperties(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 is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBNamespaceProperties(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(EncryptionGenerator()) +} + +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_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) + AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties(generators) + userAssignedIdentityPropertiesGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties{}), generators) + + return userAssignedIdentityPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForUserAssignedIdentityProperties(gens map[string]gopter.Gen) { + gens["UserAssignedIdentity"] = gen.PtrOf(gen.AlphaString()) +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespace_status_types_gen.go b/v2/api/servicebus/v1api20240101/arm/namespace_status_types_gen.go new file mode 100644 index 00000000000..d57c8f53e8d --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespace_status_types_gen.go @@ -0,0 +1,297 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +type Namespace_STATUS struct { + // 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"` + + // Name: Resource name + Name *string `json:"name,omitempty"` + + // Properties: Properties of the namespace. + Properties *SBNamespaceProperties_STATUS `json:"properties,omitempty"` + + // Sku: Properties of SKU + Sku *SBSku_STATUS `json:"sku,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"` +} + +// 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"` +} + +// Properties of the namespace. +type SBNamespaceProperties_STATUS 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 `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 `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 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 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 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"` +} + +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") +) + +// Mapping from string to Identity_Type_STATUS +var identity_Type_STATUS_Values = map[string]Identity_Type_STATUS{ + "none": Identity_Type_STATUS_None, + "systemassigned": Identity_Type_STATUS_SystemAssigned, + "systemassigned, userassigned": Identity_Type_STATUS_SystemAssignedUserAssigned, + "userassigned": Identity_Type_STATUS_UserAssigned, +} + +// 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"` +} + +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") +) + +// Mapping from string to SBNamespaceProperties_MinimumTlsVersion_STATUS +var sBNamespaceProperties_MinimumTlsVersion_STATUS_Values = map[string]SBNamespaceProperties_MinimumTlsVersion_STATUS{ + "1.0": SBNamespaceProperties_MinimumTlsVersion_STATUS_10, + "1.1": SBNamespaceProperties_MinimumTlsVersion_STATUS_11, + "1.2": SBNamespaceProperties_MinimumTlsVersion_STATUS_12, +} + +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") +) + +// Mapping from string to SBNamespaceProperties_PublicNetworkAccess_STATUS +var sBNamespaceProperties_PublicNetworkAccess_STATUS_Values = map[string]SBNamespaceProperties_PublicNetworkAccess_STATUS{ + "disabled": SBNamespaceProperties_PublicNetworkAccess_STATUS_Disabled, + "enabled": SBNamespaceProperties_PublicNetworkAccess_STATUS_Enabled, + "securedbyperimeter": SBNamespaceProperties_PublicNetworkAccess_STATUS_SecuredByPerimeter, +} + +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") +) + +// Mapping from string to SBSku_Name_STATUS +var sBSku_Name_STATUS_Values = map[string]SBSku_Name_STATUS{ + "basic": SBSku_Name_STATUS_Basic, + "premium": SBSku_Name_STATUS_Premium, + "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") +) + +// Mapping from string to SBSku_Tier_STATUS +var sBSku_Tier_STATUS_Values = map[string]SBSku_Tier_STATUS{ + "basic": SBSku_Tier_STATUS_Basic, + "premium": SBSku_Tier_STATUS_Premium, + "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") +) + +// Mapping from string to SystemData_CreatedByType_STATUS +var systemData_CreatedByType_STATUS_Values = map[string]SystemData_CreatedByType_STATUS{ + "application": SystemData_CreatedByType_STATUS_Application, + "key": SystemData_CreatedByType_STATUS_Key, + "managedidentity": SystemData_CreatedByType_STATUS_ManagedIdentity, + "user": SystemData_CreatedByType_STATUS_User, +} + +type SystemData_LastModifiedByType_STATUS string + +const ( + SystemData_LastModifiedByType_STATUS_Application = SystemData_LastModifiedByType_STATUS("Application") + SystemData_LastModifiedByType_STATUS_Key = SystemData_LastModifiedByType_STATUS("Key") + SystemData_LastModifiedByType_STATUS_ManagedIdentity = SystemData_LastModifiedByType_STATUS("ManagedIdentity") + SystemData_LastModifiedByType_STATUS_User = SystemData_LastModifiedByType_STATUS("User") +) + +// Mapping from string to SystemData_LastModifiedByType_STATUS +var systemData_LastModifiedByType_STATUS_Values = map[string]SystemData_LastModifiedByType_STATUS{ + "application": SystemData_LastModifiedByType_STATUS_Application, + "key": SystemData_LastModifiedByType_STATUS_Key, + "managedidentity": SystemData_LastModifiedByType_STATUS_ManagedIdentity, + "user": SystemData_LastModifiedByType_STATUS_User, +} + +// 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"` +} + +type Encryption_KeySource_STATUS string + +const Encryption_KeySource_STATUS_MicrosoftKeyVault = Encryption_KeySource_STATUS("Microsoft.KeyVault") + +// Mapping from string to Encryption_KeySource_STATUS +var encryption_KeySource_STATUS_Values = map[string]Encryption_KeySource_STATUS{ + "microsoft.keyvault": Encryption_KeySource_STATUS_MicrosoftKeyVault, +} + +// 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"` +} + +type UserAssignedIdentityProperties_STATUS struct { + // UserAssignedIdentity: ARM ID of user Identity selected for encryption + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespace_status_types_gen_test.go b/v2/api/servicebus/v1api20240101/arm/namespace_status_types_gen_test.go new file mode 100644 index 00000000000..7ec03e26f2a --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespace_status_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 arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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_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_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_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["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 is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespace_STATUS(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(Identity_STATUSGenerator()) + gens["Properties"] = gen.PtrOf(SBNamespaceProperties_STATUSGenerator()) + gens["Sku"] = gen.PtrOf(SBSku_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +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_SBNamespaceProperties_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 SBNamespaceProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBNamespaceProperties_STATUS, SBNamespaceProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBNamespaceProperties_STATUS runs a test to see if a specific instance of SBNamespaceProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSBNamespaceProperties_STATUS(subject SBNamespaceProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBNamespaceProperties_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 SBNamespaceProperties_STATUS instances for property testing - lazily instantiated by +// SBNamespaceProperties_STATUSGenerator() +var sbNamespaceProperties_STATUSGenerator gopter.Gen + +// SBNamespaceProperties_STATUSGenerator returns a generator of SBNamespaceProperties_STATUS instances for property testing. +// We first initialize sbNamespaceProperties_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 SBNamespaceProperties_STATUSGenerator() gopter.Gen { + if sbNamespaceProperties_STATUSGenerator != nil { + return sbNamespaceProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBNamespaceProperties_STATUS(generators) + sbNamespaceProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(SBNamespaceProperties_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBNamespaceProperties_STATUS(generators) + AddRelatedPropertyGeneratorsForSBNamespaceProperties_STATUS(generators) + sbNamespaceProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(SBNamespaceProperties_STATUS{}), generators) + + return sbNamespaceProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSBNamespaceProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBNamespaceProperties_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["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 is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBNamespaceProperties_STATUS(gens map[string]gopter.Gen) { + gens["Encryption"] = gen.PtrOf(Encryption_STATUSGenerator()) + gens["PrivateEndpointConnections"] = gen.SliceOf(PrivateEndpointConnection_STATUSGenerator()) +} + +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_WhenSerializedToJson_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_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()) +} + +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()) +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespaces_authorization_rule_spec_types_gen.go b/v2/api/servicebus/v1api20240101/arm/namespaces_authorization_rule_spec_types_gen.go new file mode 100644 index 00000000000..638f9c39db1 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_authorization_rule_spec_types_gen.go @@ -0,0 +1,51 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type NamespacesAuthorizationRule_Spec struct { + Name string `json:"name,omitempty"` + + // Properties: AuthorizationRule properties. + Properties *Namespaces_AuthorizationRule_Properties_Spec `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &NamespacesAuthorizationRule_Spec{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (rule NamespacesAuthorizationRule_Spec) GetAPIVersion() string { + return "2024-01-01" +} + +// GetName returns the Name of the resource +func (rule *NamespacesAuthorizationRule_Spec) GetName() string { + return rule.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/AuthorizationRules" +func (rule *NamespacesAuthorizationRule_Spec) GetType() string { + return "Microsoft.ServiceBus/namespaces/AuthorizationRules" +} + +type Namespaces_AuthorizationRule_Properties_Spec struct { + // Rights: The rights associated with the rule. + Rights []Namespaces_AuthorizationRule_Properties_Rights_Spec `json:"rights,omitempty"` +} + +// +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") +) + +// Mapping from string to Namespaces_AuthorizationRule_Properties_Rights_Spec +var namespaces_AuthorizationRule_Properties_Rights_Spec_Values = map[string]Namespaces_AuthorizationRule_Properties_Rights_Spec{ + "listen": Namespaces_AuthorizationRule_Properties_Rights_Spec_Listen, + "manage": Namespaces_AuthorizationRule_Properties_Rights_Spec_Manage, + "send": Namespaces_AuthorizationRule_Properties_Rights_Spec_Send, +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespaces_authorization_rule_spec_types_gen_test.go b/v2/api/servicebus/v1api20240101/arm/namespaces_authorization_rule_spec_types_gen_test.go new file mode 100644 index 00000000000..d855debb1bd --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_authorization_rule_spec_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 arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRule_Spec, NamespacesAuthorizationRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRule_Spec runs a test to see if a specific instance of NamespacesAuthorizationRule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRule_Spec(subject NamespacesAuthorizationRule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_Spec instances for property testing - lazily instantiated by +// NamespacesAuthorizationRule_SpecGenerator() +var namespacesAuthorizationRule_SpecGenerator gopter.Gen + +// NamespacesAuthorizationRule_SpecGenerator returns a generator of NamespacesAuthorizationRule_Spec instances for property testing. +// We first initialize namespacesAuthorizationRule_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 NamespacesAuthorizationRule_SpecGenerator() gopter.Gen { + if namespacesAuthorizationRule_SpecGenerator != nil { + return namespacesAuthorizationRule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_Spec(generators) + namespacesAuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_Spec(generators) + namespacesAuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule_Spec{}), generators) + + return namespacesAuthorizationRule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Namespaces_AuthorizationRule_Properties_SpecGenerator()) +} + +func Test_Namespaces_AuthorizationRule_Properties_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_Properties_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_Spec, Namespaces_AuthorizationRule_Properties_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_Spec runs a test to see if a specific instance of Namespaces_AuthorizationRule_Properties_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_Spec(subject Namespaces_AuthorizationRule_Properties_Spec) 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 + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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 instances for property testing - lazily instantiated by +// Namespaces_AuthorizationRule_Properties_SpecGenerator() +var namespaces_AuthorizationRule_Properties_SpecGenerator gopter.Gen + +// Namespaces_AuthorizationRule_Properties_SpecGenerator returns a generator of Namespaces_AuthorizationRule_Properties_Spec instances for property testing. +func Namespaces_AuthorizationRule_Properties_SpecGenerator() gopter.Gen { + if namespaces_AuthorizationRule_Properties_SpecGenerator != nil { + return namespaces_AuthorizationRule_Properties_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_Spec(generators) + namespaces_AuthorizationRule_Properties_SpecGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Properties_Spec{}), generators) + + return namespaces_AuthorizationRule_Properties_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_Spec(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/v1api20240101/arm/namespaces_authorization_rule_status_types_gen.go b/v2/api/servicebus/v1api20240101/arm/namespaces_authorization_rule_status_types_gen.go new file mode 100644 index 00000000000..086d10a108e --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_authorization_rule_status_types_gen.go @@ -0,0 +1,45 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +type NamespacesAuthorizationRule_STATUS 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 `json:"properties,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"` +} + +type Namespaces_AuthorizationRule_Properties_STATUS struct { + // Rights: The rights associated with the rule. + Rights []Namespaces_AuthorizationRule_Properties_Rights_STATUS `json:"rights,omitempty"` +} + +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") +) + +// Mapping from string to Namespaces_AuthorizationRule_Properties_Rights_STATUS +var namespaces_AuthorizationRule_Properties_Rights_STATUS_Values = map[string]Namespaces_AuthorizationRule_Properties_Rights_STATUS{ + "listen": Namespaces_AuthorizationRule_Properties_Rights_STATUS_Listen, + "manage": Namespaces_AuthorizationRule_Properties_Rights_STATUS_Manage, + "send": Namespaces_AuthorizationRule_Properties_Rights_STATUS_Send, +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespaces_authorization_rule_status_types_gen_test.go b/v2/api/servicebus/v1api20240101/arm/namespaces_authorization_rule_status_types_gen_test.go new file mode 100644 index 00000000000..fce6184870f --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_authorization_rule_status_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 arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRule_STATUS, NamespacesAuthorizationRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRule_STATUS runs a test to see if a specific instance of NamespacesAuthorizationRule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRule_STATUS(subject NamespacesAuthorizationRule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_STATUS instances for property testing - lazily instantiated by +// NamespacesAuthorizationRule_STATUSGenerator() +var namespacesAuthorizationRule_STATUSGenerator gopter.Gen + +// NamespacesAuthorizationRule_STATUSGenerator returns a generator of NamespacesAuthorizationRule_STATUS instances for property testing. +// We first initialize namespacesAuthorizationRule_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 NamespacesAuthorizationRule_STATUSGenerator() gopter.Gen { + if namespacesAuthorizationRule_STATUSGenerator != nil { + return namespacesAuthorizationRule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_STATUS(generators) + namespacesAuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_STATUS(generators) + namespacesAuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule_STATUS{}), generators) + + return namespacesAuthorizationRule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_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["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_STATUS(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Namespaces_AuthorizationRule_Properties_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_Namespaces_AuthorizationRule_Properties_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_Properties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_STATUS, Namespaces_AuthorizationRule_Properties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_STATUS runs a test to see if a specific instance of Namespaces_AuthorizationRule_Properties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespaces_AuthorizationRule_Properties_STATUS(subject Namespaces_AuthorizationRule_Properties_STATUS) 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 + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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 instances for property testing - lazily instantiated by +// Namespaces_AuthorizationRule_Properties_STATUSGenerator() +var namespaces_AuthorizationRule_Properties_STATUSGenerator gopter.Gen + +// Namespaces_AuthorizationRule_Properties_STATUSGenerator returns a generator of Namespaces_AuthorizationRule_Properties_STATUS instances for property testing. +func Namespaces_AuthorizationRule_Properties_STATUSGenerator() gopter.Gen { + if namespaces_AuthorizationRule_Properties_STATUSGenerator != nil { + return namespaces_AuthorizationRule_Properties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_STATUS(generators) + namespaces_AuthorizationRule_Properties_STATUSGenerator = gen.Struct(reflect.TypeOf(Namespaces_AuthorizationRule_Properties_STATUS{}), generators) + + return namespaces_AuthorizationRule_Properties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespaces_AuthorizationRule_Properties_STATUS(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/v1api20240101/arm/namespaces_queue_spec_types_gen.go b/v2/api/servicebus/v1api20240101/arm/namespaces_queue_spec_types_gen.go new file mode 100644 index 00000000000..25644005aac --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_queue_spec_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 arm + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type NamespacesQueue_Spec struct { + Name string `json:"name,omitempty"` + + // Properties: Queue Properties + Properties *SBQueueProperties `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &NamespacesQueue_Spec{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (queue NamespacesQueue_Spec) GetAPIVersion() string { + return "2024-01-01" +} + +// GetName returns the Name of the resource +func (queue *NamespacesQueue_Spec) GetName() string { + return queue.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/queues" +func (queue *NamespacesQueue_Spec) GetType() string { + return "Microsoft.ServiceBus/namespaces/queues" +} + +// The Queue Properties definition. +type SBQueueProperties 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/v1api20240101/arm/namespaces_queue_spec_types_gen_test.go b/v2/api/servicebus/v1api20240101/arm/namespaces_queue_spec_types_gen_test.go new file mode 100644 index 00000000000..5772baf50f6 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_queue_spec_types_gen_test.go @@ -0,0 +1,167 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesQueue_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 NamespacesQueue_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesQueue_Spec, NamespacesQueue_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesQueue_Spec runs a test to see if a specific instance of NamespacesQueue_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesQueue_Spec(subject NamespacesQueue_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesQueue_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 NamespacesQueue_Spec instances for property testing - lazily instantiated by +// NamespacesQueue_SpecGenerator() +var namespacesQueue_SpecGenerator gopter.Gen + +// NamespacesQueue_SpecGenerator returns a generator of NamespacesQueue_Spec instances for property testing. +// We first initialize namespacesQueue_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 NamespacesQueue_SpecGenerator() gopter.Gen { + if namespacesQueue_SpecGenerator != nil { + return namespacesQueue_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesQueue_Spec(generators) + namespacesQueue_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesQueue_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesQueue_Spec(generators) + namespacesQueue_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue_Spec{}), generators) + + return namespacesQueue_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesQueue_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesQueue_Spec(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespacesQueue_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesQueue_Spec(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBQueuePropertiesGenerator()) +} + +func Test_SBQueueProperties_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 via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBQueueProperties, SBQueuePropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBQueueProperties runs a test to see if a specific instance of SBQueueProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForSBQueueProperties(subject SBQueueProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBQueueProperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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 instances for property testing - lazily instantiated by SBQueuePropertiesGenerator() +var sbQueuePropertiesGenerator gopter.Gen + +// SBQueuePropertiesGenerator returns a generator of SBQueueProperties instances for property testing. +func SBQueuePropertiesGenerator() gopter.Gen { + if sbQueuePropertiesGenerator != nil { + return sbQueuePropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBQueueProperties(generators) + sbQueuePropertiesGenerator = gen.Struct(reflect.TypeOf(SBQueueProperties{}), generators) + + return sbQueuePropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForSBQueueProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBQueueProperties(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/v1api20240101/arm/namespaces_queue_status_types_gen.go b/v2/api/servicebus/v1api20240101/arm/namespaces_queue_status_types_gen.go new file mode 100644 index 00000000000..6cb662793bb --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_queue_status_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 arm + +type NamespacesQueue_STATUS 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 `json:"properties,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"` +} + +// The Queue Properties definition. +type SBQueueProperties_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"` + + // 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"` + + // 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"` +} + +// 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") +) + +// Mapping from string to EntityStatus_STATUS +var entityStatus_STATUS_Values = map[string]EntityStatus_STATUS{ + "active": EntityStatus_STATUS_Active, + "creating": EntityStatus_STATUS_Creating, + "deleting": EntityStatus_STATUS_Deleting, + "disabled": EntityStatus_STATUS_Disabled, + "receivedisabled": EntityStatus_STATUS_ReceiveDisabled, + "renaming": EntityStatus_STATUS_Renaming, + "restoring": EntityStatus_STATUS_Restoring, + "senddisabled": EntityStatus_STATUS_SendDisabled, + "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"` +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespaces_queue_status_types_gen_test.go b/v2/api/servicebus/v1api20240101/arm/namespaces_queue_status_types_gen_test.go new file mode 100644 index 00000000000..2c03c0d29bd --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_queue_status_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 arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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()) +} + +func Test_NamespacesQueue_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 NamespacesQueue_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesQueue_STATUS, NamespacesQueue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesQueue_STATUS runs a test to see if a specific instance of NamespacesQueue_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesQueue_STATUS(subject NamespacesQueue_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesQueue_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 NamespacesQueue_STATUS instances for property testing - lazily instantiated by +// NamespacesQueue_STATUSGenerator() +var namespacesQueue_STATUSGenerator gopter.Gen + +// NamespacesQueue_STATUSGenerator returns a generator of NamespacesQueue_STATUS instances for property testing. +// We first initialize namespacesQueue_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 NamespacesQueue_STATUSGenerator() gopter.Gen { + if namespacesQueue_STATUSGenerator != nil { + return namespacesQueue_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesQueue_STATUS(generators) + namespacesQueue_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesQueue_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesQueue_STATUS(generators) + namespacesQueue_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue_STATUS{}), generators) + + return namespacesQueue_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesQueue_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesQueue_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["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespacesQueue_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesQueue_STATUS(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBQueueProperties_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_SBQueueProperties_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 SBQueueProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBQueueProperties_STATUS, SBQueueProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBQueueProperties_STATUS runs a test to see if a specific instance of SBQueueProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSBQueueProperties_STATUS(subject SBQueueProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBQueueProperties_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 SBQueueProperties_STATUS instances for property testing - lazily instantiated by +// SBQueueProperties_STATUSGenerator() +var sbQueueProperties_STATUSGenerator gopter.Gen + +// SBQueueProperties_STATUSGenerator returns a generator of SBQueueProperties_STATUS instances for property testing. +// We first initialize sbQueueProperties_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 SBQueueProperties_STATUSGenerator() gopter.Gen { + if sbQueueProperties_STATUSGenerator != nil { + return sbQueueProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBQueueProperties_STATUS(generators) + sbQueueProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(SBQueueProperties_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBQueueProperties_STATUS(generators) + AddRelatedPropertyGeneratorsForSBQueueProperties_STATUS(generators) + sbQueueProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(SBQueueProperties_STATUS{}), generators) + + return sbQueueProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSBQueueProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBQueueProperties_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["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 is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBQueueProperties_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespaces_topic_spec_types_gen.go b/v2/api/servicebus/v1api20240101/arm/namespaces_topic_spec_types_gen.go new file mode 100644 index 00000000000..1854f045ef8 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_topic_spec_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 arm + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type NamespacesTopic_Spec struct { + Name string `json:"name,omitempty"` + + // Properties: Properties of topic resource. + Properties *SBTopicProperties `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &NamespacesTopic_Spec{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (topic NamespacesTopic_Spec) GetAPIVersion() string { + return "2024-01-01" +} + +// GetName returns the Name of the resource +func (topic *NamespacesTopic_Spec) GetName() string { + return topic.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics" +func (topic *NamespacesTopic_Spec) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics" +} + +// The Topic Properties definition. +type SBTopicProperties 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/v1api20240101/arm/namespaces_topic_spec_types_gen_test.go b/v2/api/servicebus/v1api20240101/arm/namespaces_topic_spec_types_gen_test.go new file mode 100644 index 00000000000..af6ca41e46e --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_topic_spec_types_gen_test.go @@ -0,0 +1,162 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesTopic_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 NamespacesTopic_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopic_Spec, NamespacesTopic_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopic_Spec runs a test to see if a specific instance of NamespacesTopic_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopic_Spec(subject NamespacesTopic_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopic_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 NamespacesTopic_Spec instances for property testing - lazily instantiated by +// NamespacesTopic_SpecGenerator() +var namespacesTopic_SpecGenerator gopter.Gen + +// NamespacesTopic_SpecGenerator returns a generator of NamespacesTopic_Spec instances for property testing. +// We first initialize namespacesTopic_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 NamespacesTopic_SpecGenerator() gopter.Gen { + if namespacesTopic_SpecGenerator != nil { + return namespacesTopic_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopic_Spec(generators) + namespacesTopic_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopic_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesTopic_Spec(generators) + namespacesTopic_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic_Spec{}), generators) + + return namespacesTopic_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopic_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopic_Spec(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespacesTopic_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopic_Spec(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBTopicPropertiesGenerator()) +} + +func Test_SBTopicProperties_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 via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBTopicProperties, SBTopicPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBTopicProperties runs a test to see if a specific instance of SBTopicProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForSBTopicProperties(subject SBTopicProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBTopicProperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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 instances for property testing - lazily instantiated by SBTopicPropertiesGenerator() +var sbTopicPropertiesGenerator gopter.Gen + +// SBTopicPropertiesGenerator returns a generator of SBTopicProperties instances for property testing. +func SBTopicPropertiesGenerator() gopter.Gen { + if sbTopicPropertiesGenerator != nil { + return sbTopicPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBTopicProperties(generators) + sbTopicPropertiesGenerator = gen.Struct(reflect.TypeOf(SBTopicProperties{}), generators) + + return sbTopicPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForSBTopicProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBTopicProperties(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/v1api20240101/arm/namespaces_topic_status_types_gen.go b/v2/api/servicebus/v1api20240101/arm/namespaces_topic_status_types_gen.go new file mode 100644 index 00000000000..a7d32f3685b --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_topic_status_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 arm + +type NamespacesTopic_STATUS 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 `json:"properties,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"` +} + +// The Topic Properties definition. +type SBTopicProperties_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"` + + // 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"` + + // 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/v1api20240101/arm/namespaces_topic_status_types_gen_test.go b/v2/api/servicebus/v1api20240101/arm/namespaces_topic_status_types_gen_test.go new file mode 100644 index 00000000000..774b6ada568 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_topic_status_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 arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesTopic_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 NamespacesTopic_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopic_STATUS, NamespacesTopic_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopic_STATUS runs a test to see if a specific instance of NamespacesTopic_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopic_STATUS(subject NamespacesTopic_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopic_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 NamespacesTopic_STATUS instances for property testing - lazily instantiated by +// NamespacesTopic_STATUSGenerator() +var namespacesTopic_STATUSGenerator gopter.Gen + +// NamespacesTopic_STATUSGenerator returns a generator of NamespacesTopic_STATUS instances for property testing. +// We first initialize namespacesTopic_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 NamespacesTopic_STATUSGenerator() gopter.Gen { + if namespacesTopic_STATUSGenerator != nil { + return namespacesTopic_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopic_STATUS(generators) + namespacesTopic_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopic_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesTopic_STATUS(generators) + namespacesTopic_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic_STATUS{}), generators) + + return namespacesTopic_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopic_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopic_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["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopic_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopic_STATUS(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBTopicProperties_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_SBTopicProperties_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 SBTopicProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBTopicProperties_STATUS, SBTopicProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBTopicProperties_STATUS runs a test to see if a specific instance of SBTopicProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSBTopicProperties_STATUS(subject SBTopicProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBTopicProperties_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 SBTopicProperties_STATUS instances for property testing - lazily instantiated by +// SBTopicProperties_STATUSGenerator() +var sbTopicProperties_STATUSGenerator gopter.Gen + +// SBTopicProperties_STATUSGenerator returns a generator of SBTopicProperties_STATUS instances for property testing. +// We first initialize sbTopicProperties_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 SBTopicProperties_STATUSGenerator() gopter.Gen { + if sbTopicProperties_STATUSGenerator != nil { + return sbTopicProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBTopicProperties_STATUS(generators) + sbTopicProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(SBTopicProperties_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBTopicProperties_STATUS(generators) + AddRelatedPropertyGeneratorsForSBTopicProperties_STATUS(generators) + sbTopicProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(SBTopicProperties_STATUS{}), generators) + + return sbTopicProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSBTopicProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBTopicProperties_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["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 is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBTopicProperties_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscription_spec_types_gen.go b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscription_spec_types_gen.go new file mode 100644 index 00000000000..07858930e96 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscription_spec_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 arm + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type NamespacesTopicsSubscription_Spec struct { + Name string `json:"name,omitempty"` + + // Properties: Properties of subscriptions resource. + Properties *SBSubscriptionProperties `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &NamespacesTopicsSubscription_Spec{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (subscription NamespacesTopicsSubscription_Spec) GetAPIVersion() string { + return "2024-01-01" +} + +// GetName returns the Name of the resource +func (subscription *NamespacesTopicsSubscription_Spec) GetName() string { + return subscription.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions" +func (subscription *NamespacesTopicsSubscription_Spec) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions" +} + +// Description of Subscription Resource. +type SBSubscriptionProperties 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 `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 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/v1api20240101/arm/namespaces_topics_subscription_spec_types_gen_test.go b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscription_spec_types_gen_test.go new file mode 100644 index 00000000000..d209e6ce898 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscription_spec_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 arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscription_Spec, NamespacesTopicsSubscription_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscription_Spec runs a test to see if a specific instance of NamespacesTopicsSubscription_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscription_Spec(subject NamespacesTopicsSubscription_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_Spec instances for property testing - lazily instantiated by +// NamespacesTopicsSubscription_SpecGenerator() +var namespacesTopicsSubscription_SpecGenerator gopter.Gen + +// NamespacesTopicsSubscription_SpecGenerator returns a generator of NamespacesTopicsSubscription_Spec instances for property testing. +// We first initialize namespacesTopicsSubscription_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 NamespacesTopicsSubscription_SpecGenerator() gopter.Gen { + if namespacesTopicsSubscription_SpecGenerator != nil { + return namespacesTopicsSubscription_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_Spec(generators) + namespacesTopicsSubscription_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_Spec(generators) + namespacesTopicsSubscription_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription_Spec{}), generators) + + return namespacesTopicsSubscription_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_Spec(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_Spec(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBSubscriptionPropertiesGenerator()) +} + +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_SBSubscriptionProperties_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 via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSubscriptionProperties, SBSubscriptionPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSubscriptionProperties runs a test to see if a specific instance of SBSubscriptionProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSubscriptionProperties(subject SBSubscriptionProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSubscriptionProperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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 instances for property testing - lazily instantiated by +// SBSubscriptionPropertiesGenerator() +var sbSubscriptionPropertiesGenerator gopter.Gen + +// SBSubscriptionPropertiesGenerator returns a generator of SBSubscriptionProperties instances for property testing. +// We first initialize sbSubscriptionPropertiesGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func SBSubscriptionPropertiesGenerator() gopter.Gen { + if sbSubscriptionPropertiesGenerator != nil { + return sbSubscriptionPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSubscriptionProperties(generators) + sbSubscriptionPropertiesGenerator = gen.Struct(reflect.TypeOf(SBSubscriptionProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSubscriptionProperties(generators) + AddRelatedPropertyGeneratorsForSBSubscriptionProperties(generators) + sbSubscriptionPropertiesGenerator = gen.Struct(reflect.TypeOf(SBSubscriptionProperties{}), generators) + + return sbSubscriptionPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForSBSubscriptionProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSubscriptionProperties(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 is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBSubscriptionProperties(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffinePropertiesGenerator()) +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscription_status_types_gen.go b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscription_status_types_gen.go new file mode 100644 index 00000000000..dbb0a156eea --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscription_status_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 arm + +type NamespacesTopicsSubscription_STATUS 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 `json:"properties,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"` +} + +// Description of Subscription Resource. +type SBSubscriptionProperties_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"` + + // 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"` + + // 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 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/v1api20240101/arm/namespaces_topics_subscription_status_types_gen_test.go b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscription_status_types_gen_test.go new file mode 100644 index 00000000000..ff71be19835 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscription_status_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 arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscription_STATUS, NamespacesTopicsSubscription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscription_STATUS runs a test to see if a specific instance of NamespacesTopicsSubscription_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscription_STATUS(subject NamespacesTopicsSubscription_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_STATUS instances for property testing - lazily instantiated by +// NamespacesTopicsSubscription_STATUSGenerator() +var namespacesTopicsSubscription_STATUSGenerator gopter.Gen + +// NamespacesTopicsSubscription_STATUSGenerator returns a generator of NamespacesTopicsSubscription_STATUS instances for property testing. +// We first initialize namespacesTopicsSubscription_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 NamespacesTopicsSubscription_STATUSGenerator() gopter.Gen { + if namespacesTopicsSubscription_STATUSGenerator != nil { + return namespacesTopicsSubscription_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_STATUS(generators) + namespacesTopicsSubscription_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_STATUS(generators) + namespacesTopicsSubscription_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription_STATUS{}), generators) + + return namespacesTopicsSubscription_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_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["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_STATUS(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(SBSubscriptionProperties_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +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()) +} + +func Test_SBSubscriptionProperties_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 SBSubscriptionProperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSBSubscriptionProperties_STATUS, SBSubscriptionProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSBSubscriptionProperties_STATUS runs a test to see if a specific instance of SBSubscriptionProperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSBSubscriptionProperties_STATUS(subject SBSubscriptionProperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SBSubscriptionProperties_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 SBSubscriptionProperties_STATUS instances for property testing - lazily instantiated by +// SBSubscriptionProperties_STATUSGenerator() +var sbSubscriptionProperties_STATUSGenerator gopter.Gen + +// SBSubscriptionProperties_STATUSGenerator returns a generator of SBSubscriptionProperties_STATUS instances for property testing. +// We first initialize sbSubscriptionProperties_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 SBSubscriptionProperties_STATUSGenerator() gopter.Gen { + if sbSubscriptionProperties_STATUSGenerator != nil { + return sbSubscriptionProperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSubscriptionProperties_STATUS(generators) + sbSubscriptionProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(SBSubscriptionProperties_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSBSubscriptionProperties_STATUS(generators) + AddRelatedPropertyGeneratorsForSBSubscriptionProperties_STATUS(generators) + sbSubscriptionProperties_STATUSGenerator = gen.Struct(reflect.TypeOf(SBSubscriptionProperties_STATUS{}), generators) + + return sbSubscriptionProperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSBSubscriptionProperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSBSubscriptionProperties_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["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 is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForSBSubscriptionProperties_STATUS(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffineProperties_STATUSGenerator()) + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscriptions_rule_spec_types_gen.go b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscriptions_rule_spec_types_gen.go new file mode 100644 index 00000000000..293191ff890 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscriptions_rule_spec_types_gen.go @@ -0,0 +1,121 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +import "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + +type NamespacesTopicsSubscriptionsRule_Spec struct { + Name string `json:"name,omitempty"` + + // Properties: Properties of Rule resource + Properties *Ruleproperties `json:"properties,omitempty"` +} + +var _ genruntime.ARMResourceSpec = &NamespacesTopicsSubscriptionsRule_Spec{} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (rule NamespacesTopicsSubscriptionsRule_Spec) GetAPIVersion() string { + return "2024-01-01" +} + +// GetName returns the Name of the resource +func (rule *NamespacesTopicsSubscriptionsRule_Spec) GetName() string { + return rule.Name +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +func (rule *NamespacesTopicsSubscriptionsRule_Spec) GetType() string { + return "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules" +} + +// Description of Rule Resource. +type Ruleproperties 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"` + + // CorrelationFilter: Properties of correlationFilter + CorrelationFilter *CorrelationFilter `json:"correlationFilter,omitempty"` + + // FilterType: Filter type that is evaluated against a BrokeredMessage. + FilterType *FilterType `json:"filterType,omitempty"` + + // SqlFilter: Properties of sqlFilter + SqlFilter *SqlFilter `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 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 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"` +} + +// Rule filter types +// +kubebuilder:validation:Enum={"CorrelationFilter","SqlFilter"} +type FilterType string + +const ( + FilterType_CorrelationFilter = FilterType("CorrelationFilter") + FilterType_SqlFilter = FilterType("SqlFilter") +) + +// Mapping from string to FilterType +var filterType_Values = map[string]FilterType{ + "correlationfilter": FilterType_CorrelationFilter, + "sqlfilter": FilterType_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"` +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscriptions_rule_spec_types_gen_test.go b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscriptions_rule_spec_types_gen_test.go new file mode 100644 index 00000000000..ee8cb4035cb --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscriptions_rule_spec_types_gen_test.go @@ -0,0 +1,364 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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_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_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_Spec, NamespacesTopicsSubscriptionsRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_Spec runs a test to see if a specific instance of NamespacesTopicsSubscriptionsRule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_Spec(subject NamespacesTopicsSubscriptionsRule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_Spec instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionsRule_SpecGenerator() +var namespacesTopicsSubscriptionsRule_SpecGenerator gopter.Gen + +// NamespacesTopicsSubscriptionsRule_SpecGenerator returns a generator of NamespacesTopicsSubscriptionsRule_Spec instances for property testing. +// We first initialize namespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_SpecGenerator() gopter.Gen { + if namespacesTopicsSubscriptionsRule_SpecGenerator != nil { + return namespacesTopicsSubscriptionsRule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(generators) + namespacesTopicsSubscriptionsRule_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(generators) + namespacesTopicsSubscriptionsRule_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule_Spec{}), generators) + + return namespacesTopicsSubscriptionsRule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(gens map[string]gopter.Gen) { + gens["Name"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(RulepropertiesGenerator()) +} + +func Test_Ruleproperties_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 via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRuleproperties, RulepropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRuleproperties runs a test to see if a specific instance of Ruleproperties round trips to JSON and back losslessly +func RunJSONSerializationTestForRuleproperties(subject Ruleproperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Ruleproperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(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 instances for property testing - lazily instantiated by RulepropertiesGenerator() +var rulepropertiesGenerator gopter.Gen + +// RulepropertiesGenerator returns a generator of Ruleproperties instances for property testing. +// We first initialize rulepropertiesGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func RulepropertiesGenerator() gopter.Gen { + if rulepropertiesGenerator != nil { + return rulepropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleproperties(generators) + rulepropertiesGenerator = gen.Struct(reflect.TypeOf(Ruleproperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleproperties(generators) + AddRelatedPropertyGeneratorsForRuleproperties(generators) + rulepropertiesGenerator = gen.Struct(reflect.TypeOf(Ruleproperties{}), generators) + + return rulepropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForRuleproperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRuleproperties(gens map[string]gopter.Gen) { + gens["FilterType"] = gen.PtrOf(gen.OneConstOf(FilterType_CorrelationFilter, FilterType_SqlFilter)) +} + +// AddRelatedPropertyGeneratorsForRuleproperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForRuleproperties(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(ActionGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilterGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilterGenerator()) +} + +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()) +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscriptions_rule_status_types_gen.go b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscriptions_rule_status_types_gen.go new file mode 100644 index 00000000000..1643cef7576 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscriptions_rule_status_types_gen.go @@ -0,0 +1,115 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +type NamespacesTopicsSubscriptionsRule_STATUS 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 `json:"properties,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"` +} + +// Description of Rule Resource. +type Ruleproperties_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"` + + // 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"` + + // SqlFilter: Properties of sqlFilter + SqlFilter *SqlFilter_STATUS `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 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 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"` +} + +// Rule filter types +type FilterType_STATUS string + +const ( + FilterType_STATUS_CorrelationFilter = FilterType_STATUS("CorrelationFilter") + FilterType_STATUS_SqlFilter = FilterType_STATUS("SqlFilter") +) + +// Mapping from string to FilterType_STATUS +var filterType_STATUS_Values = map[string]FilterType_STATUS{ + "correlationfilter": FilterType_STATUS_CorrelationFilter, + "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_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"` +} diff --git a/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscriptions_rule_status_types_gen_test.go b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscriptions_rule_status_types_gen_test.go new file mode 100644 index 00000000000..1dc1af5c6d8 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/namespaces_topics_subscriptions_rule_status_types_gen_test.go @@ -0,0 +1,370 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package arm + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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_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_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_STATUS, NamespacesTopicsSubscriptionsRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_STATUS runs a test to see if a specific instance of NamespacesTopicsSubscriptionsRule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_STATUS(subject NamespacesTopicsSubscriptionsRule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_STATUS instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionsRule_STATUSGenerator() +var namespacesTopicsSubscriptionsRule_STATUSGenerator gopter.Gen + +// NamespacesTopicsSubscriptionsRule_STATUSGenerator returns a generator of NamespacesTopicsSubscriptionsRule_STATUS instances for property testing. +// We first initialize namespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_STATUSGenerator() gopter.Gen { + if namespacesTopicsSubscriptionsRule_STATUSGenerator != nil { + return namespacesTopicsSubscriptionsRule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS(generators) + namespacesTopicsSubscriptionsRule_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS(generators) + namespacesTopicsSubscriptionsRule_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule_STATUS{}), generators) + + return namespacesTopicsSubscriptionsRule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_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["Type"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS(gens map[string]gopter.Gen) { + gens["Properties"] = gen.PtrOf(Ruleproperties_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_Ruleproperties_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 Ruleproperties_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForRuleproperties_STATUS, Ruleproperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForRuleproperties_STATUS runs a test to see if a specific instance of Ruleproperties_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForRuleproperties_STATUS(subject Ruleproperties_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Ruleproperties_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 Ruleproperties_STATUS instances for property testing - lazily instantiated by +// Ruleproperties_STATUSGenerator() +var ruleproperties_STATUSGenerator gopter.Gen + +// Ruleproperties_STATUSGenerator returns a generator of Ruleproperties_STATUS instances for property testing. +// We first initialize ruleproperties_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 Ruleproperties_STATUSGenerator() gopter.Gen { + if ruleproperties_STATUSGenerator != nil { + return ruleproperties_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleproperties_STATUS(generators) + ruleproperties_STATUSGenerator = gen.Struct(reflect.TypeOf(Ruleproperties_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForRuleproperties_STATUS(generators) + AddRelatedPropertyGeneratorsForRuleproperties_STATUS(generators) + ruleproperties_STATUSGenerator = gen.Struct(reflect.TypeOf(Ruleproperties_STATUS{}), generators) + + return ruleproperties_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForRuleproperties_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForRuleproperties_STATUS(gens map[string]gopter.Gen) { + gens["FilterType"] = gen.PtrOf(gen.OneConstOf(FilterType_STATUS_CorrelationFilter, FilterType_STATUS_SqlFilter)) +} + +// AddRelatedPropertyGeneratorsForRuleproperties_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForRuleproperties_STATUS(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(Action_STATUSGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilter_STATUSGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilter_STATUSGenerator()) +} + +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/v1api20240101/arm/structure.txt b/v2/api/servicebus/v1api20240101/arm/structure.txt new file mode 100644 index 00000000000..dcf1d4cdb34 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/arm/structure.txt @@ -0,0 +1,436 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/arm +--------------------------------------------------------------------------- +Namespace_STATUS: 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: 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_STATUS: 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 +NamespacesAuthorizationRule_Spec: Object (2 properties) +├── Name: string +└── Properties: *Object (1 property) + └── Rights: Enum (3 values)[] + ├── "Listen" + ├── "Manage" + └── "Send" +NamespacesQueue_STATUS: 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 +NamespacesQueue_Spec: 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 +NamespacesTopic_STATUS: 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 +NamespacesTopic_Spec: 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 +NamespacesTopicsSubscription_STATUS: 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 +NamespacesTopicsSubscription_Spec: 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 +NamespacesTopicsSubscriptionsRule_STATUS: 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 +NamespacesTopicsSubscriptionsRule_Spec: 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/v1api20240101/doc.go b/v2/api/servicebus/v1api20240101/doc.go new file mode 100644 index 00000000000..99947b7eb9b --- /dev/null +++ b/v2/api/servicebus/v1api20240101/doc.go @@ -0,0 +1,10 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package v1api20240101 contains API Schema definitions for the servicebus v1api20240101 API group +// +groupName=servicebus.azure.com +package v1api20240101 diff --git a/v2/api/servicebus/v1api20240101/groupversion_info_gen.go b/v2/api/servicebus/v1api20240101/groupversion_info_gen.go new file mode 100644 index 00000000000..f0461c678f8 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/groupversion_info_gen.go @@ -0,0 +1,32 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package v1api20240101 contains API Schema definitions for the servicebus v1api20240101 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 +// +versionName=v1api20240101 +package v1api20240101 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "servicebus.azure.com", Version: "v1api20240101"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme + + localSchemeBuilder = SchemeBuilder.SchemeBuilder +) diff --git a/v2/api/servicebus/v1api20240101/namespace_types_gen.go b/v2/api/servicebus/v1api20240101/namespace_types_gen.go new file mode 100644 index 00000000000..3d160b6d11b --- /dev/null +++ b/v2/api/servicebus/v1api20240101/namespace_types_gen.go @@ -0,0 +1,3946 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "fmt" + arm "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/arm" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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.(*storage.Namespace) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/Namespace but received %T instead", hub) + } + + return namespace.AssignProperties_From_Namespace(source) +} + +// ConvertTo populates the provided hub Namespace from our Namespace +func (namespace *Namespace) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*storage.Namespace) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/Namespace but received %T instead", hub) + } + + return namespace.AssignProperties_To_Namespace(destination) +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20240101-namespace,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespaces,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.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 _ configmaps.Exporter = &Namespace{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (namespace *Namespace) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if namespace.Spec.OperatorSpec == nil { + return nil + } + return namespace.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &Namespace{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (namespace *Namespace) SecretDestinationExpressions() []*core.DestinationExpression { + if namespace.Spec.OperatorSpec == nil { + return nil + } + return namespace.Spec.OperatorSpec.SecretExpressions +} + +var _ genruntime.ImportableResource = &Namespace{} + +// InitializeSpec initializes the spec for this resource from the given status +func (namespace *Namespace) InitializeSpec(status genruntime.ConvertibleStatus) error { + if s, ok := status.(*Namespace_STATUS); ok { + return namespace.Spec.Initialize_From_Namespace_STATUS(s) + } + + return fmt.Errorf("expected Status of type Namespace_STATUS but received %T instead", status) +} + +var _ genruntime.KubernetesResource = &Namespace{} + +// AzureName returns the Azure name of the resource +func (namespace *Namespace) AzureName() string { + return namespace.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (namespace Namespace) GetAPIVersion() string { + return "2024-01-01" +} + +// GetResourceScope returns the scope of the resource +func (namespace *Namespace) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (namespace *Namespace) GetSpec() genruntime.ConvertibleSpec { + return &namespace.Spec +} + +// GetStatus returns the status of this resource +func (namespace *Namespace) GetStatus() genruntime.ConvertibleStatus { + return &namespace.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (namespace *Namespace) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.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 { + if namespace.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) + return namespace.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (namespace *Namespace) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespace_STATUS); ok { + namespace.Status = *st + return nil + } + + // Convert status to required version + var st Namespace_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.Wrap(err, "failed to convert status") + } + + namespace.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-servicebus-azure-com-v1api20240101-namespace,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespaces,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.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.validateOwnerReference, namespace.validateSecretDestinations, namespace.validateConfigMapDestinations} +} + +// deleteValidations validates the deletion of the resource +func (namespace *Namespace) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (namespace *Namespace) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return namespace.validateResourceReferences() + }, + namespace.validateWriteOnceProperties, + func(old runtime.Object) (admission.Warnings, error) { + return namespace.validateOwnerReference() + }, + func(old runtime.Object) (admission.Warnings, error) { + return namespace.validateSecretDestinations() + }, + func(old runtime.Object) (admission.Warnings, error) { + return namespace.validateConfigMapDestinations() + }, + } +} + +// validateConfigMapDestinations validates there are no colliding genruntime.ConfigMapDestinations +func (namespace *Namespace) validateConfigMapDestinations() (admission.Warnings, error) { + if namespace.Spec.OperatorSpec == nil { + return nil, nil + } + return configmaps.ValidateDestinations(namespace, nil, namespace.Spec.OperatorSpec.ConfigMapExpressions) +} + +// validateOwnerReference validates the owner field +func (namespace *Namespace) validateOwnerReference() (admission.Warnings, error) { + return genruntime.ValidateOwner(namespace) +} + +// validateResourceReferences validates all resource references +func (namespace *Namespace) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&namespace.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (namespace *Namespace) validateSecretDestinations() (admission.Warnings, error) { + if namespace.Spec.OperatorSpec == nil { + return nil, nil + } + var toValidate []*genruntime.SecretDestination + if namespace.Spec.OperatorSpec.Secrets != 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 secrets.ValidateDestinations(namespace, toValidate, namespace.Spec.OperatorSpec.SecretExpressions) +} + +// 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 *storage.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 eris.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 eris.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 *storage.Namespace) error { + + // ObjectMeta + destination.ObjectMeta = *namespace.ObjectMeta.DeepCopy() + + // Spec + var spec storage.Namespace_Spec + err := namespace.Spec.AssignProperties_To_Namespace_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Namespace_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.Namespace_STATUS + err = namespace.Status.AssignProperties_To_Namespace_STATUS(&status) + if err != nil { + return eris.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/2024-01-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={"2024-01-01"} +type APIVersion string + +const APIVersion_Value = APIVersion("2024-01-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"` + + // 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 := &arm.Namespace_Spec{} + + // Set property "Identity": + if namespace.Identity != nil { + identity_ARM, err := (*namespace.Identity).ConvertToARM(resolved) + if err != nil { + return nil, err + } + identity := *identity_ARM.(*arm.Identity) + 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 = &arm.SBNamespaceProperties{} + } + 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.(*arm.Encryption) + result.Properties.Encryption = &encryption + } + if namespace.MinimumTlsVersion != nil { + var temp string + temp = string(*namespace.MinimumTlsVersion) + minimumTlsVersion := arm.SBNamespaceProperties_MinimumTlsVersion(temp) + result.Properties.MinimumTlsVersion = &minimumTlsVersion + } + if namespace.PremiumMessagingPartitions != nil { + premiumMessagingPartitions := *namespace.PremiumMessagingPartitions + result.Properties.PremiumMessagingPartitions = &premiumMessagingPartitions + } + if namespace.PublicNetworkAccess != nil { + var temp string + temp = string(*namespace.PublicNetworkAccess) + publicNetworkAccess := arm.SBNamespaceProperties_PublicNetworkAccess(temp) + 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.(*arm.SBSku) + 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 &arm.Namespace_Spec{} +} + +// 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.(arm.Namespace_Spec) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Namespace_Spec, 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 { + var temp string + temp = string(*typedInput.Properties.MinimumTlsVersion) + minimumTlsVersion := SBNamespaceProperties_MinimumTlsVersion(temp) + namespace.MinimumTlsVersion = &minimumTlsVersion + } + } + + // no assignment for property "OperatorSpec" + + // Set property "Owner": + namespace.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + ARMID: owner.ARMID, + } + + // 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 { + var temp string + temp = string(*typedInput.Properties.PublicNetworkAccess) + publicNetworkAccess := SBNamespaceProperties_PublicNetworkAccess(temp) + 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.(*storage.Namespace_Spec) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_Spec(src) + } + + // Convert to an intermediate form + src = &storage.Namespace_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = namespace.AssignProperties_From_Namespace_Spec(src) + if err != nil { + return eris.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.(*storage.Namespace_Spec) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_Spec(dst) + } + + // Convert to an intermediate form + dst = &storage.Namespace_Spec{} + err := namespace.AssignProperties_To_Namespace_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignProperties_From_Namespace_Spec populates our Namespace_Spec from the provided source Namespace_Spec +func (namespace *Namespace_Spec) AssignProperties_From_Namespace_Spec(source *storage.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 eris.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 eris.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 := *source.MinimumTlsVersion + minimumTlsVersionTemp := genruntime.ToEnum(minimumTlsVersion, sBNamespaceProperties_MinimumTlsVersion_Values) + namespace.MinimumTlsVersion = &minimumTlsVersionTemp + } else { + namespace.MinimumTlsVersion = nil + } + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespaceOperatorSpec + err := operatorSpec.AssignProperties_From_NamespaceOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.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 := *source.PublicNetworkAccess + publicNetworkAccessTemp := genruntime.ToEnum(publicNetworkAccess, sBNamespaceProperties_PublicNetworkAccess_Values) + namespace.PublicNetworkAccess = &publicNetworkAccessTemp + } else { + namespace.PublicNetworkAccess = nil + } + + // Sku + if source.Sku != nil { + var sku SBSku + err := sku.AssignProperties_From_SBSku(source.Sku) + if err != nil { + return eris.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 *storage.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 storage.Encryption + err := namespace.Encryption.AssignProperties_To_Encryption(&encryption) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Encryption() to populate field Encryption") + } + destination.Encryption = &encryption + } else { + destination.Encryption = nil + } + + // Identity + if namespace.Identity != nil { + var identity storage.Identity + err := namespace.Identity.AssignProperties_To_Identity(&identity) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Identity() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(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 storage.NamespaceOperatorSpec + err := namespace.OperatorSpec.AssignProperties_To_NamespaceOperatorSpec(&operatorSpec) + if err != nil { + return eris.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 storage.SBSku + err := namespace.Sku.AssignProperties_To_SBSku(&sku) + if err != nil { + return eris.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 eris.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 eris.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) + + // MinimumTlsVersion + if source.MinimumTlsVersion != nil { + minimumTlsVersion := genruntime.ToEnum(string(*source.MinimumTlsVersion), sBNamespaceProperties_MinimumTlsVersion_Values) + namespace.MinimumTlsVersion = &minimumTlsVersion + } else { + namespace.MinimumTlsVersion = nil + } + + // PremiumMessagingPartitions + namespace.PremiumMessagingPartitions = genruntime.ClonePointerToInt(source.PremiumMessagingPartitions) + + // PublicNetworkAccess + if source.PublicNetworkAccess != nil { + publicNetworkAccess := genruntime.ToEnum(string(*source.PublicNetworkAccess), sBNamespaceProperties_PublicNetworkAccess_Values) + namespace.PublicNetworkAccess = &publicNetworkAccess + } else { + namespace.PublicNetworkAccess = nil + } + + // Sku + if source.Sku != nil { + var sku SBSku + err := sku.Initialize_From_SBSku_STATUS(source.Sku) + if err != nil { + return eris.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"` + + // 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.(*storage.Namespace_STATUS) + if ok { + // Populate our instance from source + return namespace.AssignProperties_From_Namespace_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.Namespace_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = namespace.AssignProperties_From_Namespace_STATUS(src) + if err != nil { + return eris.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.(*storage.Namespace_STATUS) + if ok { + // Populate destination from our instance + return namespace.AssignProperties_To_Namespace_STATUS(dst) + } + + // Convert to an intermediate form + dst = &storage.Namespace_STATUS{} + err := namespace.AssignProperties_To_Namespace_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +var _ genruntime.FromARMConverter = &Namespace_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (namespace *Namespace_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Namespace_STATUS{} +} + +// 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.(arm.Namespace_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Namespace_STATUS, 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 { + var temp string + temp = string(*typedInput.Properties.MinimumTlsVersion) + minimumTlsVersion := SBNamespaceProperties_MinimumTlsVersion_STATUS(temp) + 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 { + var temp string + temp = string(*typedInput.Properties.PublicNetworkAccess) + publicNetworkAccess := SBNamespaceProperties_PublicNetworkAccess_STATUS(temp) + 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 *storage.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 eris.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 eris.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 := *source.MinimumTlsVersion + minimumTlsVersionTemp := genruntime.ToEnum(minimumTlsVersion, sBNamespaceProperties_MinimumTlsVersion_STATUS_Values) + namespace.MinimumTlsVersion = &minimumTlsVersionTemp + } 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 eris.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 := *source.PublicNetworkAccess + publicNetworkAccessTemp := genruntime.ToEnum(publicNetworkAccess, sBNamespaceProperties_PublicNetworkAccess_STATUS_Values) + namespace.PublicNetworkAccess = &publicNetworkAccessTemp + } 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 eris.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 eris.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 *storage.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 storage.Encryption_STATUS + err := namespace.Encryption.AssignProperties_To_Encryption_STATUS(&encryption) + if err != nil { + return eris.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 storage.Identity_STATUS + err := namespace.Identity.AssignProperties_To_Identity_STATUS(&identity) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_Identity_STATUS() to populate field Identity") + } + destination.Identity = &identity + } else { + destination.Identity = nil + } + + // Location + destination.Location = genruntime.ClonePointerToString(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([]storage.PrivateEndpointConnection_STATUS, len(namespace.PrivateEndpointConnections)) + for privateEndpointConnectionIndex, privateEndpointConnectionItem := range namespace.PrivateEndpointConnections { + // Shadow the loop variable to avoid aliasing + privateEndpointConnectionItem := privateEndpointConnectionItem + var privateEndpointConnection storage.PrivateEndpointConnection_STATUS + err := privateEndpointConnectionItem.AssignProperties_To_PrivateEndpointConnection_STATUS(&privateEndpointConnection) + if err != nil { + return eris.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 storage.SBSku_STATUS + err := namespace.Sku.AssignProperties_To_SBSku_STATUS(&sku) + if err != nil { + return eris.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 storage.SystemData_STATUS + err := namespace.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // Tags + destination.Tags = genruntime.CloneMapOfStringToString(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 := &arm.Encryption{} + + // Set property "KeySource": + if encryption.KeySource != nil { + var temp string + temp = string(*encryption.KeySource) + keySource := arm.Encryption_KeySource(temp) + 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.(*arm.KeyVaultProperties)) + } + + // 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 &arm.Encryption{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (encryption *Encryption) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Encryption) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Encryption, got %T", armInput) + } + + // Set property "KeySource": + if typedInput.KeySource != nil { + var temp string + temp = string(*typedInput.KeySource) + keySource := Encryption_KeySource(temp) + 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 *storage.Encryption) error { + + // KeySource + if source.KeySource != nil { + keySource := *source.KeySource + keySourceTemp := genruntime.ToEnum(keySource, encryption_KeySource_Values) + encryption.KeySource = &keySourceTemp + } 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 eris.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 *storage.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([]storage.KeyVaultProperties, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty storage.KeyVaultProperties + err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties(&keyVaultProperty) + if err != nil { + return eris.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 := genruntime.ToEnum(string(*source.KeySource), encryption_KeySource_Values) + 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 eris.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 &arm.Encryption_STATUS{} +} + +// 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.(arm.Encryption_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Encryption_STATUS, got %T", armInput) + } + + // Set property "KeySource": + if typedInput.KeySource != nil { + var temp string + temp = string(*typedInput.KeySource) + keySource := Encryption_KeySource_STATUS(temp) + 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 *storage.Encryption_STATUS) error { + + // KeySource + if source.KeySource != nil { + keySource := *source.KeySource + keySourceTemp := genruntime.ToEnum(keySource, encryption_KeySource_STATUS_Values) + encryption.KeySource = &keySourceTemp + } 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 eris.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 *storage.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([]storage.KeyVaultProperties_STATUS, len(encryption.KeyVaultProperties)) + for keyVaultPropertyIndex, keyVaultPropertyItem := range encryption.KeyVaultProperties { + // Shadow the loop variable to avoid aliasing + keyVaultPropertyItem := keyVaultPropertyItem + var keyVaultProperty storage.KeyVaultProperties_STATUS + err := keyVaultPropertyItem.AssignProperties_To_KeyVaultProperties_STATUS(&keyVaultProperty) + if err != nil { + return eris.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 := &arm.Identity{} + + // Set property "Type": + if identity.Type != nil { + var temp string + temp = string(*identity.Type) + typeVar := arm.Identity_Type(temp) + result.Type = &typeVar + } + + // Set property "UserAssignedIdentities": + result.UserAssignedIdentities = make(map[string]arm.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities)) + for _, ident := range identity.UserAssignedIdentities { + identARMID, err := resolved.ResolvedReferences.Lookup(ident.Reference) + if err != nil { + return nil, err + } + key := identARMID + result.UserAssignedIdentities[key] = arm.UserAssignedIdentityDetails{} + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (identity *Identity) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.Identity{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (identity *Identity) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Identity) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Identity, got %T", armInput) + } + + // Set property "Type": + if typedInput.Type != nil { + var temp string + temp = string(*typedInput.Type) + typeVar := Identity_Type(temp) + identity.Type = &typeVar + } + + // no assignment for property "UserAssignedIdentities" + + // No error + return nil +} + +// AssignProperties_From_Identity populates our Identity from the provided source Identity +func (identity *Identity) AssignProperties_From_Identity(source *storage.Identity) error { + + // Type + if source.Type != nil { + typeVar := *source.Type + typeTemp := genruntime.ToEnum(typeVar, identity_Type_Values) + identity.Type = &typeTemp + } else { + identity.Type = nil + } + + // UserAssignedIdentities + if source.UserAssignedIdentities != nil { + userAssignedIdentityList := make([]UserAssignedIdentityDetails, len(source.UserAssignedIdentities)) + for userAssignedIdentityIndex, userAssignedIdentityItem := range source.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityItem := userAssignedIdentityItem + var userAssignedIdentity UserAssignedIdentityDetails + err := userAssignedIdentity.AssignProperties_From_UserAssignedIdentityDetails(&userAssignedIdentityItem) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_UserAssignedIdentityDetails() to populate field UserAssignedIdentities") + } + userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity + } + identity.UserAssignedIdentities = userAssignedIdentityList + } else { + identity.UserAssignedIdentities = nil + } + + // No error + return nil +} + +// AssignProperties_To_Identity populates the provided destination Identity from our Identity +func (identity *Identity) AssignProperties_To_Identity(destination *storage.Identity) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Type + if identity.Type != nil { + typeVar := string(*identity.Type) + destination.Type = &typeVar + } else { + destination.Type = nil + } + + // UserAssignedIdentities + if identity.UserAssignedIdentities != nil { + userAssignedIdentityList := make([]storage.UserAssignedIdentityDetails, len(identity.UserAssignedIdentities)) + for userAssignedIdentityIndex, userAssignedIdentityItem := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityItem := userAssignedIdentityItem + var userAssignedIdentity storage.UserAssignedIdentityDetails + err := userAssignedIdentityItem.AssignProperties_To_UserAssignedIdentityDetails(&userAssignedIdentity) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_UserAssignedIdentityDetails() to populate field UserAssignedIdentities") + } + userAssignedIdentityList[userAssignedIdentityIndex] = userAssignedIdentity + } + destination.UserAssignedIdentities = userAssignedIdentityList + } else { + destination.UserAssignedIdentities = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// Initialize_From_Identity_STATUS populates our Identity from the provided source Identity_STATUS +func (identity *Identity) Initialize_From_Identity_STATUS(source *Identity_STATUS) error { + + // Type + if source.Type != nil { + typeVar := genruntime.ToEnum(string(*source.Type), identity_Type_Values) + identity.Type = &typeVar + } else { + identity.Type = nil + } + + // UserAssignedIdentities + if source.UserAssignedIdentities != nil { + userAssignedIdentityList := make([]UserAssignedIdentityDetails, 0, len(source.UserAssignedIdentities)) + for userAssignedIdentitiesKey := range source.UserAssignedIdentities { + userAssignedIdentitiesRef := genruntime.CreateResourceReferenceFromARMID(userAssignedIdentitiesKey) + userAssignedIdentityList = append(userAssignedIdentityList, UserAssignedIdentityDetails{Reference: userAssignedIdentitiesRef}) + } + identity.UserAssignedIdentities = userAssignedIdentityList + } else { + identity.UserAssignedIdentities = nil + } + + // No error + return nil +} + +// 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 &arm.Identity_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (identity *Identity_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Identity_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Identity_STATUS, got %T", armInput) + } + + // Set property "PrincipalId": + if typedInput.PrincipalId != nil { + principalId := *typedInput.PrincipalId + identity.PrincipalId = &principalId + } + + // Set property "TenantId": + if typedInput.TenantId != nil { + tenantId := *typedInput.TenantId + identity.TenantId = &tenantId + } + + // Set property "Type": + if typedInput.Type != nil { + var temp string + temp = string(*typedInput.Type) + typeVar := Identity_Type_STATUS(temp) + identity.Type = &typeVar + } + + // Set property "UserAssignedIdentities": + if typedInput.UserAssignedIdentities != nil { + identity.UserAssignedIdentities = make(map[string]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 *storage.Identity_STATUS) error { + + // PrincipalId + identity.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId) + + // TenantId + identity.TenantId = genruntime.ClonePointerToString(source.TenantId) + + // Type + if source.Type != nil { + typeVar := *source.Type + typeTemp := genruntime.ToEnum(typeVar, identity_Type_STATUS_Values) + identity.Type = &typeTemp + } else { + identity.Type = nil + } + + // UserAssignedIdentities + if source.UserAssignedIdentities != nil { + userAssignedIdentityMap := make(map[string]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 eris.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 *storage.Identity_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // PrincipalId + destination.PrincipalId = genruntime.ClonePointerToString(identity.PrincipalId) + + // TenantId + destination.TenantId = genruntime.ClonePointerToString(identity.TenantId) + + // Type + if identity.Type != nil { + typeVar := string(*identity.Type) + destination.Type = &typeVar + } else { + destination.Type = nil + } + + // UserAssignedIdentities + if identity.UserAssignedIdentities != nil { + userAssignedIdentityMap := make(map[string]storage.UserAssignedIdentity_STATUS, len(identity.UserAssignedIdentities)) + for userAssignedIdentityKey, userAssignedIdentityValue := range identity.UserAssignedIdentities { + // Shadow the loop variable to avoid aliasing + userAssignedIdentityValue := userAssignedIdentityValue + var userAssignedIdentity storage.UserAssignedIdentity_STATUS + err := userAssignedIdentityValue.AssignProperties_To_UserAssignedIdentity_STATUS(&userAssignedIdentity) + if err != nil { + return eris.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 { + // ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions). + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + + // SecretExpressions: configures where to place operator written dynamic secrets (created with CEL expressions). + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` + + // Secrets: configures where to place Azure generated secrets. + Secrets *NamespaceOperatorSecrets `json:"secrets,omitempty"` +} + +// AssignProperties_From_NamespaceOperatorSpec populates our NamespaceOperatorSpec from the provided source NamespaceOperatorSpec +func (operator *NamespaceOperatorSpec) AssignProperties_From_NamespaceOperatorSpec(source *storage.NamespaceOperatorSpec) error { + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // Secrets + if source.Secrets != nil { + var secret NamespaceOperatorSecrets + err := secret.AssignProperties_From_NamespaceOperatorSecrets(source.Secrets) + if err != nil { + return eris.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 *storage.NamespaceOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Secrets + if operator.Secrets != nil { + var secret storage.NamespaceOperatorSecrets + err := operator.Secrets.AssignProperties_To_NamespaceOperatorSecrets(&secret) + if err != nil { + return eris.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 &arm.PrivateEndpointConnection_STATUS{} +} + +// 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.(arm.PrivateEndpointConnection_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.PrivateEndpointConnection_STATUS, 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 *storage.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 *storage.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") +) + +// Mapping from string to SBNamespaceProperties_MinimumTlsVersion +var sBNamespaceProperties_MinimumTlsVersion_Values = map[string]SBNamespaceProperties_MinimumTlsVersion{ + "1.0": SBNamespaceProperties_MinimumTlsVersion_10, + "1.1": SBNamespaceProperties_MinimumTlsVersion_11, + "1.2": SBNamespaceProperties_MinimumTlsVersion_12, +} + +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") +) + +// Mapping from string to SBNamespaceProperties_MinimumTlsVersion_STATUS +var sBNamespaceProperties_MinimumTlsVersion_STATUS_Values = map[string]SBNamespaceProperties_MinimumTlsVersion_STATUS{ + "1.0": SBNamespaceProperties_MinimumTlsVersion_STATUS_10, + "1.1": SBNamespaceProperties_MinimumTlsVersion_STATUS_11, + "1.2": SBNamespaceProperties_MinimumTlsVersion_STATUS_12, +} + +// +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") +) + +// Mapping from string to SBNamespaceProperties_PublicNetworkAccess +var sBNamespaceProperties_PublicNetworkAccess_Values = map[string]SBNamespaceProperties_PublicNetworkAccess{ + "disabled": SBNamespaceProperties_PublicNetworkAccess_Disabled, + "enabled": SBNamespaceProperties_PublicNetworkAccess_Enabled, + "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") +) + +// Mapping from string to SBNamespaceProperties_PublicNetworkAccess_STATUS +var sBNamespaceProperties_PublicNetworkAccess_STATUS_Values = map[string]SBNamespaceProperties_PublicNetworkAccess_STATUS{ + "disabled": SBNamespaceProperties_PublicNetworkAccess_STATUS_Disabled, + "enabled": SBNamespaceProperties_PublicNetworkAccess_STATUS_Enabled, + "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 := &arm.SBSku{} + + // Set property "Capacity": + if sbSku.Capacity != nil { + capacity := *sbSku.Capacity + result.Capacity = &capacity + } + + // Set property "Name": + if sbSku.Name != nil { + var temp string + temp = string(*sbSku.Name) + name := arm.SBSku_Name(temp) + result.Name = &name + } + + // Set property "Tier": + if sbSku.Tier != nil { + var temp string + temp = string(*sbSku.Tier) + tier := arm.SBSku_Tier(temp) + result.Tier = &tier + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (sbSku *SBSku) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.SBSku{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (sbSku *SBSku) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.SBSku) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.SBSku, got %T", armInput) + } + + // Set property "Capacity": + if typedInput.Capacity != nil { + capacity := *typedInput.Capacity + sbSku.Capacity = &capacity + } + + // Set property "Name": + if typedInput.Name != nil { + var temp string + temp = string(*typedInput.Name) + name := SBSku_Name(temp) + sbSku.Name = &name + } + + // Set property "Tier": + if typedInput.Tier != nil { + var temp string + temp = string(*typedInput.Tier) + tier := SBSku_Tier(temp) + 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 *storage.SBSku) error { + + // Capacity + sbSku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + if source.Name != nil { + name := *source.Name + nameTemp := genruntime.ToEnum(name, sBSku_Name_Values) + sbSku.Name = &nameTemp + } else { + sbSku.Name = nil + } + + // Tier + if source.Tier != nil { + tier := *source.Tier + tierTemp := genruntime.ToEnum(tier, sBSku_Tier_Values) + sbSku.Tier = &tierTemp + } 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 *storage.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 := genruntime.ToEnum(string(*source.Name), sBSku_Name_Values) + sbSku.Name = &name + } else { + sbSku.Name = nil + } + + // Tier + if source.Tier != nil { + tier := genruntime.ToEnum(string(*source.Tier), sBSku_Tier_Values) + sbSku.Tier = &tier + } else { + sbSku.Tier = 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 &arm.SBSku_STATUS{} +} + +// 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.(arm.SBSku_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.SBSku_STATUS, got %T", armInput) + } + + // Set property "Capacity": + if typedInput.Capacity != nil { + capacity := *typedInput.Capacity + sbSku.Capacity = &capacity + } + + // Set property "Name": + if typedInput.Name != nil { + var temp string + temp = string(*typedInput.Name) + name := SBSku_Name_STATUS(temp) + sbSku.Name = &name + } + + // Set property "Tier": + if typedInput.Tier != nil { + var temp string + temp = string(*typedInput.Tier) + tier := SBSku_Tier_STATUS(temp) + 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 *storage.SBSku_STATUS) error { + + // Capacity + sbSku.Capacity = genruntime.ClonePointerToInt(source.Capacity) + + // Name + if source.Name != nil { + name := *source.Name + nameTemp := genruntime.ToEnum(name, sBSku_Name_STATUS_Values) + sbSku.Name = &nameTemp + } else { + sbSku.Name = nil + } + + // Tier + if source.Tier != nil { + tier := *source.Tier + tierTemp := genruntime.ToEnum(tier, sBSku_Tier_STATUS_Values) + sbSku.Tier = &tierTemp + } 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 *storage.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 &arm.SystemData_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (data *SystemData_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.SystemData_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.SystemData_STATUS, got %T", armInput) + } + + // Set property "CreatedAt": + if typedInput.CreatedAt != nil { + createdAt := *typedInput.CreatedAt + data.CreatedAt = &createdAt + } + + // Set property "CreatedBy": + if typedInput.CreatedBy != nil { + createdBy := *typedInput.CreatedBy + data.CreatedBy = &createdBy + } + + // Set property "CreatedByType": + if typedInput.CreatedByType != nil { + var temp string + temp = string(*typedInput.CreatedByType) + createdByType := SystemData_CreatedByType_STATUS(temp) + data.CreatedByType = &createdByType + } + + // Set property "LastModifiedAt": + if typedInput.LastModifiedAt != nil { + lastModifiedAt := *typedInput.LastModifiedAt + data.LastModifiedAt = &lastModifiedAt + } + + // Set property "LastModifiedBy": + if typedInput.LastModifiedBy != nil { + lastModifiedBy := *typedInput.LastModifiedBy + data.LastModifiedBy = &lastModifiedBy + } + + // Set property "LastModifiedByType": + if typedInput.LastModifiedByType != nil { + var temp string + temp = string(*typedInput.LastModifiedByType) + lastModifiedByType := SystemData_LastModifiedByType_STATUS(temp) + data.LastModifiedByType = &lastModifiedByType + } + + // No error + return nil +} + +// AssignProperties_From_SystemData_STATUS populates our SystemData_STATUS from the provided source SystemData_STATUS +func (data *SystemData_STATUS) AssignProperties_From_SystemData_STATUS(source *storage.SystemData_STATUS) error { + + // CreatedAt + data.CreatedAt = genruntime.ClonePointerToString(source.CreatedAt) + + // CreatedBy + data.CreatedBy = genruntime.ClonePointerToString(source.CreatedBy) + + // CreatedByType + if source.CreatedByType != nil { + createdByType := *source.CreatedByType + createdByTypeTemp := genruntime.ToEnum(createdByType, systemData_CreatedByType_STATUS_Values) + data.CreatedByType = &createdByTypeTemp + } else { + data.CreatedByType = nil + } + + // LastModifiedAt + data.LastModifiedAt = genruntime.ClonePointerToString(source.LastModifiedAt) + + // LastModifiedBy + data.LastModifiedBy = genruntime.ClonePointerToString(source.LastModifiedBy) + + // LastModifiedByType + if source.LastModifiedByType != nil { + lastModifiedByType := *source.LastModifiedByType + lastModifiedByTypeTemp := genruntime.ToEnum(lastModifiedByType, systemData_LastModifiedByType_STATUS_Values) + data.LastModifiedByType = &lastModifiedByTypeTemp + } else { + data.LastModifiedByType = nil + } + + // No error + return nil +} + +// AssignProperties_To_SystemData_STATUS populates the provided destination SystemData_STATUS from our SystemData_STATUS +func (data *SystemData_STATUS) AssignProperties_To_SystemData_STATUS(destination *storage.SystemData_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // CreatedAt + destination.CreatedAt = genruntime.ClonePointerToString(data.CreatedAt) + + // CreatedBy + destination.CreatedBy = genruntime.ClonePointerToString(data.CreatedBy) + + // CreatedByType + if data.CreatedByType != nil { + createdByType := string(*data.CreatedByType) + destination.CreatedByType = &createdByType + } else { + destination.CreatedByType = nil + } + + // LastModifiedAt + destination.LastModifiedAt = genruntime.ClonePointerToString(data.LastModifiedAt) + + // LastModifiedBy + destination.LastModifiedBy = genruntime.ClonePointerToString(data.LastModifiedBy) + + // LastModifiedByType + if data.LastModifiedByType != nil { + lastModifiedByType := string(*data.LastModifiedByType) + destination.LastModifiedByType = &lastModifiedByType + } else { + destination.LastModifiedByType = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// +kubebuilder:validation:Enum={"Microsoft.KeyVault"} +type Encryption_KeySource string + +const Encryption_KeySource_MicrosoftKeyVault = Encryption_KeySource("Microsoft.KeyVault") + +// Mapping from string to Encryption_KeySource +var encryption_KeySource_Values = map[string]Encryption_KeySource{ + "microsoft.keyvault": Encryption_KeySource_MicrosoftKeyVault, +} + +type Encryption_KeySource_STATUS string + +const Encryption_KeySource_STATUS_MicrosoftKeyVault = Encryption_KeySource_STATUS("Microsoft.KeyVault") + +// Mapping from string to Encryption_KeySource_STATUS +var encryption_KeySource_STATUS_Values = map[string]Encryption_KeySource_STATUS{ + "microsoft.keyvault": Encryption_KeySource_STATUS_MicrosoftKeyVault, +} + +// +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") +) + +// Mapping from string to Identity_Type +var identity_Type_Values = map[string]Identity_Type{ + "none": Identity_Type_None, + "systemassigned": Identity_Type_SystemAssigned, + "systemassigned, userassigned": Identity_Type_SystemAssignedUserAssigned, + "userassigned": Identity_Type_UserAssigned, +} + +type Identity_Type_STATUS string + +const ( + Identity_Type_STATUS_None = Identity_Type_STATUS("None") + Identity_Type_STATUS_SystemAssigned = Identity_Type_STATUS("SystemAssigned") + Identity_Type_STATUS_SystemAssignedUserAssigned = Identity_Type_STATUS("SystemAssigned, UserAssigned") + Identity_Type_STATUS_UserAssigned = Identity_Type_STATUS("UserAssigned") +) + +// Mapping from string to Identity_Type_STATUS +var identity_Type_STATUS_Values = map[string]Identity_Type_STATUS{ + "none": Identity_Type_STATUS_None, + "systemassigned": Identity_Type_STATUS_SystemAssigned, + "systemassigned, userassigned": Identity_Type_STATUS_SystemAssignedUserAssigned, + "userassigned": Identity_Type_STATUS_UserAssigned, +} + +// 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 := &arm.KeyVaultProperties{} + + // Set property "Identity": + if properties.Identity != nil { + identity_ARM, err := (*properties.Identity).ConvertToARM(resolved) + if err != nil { + return nil, err + } + identity := *identity_ARM.(*arm.UserAssignedIdentityProperties) + 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 &arm.KeyVaultProperties{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *KeyVaultProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.KeyVaultProperties) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.KeyVaultProperties, 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 *storage.KeyVaultProperties) error { + + // Identity + if source.Identity != nil { + var identity UserAssignedIdentityProperties + err := identity.AssignProperties_From_UserAssignedIdentityProperties(source.Identity) + if err != nil { + return eris.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 *storage.KeyVaultProperties) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Identity + if properties.Identity != nil { + var identity storage.UserAssignedIdentityProperties + err := properties.Identity.AssignProperties_To_UserAssignedIdentityProperties(&identity) + if err != nil { + return eris.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 eris.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 &arm.KeyVaultProperties_STATUS{} +} + +// 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.(arm.KeyVaultProperties_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.KeyVaultProperties_STATUS, 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 *storage.KeyVaultProperties_STATUS) error { + + // Identity + if source.Identity != nil { + var identity UserAssignedIdentityProperties_STATUS + err := identity.AssignProperties_From_UserAssignedIdentityProperties_STATUS(source.Identity) + if err != nil { + return eris.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 *storage.KeyVaultProperties_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Identity + if properties.Identity != nil { + var identity storage.UserAssignedIdentityProperties_STATUS + err := properties.Identity.AssignProperties_To_UserAssignedIdentityProperties_STATUS(&identity) + if err != nil { + return eris.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 *storage.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 *storage.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 +} + +// +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") +) + +// Mapping from string to SBSku_Name +var sBSku_Name_Values = map[string]SBSku_Name{ + "basic": SBSku_Name_Basic, + "premium": SBSku_Name_Premium, + "standard": SBSku_Name_Standard, +} + +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") +) + +// Mapping from string to SBSku_Name_STATUS +var sBSku_Name_STATUS_Values = map[string]SBSku_Name_STATUS{ + "basic": SBSku_Name_STATUS_Basic, + "premium": SBSku_Name_STATUS_Premium, + "standard": SBSku_Name_STATUS_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") +) + +// Mapping from string to SBSku_Tier +var sBSku_Tier_Values = map[string]SBSku_Tier{ + "basic": SBSku_Tier_Basic, + "premium": SBSku_Tier_Premium, + "standard": SBSku_Tier_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") +) + +// Mapping from string to SBSku_Tier_STATUS +var sBSku_Tier_STATUS_Values = map[string]SBSku_Tier_STATUS{ + "basic": SBSku_Tier_STATUS_Basic, + "premium": SBSku_Tier_STATUS_Premium, + "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") +) + +// Mapping from string to SystemData_CreatedByType_STATUS +var systemData_CreatedByType_STATUS_Values = map[string]SystemData_CreatedByType_STATUS{ + "application": SystemData_CreatedByType_STATUS_Application, + "key": SystemData_CreatedByType_STATUS_Key, + "managedidentity": SystemData_CreatedByType_STATUS_ManagedIdentity, + "user": SystemData_CreatedByType_STATUS_User, +} + +type SystemData_LastModifiedByType_STATUS string + +const ( + SystemData_LastModifiedByType_STATUS_Application = SystemData_LastModifiedByType_STATUS("Application") + SystemData_LastModifiedByType_STATUS_Key = SystemData_LastModifiedByType_STATUS("Key") + SystemData_LastModifiedByType_STATUS_ManagedIdentity = SystemData_LastModifiedByType_STATUS("ManagedIdentity") + SystemData_LastModifiedByType_STATUS_User = SystemData_LastModifiedByType_STATUS("User") +) + +// Mapping from string to SystemData_LastModifiedByType_STATUS +var systemData_LastModifiedByType_STATUS_Values = map[string]SystemData_LastModifiedByType_STATUS{ + "application": SystemData_LastModifiedByType_STATUS_Application, + "key": SystemData_LastModifiedByType_STATUS_Key, + "managedidentity": SystemData_LastModifiedByType_STATUS_ManagedIdentity, + "user": SystemData_LastModifiedByType_STATUS_User, +} + +// 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 &arm.UserAssignedIdentity_STATUS{} +} + +// 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.(arm.UserAssignedIdentity_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.UserAssignedIdentity_STATUS, 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 *storage.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 *storage.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 *storage.UserAssignedIdentityDetails) error { + + // Reference + details.Reference = source.Reference.Copy() + + // No error + return nil +} + +// AssignProperties_To_UserAssignedIdentityDetails populates the provided destination UserAssignedIdentityDetails from our UserAssignedIdentityDetails +func (details *UserAssignedIdentityDetails) AssignProperties_To_UserAssignedIdentityDetails(destination *storage.UserAssignedIdentityDetails) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Reference + destination.Reference = details.Reference.Copy() + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +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 := &arm.UserAssignedIdentityProperties{} + + // 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 &arm.UserAssignedIdentityProperties{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *UserAssignedIdentityProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + _, ok := armInput.(arm.UserAssignedIdentityProperties) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.UserAssignedIdentityProperties, 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 *storage.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 *storage.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 &arm.UserAssignedIdentityProperties_STATUS{} +} + +// 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.(arm.UserAssignedIdentityProperties_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.UserAssignedIdentityProperties_STATUS, 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 *storage.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 *storage.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/v1api20240101/namespace_types_gen_test.go b/v2/api/servicebus/v1api20240101/namespace_types_gen_test.go new file mode 100644 index 00000000000..28fc2730a84 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/namespace_types_gen_test.go @@ -0,0 +1,2174 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_Encryption_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Encryption to Encryption via AssignProperties_To_Encryption & AssignProperties_From_Encryption returns original", + prop.ForAll(RunPropertyAssignmentTestForEncryption, EncryptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForEncryption tests if a specific instance of Encryption can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForEncryption(subject Encryption) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.Encryption + err := copied.AssignProperties_To_Encryption(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Encryption + err = actual.AssignProperties_From_Encryption(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Encryption_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Encryption via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryption, EncryptionGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryption runs a test to see if a specific instance of Encryption round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryption(subject Encryption) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Encryption + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Encryption instances for property testing - lazily instantiated by EncryptionGenerator() +var encryptionGenerator gopter.Gen + +// EncryptionGenerator returns a generator of Encryption instances for property testing. +// We first initialize encryptionGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func EncryptionGenerator() gopter.Gen { + if encryptionGenerator != nil { + return encryptionGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption(generators) + encryptionGenerator = gen.Struct(reflect.TypeOf(Encryption{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption(generators) + AddRelatedPropertyGeneratorsForEncryption(generators) + encryptionGenerator = gen.Struct(reflect.TypeOf(Encryption{}), generators) + + return encryptionGenerator +} + +// AddIndependentPropertyGeneratorsForEncryption is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryption(gens map[string]gopter.Gen) { + gens["KeySource"] = gen.PtrOf(gen.OneConstOf(Encryption_KeySource_MicrosoftKeyVault)) + gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForEncryption is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryption(gens map[string]gopter.Gen) { + gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultPropertiesGenerator()) +} + +func Test_Encryption_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Encryption_STATUS to Encryption_STATUS via AssignProperties_To_Encryption_STATUS & AssignProperties_From_Encryption_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForEncryption_STATUS, Encryption_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForEncryption_STATUS tests if a specific instance of Encryption_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForEncryption_STATUS(subject Encryption_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.Encryption_STATUS + err := copied.AssignProperties_To_Encryption_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Encryption_STATUS + err = actual.AssignProperties_From_Encryption_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Encryption_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Encryption_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForEncryption_STATUS, Encryption_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForEncryption_STATUS runs a test to see if a specific instance of Encryption_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForEncryption_STATUS(subject Encryption_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Encryption_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Encryption_STATUS instances for property testing - lazily instantiated by Encryption_STATUSGenerator() +var encryption_STATUSGenerator gopter.Gen + +// Encryption_STATUSGenerator returns a generator of Encryption_STATUS instances for property testing. +// We first initialize encryption_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Encryption_STATUSGenerator() gopter.Gen { + if encryption_STATUSGenerator != nil { + return encryption_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption_STATUS(generators) + encryption_STATUSGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForEncryption_STATUS(generators) + AddRelatedPropertyGeneratorsForEncryption_STATUS(generators) + encryption_STATUSGenerator = gen.Struct(reflect.TypeOf(Encryption_STATUS{}), generators) + + return encryption_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForEncryption_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForEncryption_STATUS(gens map[string]gopter.Gen) { + gens["KeySource"] = gen.PtrOf(gen.OneConstOf(Encryption_KeySource_STATUS_MicrosoftKeyVault)) + gens["RequireInfrastructureEncryption"] = gen.PtrOf(gen.Bool()) +} + +// AddRelatedPropertyGeneratorsForEncryption_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForEncryption_STATUS(gens map[string]gopter.Gen) { + gens["KeyVaultProperties"] = gen.SliceOf(KeyVaultProperties_STATUSGenerator()) +} + +func Test_Identity_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Identity to Identity via AssignProperties_To_Identity & AssignProperties_From_Identity returns original", + prop.ForAll(RunPropertyAssignmentTestForIdentity, IdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForIdentity tests if a specific instance of Identity can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForIdentity(subject Identity) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.Identity + err := copied.AssignProperties_To_Identity(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Identity + err = actual.AssignProperties_From_Identity(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Identity_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity, IdentityGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity runs a test to see if a specific instance of Identity round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity(subject Identity) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Identity instances for property testing - lazily instantiated by IdentityGenerator() +var identityGenerator gopter.Gen + +// IdentityGenerator returns a generator of Identity instances for property testing. +// We first initialize identityGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func IdentityGenerator() gopter.Gen { + if identityGenerator != nil { + return identityGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(generators) + identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity(generators) + AddRelatedPropertyGeneratorsForIdentity(generators) + identityGenerator = gen.Struct(reflect.TypeOf(Identity{}), generators) + + return identityGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { + gens["Type"] = gen.PtrOf(gen.OneConstOf( + Identity_Type_None, + Identity_Type_SystemAssigned, + Identity_Type_SystemAssignedUserAssigned, + Identity_Type_UserAssigned)) +} + +// AddRelatedPropertyGeneratorsForIdentity is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForIdentity(gens map[string]gopter.Gen) { + gens["UserAssignedIdentities"] = gen.SliceOf(UserAssignedIdentityDetailsGenerator()) +} + +func Test_Identity_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Identity_STATUS to Identity_STATUS via AssignProperties_To_Identity_STATUS & AssignProperties_From_Identity_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForIdentity_STATUS, Identity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForIdentity_STATUS tests if a specific instance of Identity_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForIdentity_STATUS(subject Identity_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.Identity_STATUS + err := copied.AssignProperties_To_Identity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual Identity_STATUS + err = actual.AssignProperties_From_Identity_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Identity_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of Identity_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForIdentity_STATUS, Identity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForIdentity_STATUS runs a test to see if a specific instance of Identity_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForIdentity_STATUS(subject Identity_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual Identity_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of Identity_STATUS instances for property testing - lazily instantiated by Identity_STATUSGenerator() +var identity_STATUSGenerator gopter.Gen + +// Identity_STATUSGenerator returns a generator of Identity_STATUS instances for property testing. +// We first initialize identity_STATUSGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func Identity_STATUSGenerator() gopter.Gen { + if identity_STATUSGenerator != nil { + return identity_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) + identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForIdentity_STATUS(generators) + AddRelatedPropertyGeneratorsForIdentity_STATUS(generators) + identity_STATUSGenerator = gen.Struct(reflect.TypeOf(Identity_STATUS{}), generators) + + return identity_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForIdentity_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForIdentity_STATUS(gens map[string]gopter.Gen) { + gens["PrincipalId"] = gen.PtrOf(gen.AlphaString()) + gens["TenantId"] = gen.PtrOf(gen.AlphaString()) + gens["Type"] = gen.PtrOf(gen.OneConstOf( + Identity_Type_STATUS_None, + Identity_Type_STATUS_SystemAssigned, + Identity_Type_STATUS_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_KeyVaultProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from KeyVaultProperties to KeyVaultProperties via AssignProperties_To_KeyVaultProperties & AssignProperties_From_KeyVaultProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForKeyVaultProperties, KeyVaultPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForKeyVaultProperties tests if a specific instance of KeyVaultProperties can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForKeyVaultProperties(subject KeyVaultProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.KeyVaultProperties + err := copied.AssignProperties_To_KeyVaultProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual KeyVaultProperties + err = actual.AssignProperties_From_KeyVaultProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_KeyVaultProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of KeyVaultProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForKeyVaultProperties, KeyVaultPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForKeyVaultProperties runs a test to see if a specific instance of KeyVaultProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForKeyVaultProperties(subject KeyVaultProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual KeyVaultProperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of KeyVaultProperties instances for property testing - lazily instantiated by KeyVaultPropertiesGenerator() +var keyVaultPropertiesGenerator gopter.Gen + +// KeyVaultPropertiesGenerator returns a generator of KeyVaultProperties instances for property testing. +// We first initialize keyVaultPropertiesGenerator with a simplified generator based on the +// fields with primitive types then replacing it with a more complex one that also handles complex fields +// to ensure any cycles in the object graph properly terminate. +func KeyVaultPropertiesGenerator() gopter.Gen { + if keyVaultPropertiesGenerator != nil { + return keyVaultPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties(generators) + keyVaultPropertiesGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForKeyVaultProperties(generators) + AddRelatedPropertyGeneratorsForKeyVaultProperties(generators) + keyVaultPropertiesGenerator = gen.Struct(reflect.TypeOf(KeyVaultProperties{}), generators) + + return keyVaultPropertiesGenerator +} + +// AddIndependentPropertyGeneratorsForKeyVaultProperties is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForKeyVaultProperties(gens map[string]gopter.Gen) { + gens["KeyName"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVaultUri"] = gen.PtrOf(gen.AlphaString()) + gens["KeyVersion"] = gen.PtrOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForKeyVaultProperties is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForKeyVaultProperties(gens map[string]gopter.Gen) { + gens["Identity"] = gen.PtrOf(UserAssignedIdentityPropertiesGenerator()) +} + +func Test_KeyVaultProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from KeyVaultProperties_STATUS to KeyVaultProperties_STATUS via AssignProperties_To_KeyVaultProperties_STATUS & AssignProperties_From_KeyVaultProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForKeyVaultProperties_STATUS, KeyVaultProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForKeyVaultProperties_STATUS tests if a specific instance of KeyVaultProperties_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForKeyVaultProperties_STATUS(subject KeyVaultProperties_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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_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 storage.Namespace + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual Namespace + err = actual.ConvertFrom(&hub) + if err != nil { + return err.Error() + } + + // Compare actual with what we started with + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_Namespace_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace to Namespace via AssignProperties_To_Namespace & AssignProperties_From_Namespace returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespace, NamespaceGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespace tests if a specific instance of Namespace can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespace(subject Namespace) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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_NamespaceOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespaceOperatorSecrets to NamespaceOperatorSecrets via AssignProperties_To_NamespaceOperatorSecrets & AssignProperties_From_NamespaceOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSecrets, NamespaceOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaceOperatorSecrets tests if a specific instance of NamespaceOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaceOperatorSecrets(subject NamespaceOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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_NamespaceOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespaceOperatorSpec to NamespaceOperatorSpec via AssignProperties_To_NamespaceOperatorSpec & AssignProperties_From_NamespaceOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespaceOperatorSpec, NamespaceOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespaceOperatorSpec tests if a specific instance of NamespaceOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespaceOperatorSpec(subject NamespaceOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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_Namespace_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace_STATUS to Namespace_STATUS via AssignProperties_To_Namespace_STATUS & AssignProperties_From_Namespace_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespace_STATUS, Namespace_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespace_STATUS tests if a specific instance of Namespace_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespace_STATUS(subject Namespace_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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_Namespace_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from Namespace_Spec to Namespace_Spec via AssignProperties_To_Namespace_Spec & AssignProperties_From_Namespace_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespace_Spec, Namespace_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespace_Spec tests if a specific instance of Namespace_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespace_Spec(subject Namespace_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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_PrivateEndpointConnection_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from PrivateEndpointConnection_STATUS to PrivateEndpointConnection_STATUS via AssignProperties_To_PrivateEndpointConnection_STATUS & AssignProperties_From_PrivateEndpointConnection_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS, PrivateEndpointConnection_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS tests if a specific instance of PrivateEndpointConnection_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForPrivateEndpointConnection_STATUS(subject PrivateEndpointConnection_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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 storage 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 storage.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 storage 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 storage.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 storage and back losslessly +func RunPropertyAssignmentTestForSystemData_STATUS(subject SystemData_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.SystemData_STATUS + err := copied.AssignProperties_To_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual SystemData_STATUS + err = actual.AssignProperties_From_SystemData_STATUS(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_SystemData_STATUS_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 80 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of SystemData_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForSystemData_STATUS, SystemData_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForSystemData_STATUS runs a test to see if a specific instance of SystemData_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForSystemData_STATUS(subject SystemData_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual SystemData_STATUS + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of SystemData_STATUS instances for property testing - lazily instantiated by SystemData_STATUSGenerator() +var systemData_STATUSGenerator gopter.Gen + +// SystemData_STATUSGenerator returns a generator of SystemData_STATUS instances for property testing. +func SystemData_STATUSGenerator() gopter.Gen { + if systemData_STATUSGenerator != nil { + return systemData_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForSystemData_STATUS(generators) + systemData_STATUSGenerator = gen.Struct(reflect.TypeOf(SystemData_STATUS{}), generators) + + return systemData_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForSystemData_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForSystemData_STATUS(gens map[string]gopter.Gen) { + gens["CreatedAt"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedBy"] = gen.PtrOf(gen.AlphaString()) + gens["CreatedByType"] = gen.PtrOf(gen.OneConstOf( + SystemData_CreatedByType_STATUS_Application, + SystemData_CreatedByType_STATUS_Key, + SystemData_CreatedByType_STATUS_ManagedIdentity, + SystemData_CreatedByType_STATUS_User)) + gens["LastModifiedAt"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedBy"] = gen.PtrOf(gen.AlphaString()) + gens["LastModifiedByType"] = gen.PtrOf(gen.OneConstOf( + SystemData_LastModifiedByType_STATUS_Application, + SystemData_LastModifiedByType_STATUS_Key, + SystemData_LastModifiedByType_STATUS_ManagedIdentity, + SystemData_LastModifiedByType_STATUS_User)) +} + +func Test_UserAssignedIdentityDetails_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentityDetails to UserAssignedIdentityDetails via AssignProperties_To_UserAssignedIdentityDetails & AssignProperties_From_UserAssignedIdentityDetails returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityDetails tests if a specific instance of UserAssignedIdentityDetails can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.UserAssignedIdentityDetails + err := copied.AssignProperties_To_UserAssignedIdentityDetails(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAssignedIdentityDetails + err = actual.AssignProperties_From_UserAssignedIdentityDetails(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_UserAssignedIdentityDetails_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityDetails via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityDetails, UserAssignedIdentityDetailsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityDetails runs a test to see if a specific instance of UserAssignedIdentityDetails round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityDetails(subject UserAssignedIdentityDetails) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityDetails + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserAssignedIdentityDetails instances for property testing - lazily instantiated by +// UserAssignedIdentityDetailsGenerator() +var userAssignedIdentityDetailsGenerator gopter.Gen + +// UserAssignedIdentityDetailsGenerator returns a generator of UserAssignedIdentityDetails instances for property testing. +func UserAssignedIdentityDetailsGenerator() gopter.Gen { + if userAssignedIdentityDetailsGenerator != nil { + return userAssignedIdentityDetailsGenerator + } + + generators := make(map[string]gopter.Gen) + userAssignedIdentityDetailsGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityDetails{}), generators) + + return userAssignedIdentityDetailsGenerator +} + +func Test_UserAssignedIdentityProperties_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentityProperties to UserAssignedIdentityProperties via AssignProperties_To_UserAssignedIdentityProperties & AssignProperties_From_UserAssignedIdentityProperties returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityProperties, UserAssignedIdentityPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityProperties tests if a specific instance of UserAssignedIdentityProperties can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityProperties(subject UserAssignedIdentityProperties) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.UserAssignedIdentityProperties + err := copied.AssignProperties_To_UserAssignedIdentityProperties(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual UserAssignedIdentityProperties + err = actual.AssignProperties_From_UserAssignedIdentityProperties(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_UserAssignedIdentityProperties_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 100 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of UserAssignedIdentityProperties via JSON returns original", + prop.ForAll(RunJSONSerializationTestForUserAssignedIdentityProperties, UserAssignedIdentityPropertiesGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForUserAssignedIdentityProperties runs a test to see if a specific instance of UserAssignedIdentityProperties round trips to JSON and back losslessly +func RunJSONSerializationTestForUserAssignedIdentityProperties(subject UserAssignedIdentityProperties) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual UserAssignedIdentityProperties + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of UserAssignedIdentityProperties instances for property testing - lazily instantiated by +// UserAssignedIdentityPropertiesGenerator() +var userAssignedIdentityPropertiesGenerator gopter.Gen + +// UserAssignedIdentityPropertiesGenerator returns a generator of UserAssignedIdentityProperties instances for property testing. +func UserAssignedIdentityPropertiesGenerator() gopter.Gen { + if userAssignedIdentityPropertiesGenerator != nil { + return userAssignedIdentityPropertiesGenerator + } + + generators := make(map[string]gopter.Gen) + userAssignedIdentityPropertiesGenerator = gen.Struct(reflect.TypeOf(UserAssignedIdentityProperties{}), generators) + + return userAssignedIdentityPropertiesGenerator +} + +func Test_UserAssignedIdentityProperties_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentityProperties_STATUS to UserAssignedIdentityProperties_STATUS via AssignProperties_To_UserAssignedIdentityProperties_STATUS & AssignProperties_From_UserAssignedIdentityProperties_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS, UserAssignedIdentityProperties_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS tests if a specific instance of UserAssignedIdentityProperties_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentityProperties_STATUS(subject UserAssignedIdentityProperties_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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()) +} + +func Test_UserAssignedIdentity_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from UserAssignedIdentity_STATUS to UserAssignedIdentity_STATUS via AssignProperties_To_UserAssignedIdentity_STATUS & AssignProperties_From_UserAssignedIdentity_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForUserAssignedIdentity_STATUS, UserAssignedIdentity_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForUserAssignedIdentity_STATUS tests if a specific instance of UserAssignedIdentity_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForUserAssignedIdentity_STATUS(subject UserAssignedIdentity_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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()) +} diff --git a/v2/api/servicebus/v1api20240101/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20240101/namespaces_authorization_rule_types_gen.go new file mode 100644 index 00000000000..cc5920bac3f --- /dev/null +++ b/v2/api/servicebus/v1api20240101/namespaces_authorization_rule_types_gen.go @@ -0,0 +1,1159 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "fmt" + arm "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/arm" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 NamespacesAuthorizationRule_Spec `json:"spec,omitempty"` + Status NamespacesAuthorizationRule_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.(*storage.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/NamespacesAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_From_NamespacesAuthorizationRule(source) +} + +// ConvertTo populates the provided hub NamespacesAuthorizationRule from our NamespacesAuthorizationRule +func (rule *NamespacesAuthorizationRule) ConvertTo(hub conversion.Hub) error { + destination, ok := hub.(*storage.NamespacesAuthorizationRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/NamespacesAuthorizationRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesAuthorizationRule(destination) +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20240101-namespacesauthorizationrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesauthorizationrules,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.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 _ configmaps.Exporter = &NamespacesAuthorizationRule{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (rule *NamespacesAuthorizationRule) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if rule.Spec.OperatorSpec == nil { + return nil + } + return rule.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &NamespacesAuthorizationRule{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (rule *NamespacesAuthorizationRule) SecretDestinationExpressions() []*core.DestinationExpression { + if rule.Spec.OperatorSpec == nil { + return nil + } + return rule.Spec.OperatorSpec.SecretExpressions +} + +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.(*NamespacesAuthorizationRule_STATUS); ok { + return rule.Spec.Initialize_From_NamespacesAuthorizationRule_STATUS(s) + } + + return fmt.Errorf("expected Status of type NamespacesAuthorizationRule_STATUS but received %T instead", status) +} + +var _ genruntime.KubernetesResource = &NamespacesAuthorizationRule{} + +// AzureName returns the Azure name of the resource +func (rule *NamespacesAuthorizationRule) AzureName() string { + return rule.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (rule NamespacesAuthorizationRule) GetAPIVersion() string { + return "2024-01-01" +} + +// GetResourceScope returns the scope of the resource +func (rule *NamespacesAuthorizationRule) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (rule *NamespacesAuthorizationRule) GetSpec() genruntime.ConvertibleSpec { + return &rule.Spec +} + +// GetStatus returns the status of this resource +func (rule *NamespacesAuthorizationRule) GetStatus() genruntime.ConvertibleStatus { + return &rule.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (rule *NamespacesAuthorizationRule) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.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 &NamespacesAuthorizationRule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return rule.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (rule *NamespacesAuthorizationRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*NamespacesAuthorizationRule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st NamespacesAuthorizationRule_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.Wrap(err, "failed to convert status") + } + + rule.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-servicebus-azure-com-v1api20240101-namespacesauthorizationrule,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesauthorizationrules,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.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.validateOwnerReference, rule.validateSecretDestinations, rule.validateConfigMapDestinations} +} + +// deleteValidations validates the deletion of the resource +func (rule *NamespacesAuthorizationRule) deleteValidations() []func() (admission.Warnings, error) { + return nil +} + +// updateValidations validates the update of the resource +func (rule *NamespacesAuthorizationRule) updateValidations() []func(old runtime.Object) (admission.Warnings, error) { + return []func(old runtime.Object) (admission.Warnings, error){ + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateResourceReferences() + }, + rule.validateWriteOnceProperties, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateOwnerReference() + }, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateSecretDestinations() + }, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateConfigMapDestinations() + }, + } +} + +// validateConfigMapDestinations validates there are no colliding genruntime.ConfigMapDestinations +func (rule *NamespacesAuthorizationRule) validateConfigMapDestinations() (admission.Warnings, error) { + if rule.Spec.OperatorSpec == nil { + return nil, nil + } + return configmaps.ValidateDestinations(rule, nil, rule.Spec.OperatorSpec.ConfigMapExpressions) +} + +// validateOwnerReference validates the owner field +func (rule *NamespacesAuthorizationRule) validateOwnerReference() (admission.Warnings, error) { + return genruntime.ValidateOwner(rule) +} + +// validateResourceReferences validates all resource references +func (rule *NamespacesAuthorizationRule) validateResourceReferences() (admission.Warnings, error) { + refs, err := reflecthelpers.FindResourceReferences(&rule.Spec) + if err != nil { + return nil, err + } + return genruntime.ValidateResourceReferences(refs) +} + +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (rule *NamespacesAuthorizationRule) validateSecretDestinations() (admission.Warnings, error) { + if rule.Spec.OperatorSpec == nil { + return nil, nil + } + var toValidate []*genruntime.SecretDestination + if rule.Spec.OperatorSpec.Secrets != 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 secrets.ValidateDestinations(rule, toValidate, rule.Spec.OperatorSpec.SecretExpressions) +} + +// 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 *storage.NamespacesAuthorizationRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec NamespacesAuthorizationRule_Spec + err := spec.AssignProperties_From_NamespacesAuthorizationRule_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status NamespacesAuthorizationRule_STATUS + err = status.AssignProperties_From_NamespacesAuthorizationRule_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRule_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 *storage.NamespacesAuthorizationRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec storage.NamespacesAuthorizationRule_Spec + err := rule.Spec.AssignProperties_To_NamespacesAuthorizationRule_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.NamespacesAuthorizationRule_STATUS + err = rule.Status.AssignProperties_To_NamespacesAuthorizationRule_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRule_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/2024-01-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 NamespacesAuthorizationRule_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 = &NamespacesAuthorizationRule_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (rule *NamespacesAuthorizationRule_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if rule == nil { + return nil, nil + } + result := &arm.NamespacesAuthorizationRule_Spec{} + + // Set property "Name": + result.Name = resolved.Name + + // Set property "Properties": + if rule.Rights != nil { + result.Properties = &arm.Namespaces_AuthorizationRule_Properties_Spec{} + } + for _, item := range rule.Rights { + var temp string + temp = string(item) + result.Properties.Rights = append(result.Properties.Rights, arm.Namespaces_AuthorizationRule_Properties_Rights_Spec(temp)) + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *NamespacesAuthorizationRule_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.NamespacesAuthorizationRule_Spec{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *NamespacesAuthorizationRule_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.NamespacesAuthorizationRule_Spec) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.NamespacesAuthorizationRule_Spec, got %T", armInput) + } + + // Set property "AzureName": + rule.SetAzureName(genruntime.ExtractKubernetesResourceNameFromARMName(typedInput.Name)) + + // no assignment for property "OperatorSpec" + + // Set property "Owner": + rule.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + ARMID: owner.ARMID, + } + + // Set property "Rights": + // copying flattened property: + if typedInput.Properties != nil { + for _, item := range typedInput.Properties.Rights { + var temp string + temp = string(item) + rule.Rights = append(rule.Rights, Namespaces_AuthorizationRule_Properties_Rights_Spec(temp)) + } + } + + // No error + return nil +} + +var _ genruntime.ConvertibleSpec = &NamespacesAuthorizationRule_Spec{} + +// ConvertSpecFrom populates our NamespacesAuthorizationRule_Spec from the provided source +func (rule *NamespacesAuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*storage.NamespacesAuthorizationRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_NamespacesAuthorizationRule_Spec(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesAuthorizationRule_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_NamespacesAuthorizationRule_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our NamespacesAuthorizationRule_Spec +func (rule *NamespacesAuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*storage.NamespacesAuthorizationRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_NamespacesAuthorizationRule_Spec(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesAuthorizationRule_Spec{} + err := rule.AssignProperties_To_NamespacesAuthorizationRule_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesAuthorizationRule_Spec populates our NamespacesAuthorizationRule_Spec from the provided source NamespacesAuthorizationRule_Spec +func (rule *NamespacesAuthorizationRule_Spec) AssignProperties_From_NamespacesAuthorizationRule_Spec(source *storage.NamespacesAuthorizationRule_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 eris.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] = genruntime.ToEnum(rightItem, namespaces_AuthorizationRule_Properties_Rights_Spec_Values) + } + rule.Rights = rightList + } else { + rule.Rights = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesAuthorizationRule_Spec populates the provided destination NamespacesAuthorizationRule_Spec from our NamespacesAuthorizationRule_Spec +func (rule *NamespacesAuthorizationRule_Spec) AssignProperties_To_NamespacesAuthorizationRule_Spec(destination *storage.NamespacesAuthorizationRule_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // AzureName + destination.AzureName = rule.AzureName + + // OperatorSpec + if rule.OperatorSpec != nil { + var operatorSpec storage.NamespacesAuthorizationRuleOperatorSpec + err := rule.OperatorSpec.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&operatorSpec) + if err != nil { + return eris.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_NamespacesAuthorizationRule_STATUS populates our NamespacesAuthorizationRule_Spec from the provided source NamespacesAuthorizationRule_STATUS +func (rule *NamespacesAuthorizationRule_Spec) Initialize_From_NamespacesAuthorizationRule_STATUS(source *NamespacesAuthorizationRule_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 := genruntime.ToEnum(string(rightItem), namespaces_AuthorizationRule_Properties_Rights_Spec_Values) + 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 *NamespacesAuthorizationRule_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (rule *NamespacesAuthorizationRule_Spec) SetAzureName(azureName string) { + rule.AzureName = azureName +} + +type NamespacesAuthorizationRule_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 = &NamespacesAuthorizationRule_STATUS{} + +// ConvertStatusFrom populates our NamespacesAuthorizationRule_STATUS from the provided source +func (rule *NamespacesAuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*storage.NamespacesAuthorizationRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_NamespacesAuthorizationRule_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesAuthorizationRule_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_NamespacesAuthorizationRule_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our NamespacesAuthorizationRule_STATUS +func (rule *NamespacesAuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*storage.NamespacesAuthorizationRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_NamespacesAuthorizationRule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesAuthorizationRule_STATUS{} + err := rule.AssignProperties_To_NamespacesAuthorizationRule_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +var _ genruntime.FromARMConverter = &NamespacesAuthorizationRule_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *NamespacesAuthorizationRule_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.NamespacesAuthorizationRule_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *NamespacesAuthorizationRule_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.NamespacesAuthorizationRule_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.NamespacesAuthorizationRule_STATUS, 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 { + var temp string + temp = string(item) + rule.Rights = append(rule.Rights, Namespaces_AuthorizationRule_Properties_Rights_STATUS(temp)) + } + } + + // 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_NamespacesAuthorizationRule_STATUS populates our NamespacesAuthorizationRule_STATUS from the provided source NamespacesAuthorizationRule_STATUS +func (rule *NamespacesAuthorizationRule_STATUS) AssignProperties_From_NamespacesAuthorizationRule_STATUS(source *storage.NamespacesAuthorizationRule_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] = genruntime.ToEnum(rightItem, namespaces_AuthorizationRule_Properties_Rights_STATUS_Values) + } + 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 eris.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_NamespacesAuthorizationRule_STATUS populates the provided destination NamespacesAuthorizationRule_STATUS from our NamespacesAuthorizationRule_STATUS +func (rule *NamespacesAuthorizationRule_STATUS) AssignProperties_To_NamespacesAuthorizationRule_STATUS(destination *storage.NamespacesAuthorizationRule_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 storage.SystemData_STATUS + err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // 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") +) + +// Mapping from string to Namespaces_AuthorizationRule_Properties_Rights_Spec +var namespaces_AuthorizationRule_Properties_Rights_Spec_Values = map[string]Namespaces_AuthorizationRule_Properties_Rights_Spec{ + "listen": Namespaces_AuthorizationRule_Properties_Rights_Spec_Listen, + "manage": Namespaces_AuthorizationRule_Properties_Rights_Spec_Manage, + "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") +) + +// Mapping from string to Namespaces_AuthorizationRule_Properties_Rights_STATUS +var namespaces_AuthorizationRule_Properties_Rights_STATUS_Values = map[string]Namespaces_AuthorizationRule_Properties_Rights_STATUS{ + "listen": Namespaces_AuthorizationRule_Properties_Rights_STATUS_Listen, + "manage": Namespaces_AuthorizationRule_Properties_Rights_STATUS_Manage, + "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 { + // ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions). + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + + // SecretExpressions: configures where to place operator written dynamic secrets (created with CEL expressions). + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` + + // Secrets: configures where to place Azure generated secrets. + Secrets *NamespacesAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` +} + +// AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec populates our NamespacesAuthorizationRuleOperatorSpec from the provided source NamespacesAuthorizationRuleOperatorSpec +func (operator *NamespacesAuthorizationRuleOperatorSpec) AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(source *storage.NamespacesAuthorizationRuleOperatorSpec) error { + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // Secrets + if source.Secrets != nil { + var secret NamespacesAuthorizationRuleOperatorSecrets + err := secret.AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source.Secrets) + if err != nil { + return eris.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 *storage.NamespacesAuthorizationRuleOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Secrets + if operator.Secrets != nil { + var secret storage.NamespacesAuthorizationRuleOperatorSecrets + err := operator.Secrets.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&secret) + if err != nil { + return eris.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 *storage.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 *storage.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/v1api20240101/namespaces_authorization_rule_types_gen_test.go b/v2/api/servicebus/v1api20240101/namespaces_authorization_rule_types_gen_test.go new file mode 100644 index 00000000000..91077b11749 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/namespaces_authorization_rule_types_gen_test.go @@ -0,0 +1,605 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesAuthorizationRule_WhenConvertedToHub_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + parameters.MinSuccessfulTests = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRule to hub returns original", + prop.ForAll(RunResourceConversionTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunResourceConversionTestForNamespacesAuthorizationRule tests if a specific instance of NamespacesAuthorizationRule round trips to the hub storage version and back losslessly +func RunResourceConversionTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { + // Copy subject to make sure conversion doesn't modify it + copied := subject.DeepCopy() + + // Convert to our hub version + var hub storage.NamespacesAuthorizationRule + err := copied.ConvertTo(&hub) + if err != nil { + return err.Error() + } + + // Convert from our hub version + var actual NamespacesAuthorizationRule + err = actual.ConvertFrom(&hub) + if err != nil { + return err.Error() + } + + // Compare actual with what we started with + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesAuthorizationRule_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRule to NamespacesAuthorizationRule via AssignProperties_To_NamespacesAuthorizationRule & AssignProperties_From_NamespacesAuthorizationRule returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRule tests if a specific instance of NamespacesAuthorizationRule can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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"] = NamespacesAuthorizationRule_SpecGenerator() + gens["Status"] = NamespacesAuthorizationRule_STATUSGenerator() +} + +func Test_NamespacesAuthorizationRuleOperatorSecrets_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRuleOperatorSecrets to NamespacesAuthorizationRuleOperatorSecrets via AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets & AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets, NamespacesAuthorizationRuleOperatorSecretsGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets tests if a specific instance of NamespacesAuthorizationRuleOperatorSecrets can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSecrets(subject NamespacesAuthorizationRuleOperatorSecrets) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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 +} + +func Test_NamespacesAuthorizationRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRuleOperatorSpec to NamespacesAuthorizationRuleOperatorSpec via AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec & AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec, NamespacesAuthorizationRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec tests if a specific instance of NamespacesAuthorizationRuleOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRuleOperatorSpec(subject NamespacesAuthorizationRuleOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.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_NamespacesAuthorizationRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRule_STATUS to NamespacesAuthorizationRule_STATUS via AssignProperties_To_NamespacesAuthorizationRule_STATUS & AssignProperties_From_NamespacesAuthorizationRule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRule_STATUS, NamespacesAuthorizationRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRule_STATUS tests if a specific instance of NamespacesAuthorizationRule_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRule_STATUS(subject NamespacesAuthorizationRule_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesAuthorizationRule_STATUS + err := copied.AssignProperties_To_NamespacesAuthorizationRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesAuthorizationRule_STATUS + err = actual.AssignProperties_From_NamespacesAuthorizationRule_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_NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRule_STATUS, NamespacesAuthorizationRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRule_STATUS runs a test to see if a specific instance of NamespacesAuthorizationRule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRule_STATUS(subject NamespacesAuthorizationRule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_STATUS instances for property testing - lazily instantiated by +// NamespacesAuthorizationRule_STATUSGenerator() +var namespacesAuthorizationRule_STATUSGenerator gopter.Gen + +// NamespacesAuthorizationRule_STATUSGenerator returns a generator of NamespacesAuthorizationRule_STATUS instances for property testing. +// We first initialize namespacesAuthorizationRule_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 NamespacesAuthorizationRule_STATUSGenerator() gopter.Gen { + if namespacesAuthorizationRule_STATUSGenerator != nil { + return namespacesAuthorizationRule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_STATUS(generators) + namespacesAuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_STATUS(generators) + namespacesAuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule_STATUS{}), generators) + + return namespacesAuthorizationRule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_STATUS(gens map[string]gopter.Gen) { + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_NamespacesAuthorizationRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesAuthorizationRule_Spec to NamespacesAuthorizationRule_Spec via AssignProperties_To_NamespacesAuthorizationRule_Spec & AssignProperties_From_NamespacesAuthorizationRule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesAuthorizationRule_Spec, NamespacesAuthorizationRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesAuthorizationRule_Spec tests if a specific instance of NamespacesAuthorizationRule_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesAuthorizationRule_Spec(subject NamespacesAuthorizationRule_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesAuthorizationRule_Spec + err := copied.AssignProperties_To_NamespacesAuthorizationRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesAuthorizationRule_Spec + err = actual.AssignProperties_From_NamespacesAuthorizationRule_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_NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRule_Spec, NamespacesAuthorizationRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRule_Spec runs a test to see if a specific instance of NamespacesAuthorizationRule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRule_Spec(subject NamespacesAuthorizationRule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_Spec instances for property testing - lazily instantiated by +// NamespacesAuthorizationRule_SpecGenerator() +var namespacesAuthorizationRule_SpecGenerator gopter.Gen + +// NamespacesAuthorizationRule_SpecGenerator returns a generator of NamespacesAuthorizationRule_Spec instances for property testing. +// We first initialize namespacesAuthorizationRule_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 NamespacesAuthorizationRule_SpecGenerator() gopter.Gen { + if namespacesAuthorizationRule_SpecGenerator != nil { + return namespacesAuthorizationRule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_Spec(generators) + namespacesAuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_Spec(generators) + namespacesAuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule_Spec{}), generators) + + return namespacesAuthorizationRule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_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)) +} + +// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSpecGenerator()) +} diff --git a/v2/api/servicebus/v1api20240101/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20240101/namespaces_queue_types_gen.go new file mode 100644 index 00000000000..d13ae993fe1 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/namespaces_queue_types_gen.go @@ -0,0 +1,2024 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "fmt" + arm "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/arm" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 NamespacesQueue_Spec `json:"spec,omitempty"` + Status NamespacesQueue_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.(*storage.NamespacesQueue) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/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.(*storage.NamespacesQueue) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/NamespacesQueue but received %T instead", hub) + } + + return queue.AssignProperties_To_NamespacesQueue(destination) +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20240101-namespacesqueue,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesqueues,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.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 _ configmaps.Exporter = &NamespacesQueue{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (queue *NamespacesQueue) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if queue.Spec.OperatorSpec == nil { + return nil + } + return queue.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &NamespacesQueue{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (queue *NamespacesQueue) SecretDestinationExpressions() []*core.DestinationExpression { + if queue.Spec.OperatorSpec == nil { + return nil + } + return queue.Spec.OperatorSpec.SecretExpressions +} + +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.(*NamespacesQueue_STATUS); ok { + return queue.Spec.Initialize_From_NamespacesQueue_STATUS(s) + } + + return fmt.Errorf("expected Status of type NamespacesQueue_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 "2024-01-01" +func (queue NamespacesQueue) GetAPIVersion() string { + return "2024-01-01" +} + +// 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 +} + +// GetSupportedOperations returns the operations supported by the resource +func (queue *NamespacesQueue) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// 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 &NamespacesQueue_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (queue *NamespacesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) + return queue.Spec.Owner.AsResourceReference(group, kind) +} + +// 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.(*NamespacesQueue_STATUS); ok { + queue.Status = *st + return nil + } + + // Convert status to required version + var st NamespacesQueue_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.Wrap(err, "failed to convert status") + } + + queue.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-servicebus-azure-com-v1api20240101-namespacesqueue,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacesqueues,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.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, queue.validateOwnerReference, queue.validateSecretDestinations, queue.validateConfigMapDestinations} +} + +// 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, + func(old runtime.Object) (admission.Warnings, error) { + return queue.validateOwnerReference() + }, + func(old runtime.Object) (admission.Warnings, error) { + return queue.validateSecretDestinations() + }, + func(old runtime.Object) (admission.Warnings, error) { + return queue.validateConfigMapDestinations() + }, + } +} + +// validateConfigMapDestinations validates there are no colliding genruntime.ConfigMapDestinations +func (queue *NamespacesQueue) validateConfigMapDestinations() (admission.Warnings, error) { + if queue.Spec.OperatorSpec == nil { + return nil, nil + } + return configmaps.ValidateDestinations(queue, nil, queue.Spec.OperatorSpec.ConfigMapExpressions) +} + +// validateOwnerReference validates the owner field +func (queue *NamespacesQueue) validateOwnerReference() (admission.Warnings, error) { + return genruntime.ValidateOwner(queue) +} + +// 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) +} + +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (queue *NamespacesQueue) validateSecretDestinations() (admission.Warnings, error) { + if queue.Spec.OperatorSpec == nil { + return nil, nil + } + return secrets.ValidateDestinations(queue, nil, queue.Spec.OperatorSpec.SecretExpressions) +} + +// 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 *storage.NamespacesQueue) error { + + // ObjectMeta + queue.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec NamespacesQueue_Spec + err := spec.AssignProperties_From_NamespacesQueue_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesQueue_Spec() to populate field Spec") + } + queue.Spec = spec + + // Status + var status NamespacesQueue_STATUS + err = status.AssignProperties_From_NamespacesQueue_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesQueue_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 *storage.NamespacesQueue) error { + + // ObjectMeta + destination.ObjectMeta = *queue.ObjectMeta.DeepCopy() + + // Spec + var spec storage.NamespacesQueue_Spec + err := queue.Spec.AssignProperties_To_NamespacesQueue_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesQueue_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.NamespacesQueue_STATUS + err = queue.Status.AssignProperties_To_NamespacesQueue_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesQueue_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/2024-01-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 NamespacesQueue_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"` + + // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not + // passed directly to Azure + OperatorSpec *NamespacesQueueOperatorSpec `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"` + + // 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 = &NamespacesQueue_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (queue *NamespacesQueue_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if queue == nil { + return nil, nil + } + result := &arm.NamespacesQueue_Spec{} + + // 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 = &arm.SBQueueProperties{} + } + 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 *NamespacesQueue_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.NamespacesQueue_Spec{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (queue *NamespacesQueue_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.NamespacesQueue_Spec) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.NamespacesQueue_Spec, 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 + } + } + + // no assignment for property "OperatorSpec" + + // Set property "Owner": + queue.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + ARMID: owner.ARMID, + } + + // 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 = &NamespacesQueue_Spec{} + +// ConvertSpecFrom populates our NamespacesQueue_Spec from the provided source +func (queue *NamespacesQueue_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*storage.NamespacesQueue_Spec) + if ok { + // Populate our instance from source + return queue.AssignProperties_From_NamespacesQueue_Spec(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesQueue_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = queue.AssignProperties_From_NamespacesQueue_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our NamespacesQueue_Spec +func (queue *NamespacesQueue_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*storage.NamespacesQueue_Spec) + if ok { + // Populate destination from our instance + return queue.AssignProperties_To_NamespacesQueue_Spec(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesQueue_Spec{} + err := queue.AssignProperties_To_NamespacesQueue_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesQueue_Spec populates our NamespacesQueue_Spec from the provided source NamespacesQueue_Spec +func (queue *NamespacesQueue_Spec) AssignProperties_From_NamespacesQueue_Spec(source *storage.NamespacesQueue_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) + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesQueueOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesQueueOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesQueueOperatorSpec() to populate field OperatorSpec") + } + queue.OperatorSpec = &operatorSpec + } else { + queue.OperatorSpec = nil + } + + // 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_NamespacesQueue_Spec populates the provided destination NamespacesQueue_Spec from our NamespacesQueue_Spec +func (queue *NamespacesQueue_Spec) AssignProperties_To_NamespacesQueue_Spec(destination *storage.NamespacesQueue_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) + + // OperatorSpec + if queue.OperatorSpec != nil { + var operatorSpec storage.NamespacesQueueOperatorSpec + err := queue.OperatorSpec.AssignProperties_To_NamespacesQueueOperatorSpec(&operatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesQueueOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // 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_NamespacesQueue_STATUS populates our NamespacesQueue_Spec from the provided source NamespacesQueue_STATUS +func (queue *NamespacesQueue_Spec) Initialize_From_NamespacesQueue_STATUS(source *NamespacesQueue_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 *NamespacesQueue_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (queue *NamespacesQueue_Spec) SetAzureName(azureName string) { queue.AzureName = azureName } + +type NamespacesQueue_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 = &NamespacesQueue_STATUS{} + +// ConvertStatusFrom populates our NamespacesQueue_STATUS from the provided source +func (queue *NamespacesQueue_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*storage.NamespacesQueue_STATUS) + if ok { + // Populate our instance from source + return queue.AssignProperties_From_NamespacesQueue_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesQueue_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = queue.AssignProperties_From_NamespacesQueue_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our NamespacesQueue_STATUS +func (queue *NamespacesQueue_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*storage.NamespacesQueue_STATUS) + if ok { + // Populate destination from our instance + return queue.AssignProperties_To_NamespacesQueue_STATUS(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesQueue_STATUS{} + err := queue.AssignProperties_To_NamespacesQueue_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +var _ genruntime.FromARMConverter = &NamespacesQueue_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (queue *NamespacesQueue_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.NamespacesQueue_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (queue *NamespacesQueue_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.NamespacesQueue_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.NamespacesQueue_STATUS, 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 { + var temp string + temp = string(*typedInput.Properties.Status) + status := EntityStatus_STATUS(temp) + 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_NamespacesQueue_STATUS populates our NamespacesQueue_STATUS from the provided source NamespacesQueue_STATUS +func (queue *NamespacesQueue_STATUS) AssignProperties_From_NamespacesQueue_STATUS(source *storage.NamespacesQueue_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 eris.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 := *source.Status + statusTemp := genruntime.ToEnum(status, entityStatus_STATUS_Values) + queue.Status = &statusTemp + } 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 eris.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_NamespacesQueue_STATUS populates the provided destination NamespacesQueue_STATUS from our NamespacesQueue_STATUS +func (queue *NamespacesQueue_STATUS) AssignProperties_To_NamespacesQueue_STATUS(destination *storage.NamespacesQueue_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 storage.MessageCountDetails_STATUS + err := queue.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return eris.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 storage.SystemData_STATUS + err := queue.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // 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") +) + +// Mapping from string to EntityStatus_STATUS +var entityStatus_STATUS_Values = map[string]EntityStatus_STATUS{ + "active": EntityStatus_STATUS_Active, + "creating": EntityStatus_STATUS_Creating, + "deleting": EntityStatus_STATUS_Deleting, + "disabled": EntityStatus_STATUS_Disabled, + "receivedisabled": EntityStatus_STATUS_ReceiveDisabled, + "renaming": EntityStatus_STATUS_Renaming, + "restoring": EntityStatus_STATUS_Restoring, + "senddisabled": EntityStatus_STATUS_SendDisabled, + "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 &arm.MessageCountDetails_STATUS{} +} + +// 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.(arm.MessageCountDetails_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.MessageCountDetails_STATUS, 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 *storage.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 *storage.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 +} + +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesQueueOperatorSpec struct { + // ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions). + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + + // SecretExpressions: configures where to place operator written dynamic secrets (created with CEL expressions). + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` +} + +// AssignProperties_From_NamespacesQueueOperatorSpec populates our NamespacesQueueOperatorSpec from the provided source NamespacesQueueOperatorSpec +func (operator *NamespacesQueueOperatorSpec) AssignProperties_From_NamespacesQueueOperatorSpec(source *storage.NamespacesQueueOperatorSpec) error { + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesQueueOperatorSpec populates the provided destination NamespacesQueueOperatorSpec from our NamespacesQueueOperatorSpec +func (operator *NamespacesQueueOperatorSpec) AssignProperties_To_NamespacesQueueOperatorSpec(destination *storage.NamespacesQueueOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&NamespacesQueue{}, &NamespacesQueueList{}) +} diff --git a/v2/api/servicebus/v1api20240101/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1api20240101/namespaces_queue_types_gen_test.go new file mode 100644 index 00000000000..e792bc95e90 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/namespaces_queue_types_gen_test.go @@ -0,0 +1,652 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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 storage 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 storage.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()) +} + +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 storage.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 storage 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 storage.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"] = NamespacesQueue_SpecGenerator() + gens["Status"] = NamespacesQueue_STATUSGenerator() +} + +func Test_NamespacesQueueOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesQueueOperatorSpec to NamespacesQueueOperatorSpec via AssignProperties_To_NamespacesQueueOperatorSpec & AssignProperties_From_NamespacesQueueOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesQueueOperatorSpec, NamespacesQueueOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesQueueOperatorSpec tests if a specific instance of NamespacesQueueOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesQueueOperatorSpec(subject NamespacesQueueOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesQueueOperatorSpec + err := copied.AssignProperties_To_NamespacesQueueOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesQueueOperatorSpec + err = actual.AssignProperties_From_NamespacesQueueOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesQueueOperatorSpec_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 NamespacesQueueOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesQueueOperatorSpec, NamespacesQueueOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesQueueOperatorSpec runs a test to see if a specific instance of NamespacesQueueOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesQueueOperatorSpec(subject NamespacesQueueOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesQueueOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesQueueOperatorSpec instances for property testing - lazily instantiated by +// NamespacesQueueOperatorSpecGenerator() +var namespacesQueueOperatorSpecGenerator gopter.Gen + +// NamespacesQueueOperatorSpecGenerator returns a generator of NamespacesQueueOperatorSpec instances for property testing. +func NamespacesQueueOperatorSpecGenerator() gopter.Gen { + if namespacesQueueOperatorSpecGenerator != nil { + return namespacesQueueOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesQueueOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesQueueOperatorSpec{}), generators) + + return namespacesQueueOperatorSpecGenerator +} + +func Test_NamespacesQueue_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesQueue_STATUS to NamespacesQueue_STATUS via AssignProperties_To_NamespacesQueue_STATUS & AssignProperties_From_NamespacesQueue_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesQueue_STATUS, NamespacesQueue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesQueue_STATUS tests if a specific instance of NamespacesQueue_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesQueue_STATUS(subject NamespacesQueue_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesQueue_STATUS + err := copied.AssignProperties_To_NamespacesQueue_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesQueue_STATUS + err = actual.AssignProperties_From_NamespacesQueue_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_NamespacesQueue_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 NamespacesQueue_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesQueue_STATUS, NamespacesQueue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesQueue_STATUS runs a test to see if a specific instance of NamespacesQueue_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesQueue_STATUS(subject NamespacesQueue_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesQueue_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 NamespacesQueue_STATUS instances for property testing - lazily instantiated by +// NamespacesQueue_STATUSGenerator() +var namespacesQueue_STATUSGenerator gopter.Gen + +// NamespacesQueue_STATUSGenerator returns a generator of NamespacesQueue_STATUS instances for property testing. +// We first initialize namespacesQueue_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 NamespacesQueue_STATUSGenerator() gopter.Gen { + if namespacesQueue_STATUSGenerator != nil { + return namespacesQueue_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesQueue_STATUS(generators) + namespacesQueue_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesQueue_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesQueue_STATUS(generators) + namespacesQueue_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue_STATUS{}), generators) + + return namespacesQueue_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesQueue_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesQueue_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesQueue_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesQueue_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_NamespacesQueue_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesQueue_Spec to NamespacesQueue_Spec via AssignProperties_To_NamespacesQueue_Spec & AssignProperties_From_NamespacesQueue_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesQueue_Spec, NamespacesQueue_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesQueue_Spec tests if a specific instance of NamespacesQueue_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesQueue_Spec(subject NamespacesQueue_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesQueue_Spec + err := copied.AssignProperties_To_NamespacesQueue_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesQueue_Spec + err = actual.AssignProperties_From_NamespacesQueue_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_NamespacesQueue_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 NamespacesQueue_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesQueue_Spec, NamespacesQueue_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesQueue_Spec runs a test to see if a specific instance of NamespacesQueue_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesQueue_Spec(subject NamespacesQueue_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesQueue_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 NamespacesQueue_Spec instances for property testing - lazily instantiated by +// NamespacesQueue_SpecGenerator() +var namespacesQueue_SpecGenerator gopter.Gen + +// NamespacesQueue_SpecGenerator returns a generator of NamespacesQueue_Spec instances for property testing. +// We first initialize namespacesQueue_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 NamespacesQueue_SpecGenerator() gopter.Gen { + if namespacesQueue_SpecGenerator != nil { + return namespacesQueue_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesQueue_Spec(generators) + namespacesQueue_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesQueue_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesQueue_Spec(generators) + namespacesQueue_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue_Spec{}), generators) + + return namespacesQueue_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesQueue_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesQueue_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesQueue_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesQueue_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesQueueOperatorSpecGenerator()) +} diff --git a/v2/api/servicebus/v1api20240101/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20240101/namespaces_topic_types_gen.go new file mode 100644 index 00000000000..07e5af0e69e --- /dev/null +++ b/v2/api/servicebus/v1api20240101/namespaces_topic_types_gen.go @@ -0,0 +1,1626 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "fmt" + arm "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/arm" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 NamespacesTopic_Spec `json:"spec,omitempty"` + Status NamespacesTopic_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.(*storage.NamespacesTopic) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/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.(*storage.NamespacesTopic) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/NamespacesTopic but received %T instead", hub) + } + + return topic.AssignProperties_To_NamespacesTopic(destination) +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20240101-namespacestopic,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopics,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.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 _ configmaps.Exporter = &NamespacesTopic{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (topic *NamespacesTopic) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if topic.Spec.OperatorSpec == nil { + return nil + } + return topic.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &NamespacesTopic{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (topic *NamespacesTopic) SecretDestinationExpressions() []*core.DestinationExpression { + if topic.Spec.OperatorSpec == nil { + return nil + } + return topic.Spec.OperatorSpec.SecretExpressions +} + +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.(*NamespacesTopic_STATUS); ok { + return topic.Spec.Initialize_From_NamespacesTopic_STATUS(s) + } + + return fmt.Errorf("expected Status of type NamespacesTopic_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 "2024-01-01" +func (topic NamespacesTopic) GetAPIVersion() string { + return "2024-01-01" +} + +// 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 +} + +// GetSupportedOperations returns the operations supported by the resource +func (topic *NamespacesTopic) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// 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 &NamespacesTopic_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (topic *NamespacesTopic) Owner() *genruntime.ResourceReference { + if topic.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) + return topic.Spec.Owner.AsResourceReference(group, kind) +} + +// 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.(*NamespacesTopic_STATUS); ok { + topic.Status = *st + return nil + } + + // Convert status to required version + var st NamespacesTopic_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.Wrap(err, "failed to convert status") + } + + topic.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-servicebus-azure-com-v1api20240101-namespacestopic,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopics,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.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, topic.validateOwnerReference, topic.validateSecretDestinations, topic.validateConfigMapDestinations} +} + +// 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, + func(old runtime.Object) (admission.Warnings, error) { + return topic.validateOwnerReference() + }, + func(old runtime.Object) (admission.Warnings, error) { + return topic.validateSecretDestinations() + }, + func(old runtime.Object) (admission.Warnings, error) { + return topic.validateConfigMapDestinations() + }, + } +} + +// validateConfigMapDestinations validates there are no colliding genruntime.ConfigMapDestinations +func (topic *NamespacesTopic) validateConfigMapDestinations() (admission.Warnings, error) { + if topic.Spec.OperatorSpec == nil { + return nil, nil + } + return configmaps.ValidateDestinations(topic, nil, topic.Spec.OperatorSpec.ConfigMapExpressions) +} + +// validateOwnerReference validates the owner field +func (topic *NamespacesTopic) validateOwnerReference() (admission.Warnings, error) { + return genruntime.ValidateOwner(topic) +} + +// 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) +} + +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (topic *NamespacesTopic) validateSecretDestinations() (admission.Warnings, error) { + if topic.Spec.OperatorSpec == nil { + return nil, nil + } + return secrets.ValidateDestinations(topic, nil, topic.Spec.OperatorSpec.SecretExpressions) +} + +// 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 *storage.NamespacesTopic) error { + + // ObjectMeta + topic.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec NamespacesTopic_Spec + err := spec.AssignProperties_From_NamespacesTopic_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopic_Spec() to populate field Spec") + } + topic.Spec = spec + + // Status + var status NamespacesTopic_STATUS + err = status.AssignProperties_From_NamespacesTopic_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopic_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 *storage.NamespacesTopic) error { + + // ObjectMeta + destination.ObjectMeta = *topic.ObjectMeta.DeepCopy() + + // Spec + var spec storage.NamespacesTopic_Spec + err := topic.Spec.AssignProperties_To_NamespacesTopic_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopic_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.NamespacesTopic_STATUS + err = topic.Status.AssignProperties_To_NamespacesTopic_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopic_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/2024-01-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 NamespacesTopic_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"` + + // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not + // passed directly to Azure + OperatorSpec *NamespacesTopicOperatorSpec `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"` + + // 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 = &NamespacesTopic_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (topic *NamespacesTopic_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if topic == nil { + return nil, nil + } + result := &arm.NamespacesTopic_Spec{} + + // 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 = &arm.SBTopicProperties{} + } + 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 *NamespacesTopic_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.NamespacesTopic_Spec{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (topic *NamespacesTopic_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.NamespacesTopic_Spec) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.NamespacesTopic_Spec, 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 + } + } + + // no assignment for property "OperatorSpec" + + // Set property "Owner": + topic.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + ARMID: owner.ARMID, + } + + // 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 = &NamespacesTopic_Spec{} + +// ConvertSpecFrom populates our NamespacesTopic_Spec from the provided source +func (topic *NamespacesTopic_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*storage.NamespacesTopic_Spec) + if ok { + // Populate our instance from source + return topic.AssignProperties_From_NamespacesTopic_Spec(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesTopic_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = topic.AssignProperties_From_NamespacesTopic_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our NamespacesTopic_Spec +func (topic *NamespacesTopic_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*storage.NamespacesTopic_Spec) + if ok { + // Populate destination from our instance + return topic.AssignProperties_To_NamespacesTopic_Spec(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesTopic_Spec{} + err := topic.AssignProperties_To_NamespacesTopic_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesTopic_Spec populates our NamespacesTopic_Spec from the provided source NamespacesTopic_Spec +func (topic *NamespacesTopic_Spec) AssignProperties_From_NamespacesTopic_Spec(source *storage.NamespacesTopic_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) + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesTopicOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesTopicOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicOperatorSpec() to populate field OperatorSpec") + } + topic.OperatorSpec = &operatorSpec + } else { + topic.OperatorSpec = nil + } + + // 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_NamespacesTopic_Spec populates the provided destination NamespacesTopic_Spec from our NamespacesTopic_Spec +func (topic *NamespacesTopic_Spec) AssignProperties_To_NamespacesTopic_Spec(destination *storage.NamespacesTopic_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) + + // OperatorSpec + if topic.OperatorSpec != nil { + var operatorSpec storage.NamespacesTopicOperatorSpec + err := topic.OperatorSpec.AssignProperties_To_NamespacesTopicOperatorSpec(&operatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // 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_NamespacesTopic_STATUS populates our NamespacesTopic_Spec from the provided source NamespacesTopic_STATUS +func (topic *NamespacesTopic_Spec) Initialize_From_NamespacesTopic_STATUS(source *NamespacesTopic_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 *NamespacesTopic_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (topic *NamespacesTopic_Spec) SetAzureName(azureName string) { topic.AzureName = azureName } + +type NamespacesTopic_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 = &NamespacesTopic_STATUS{} + +// ConvertStatusFrom populates our NamespacesTopic_STATUS from the provided source +func (topic *NamespacesTopic_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*storage.NamespacesTopic_STATUS) + if ok { + // Populate our instance from source + return topic.AssignProperties_From_NamespacesTopic_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesTopic_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = topic.AssignProperties_From_NamespacesTopic_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our NamespacesTopic_STATUS +func (topic *NamespacesTopic_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*storage.NamespacesTopic_STATUS) + if ok { + // Populate destination from our instance + return topic.AssignProperties_To_NamespacesTopic_STATUS(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesTopic_STATUS{} + err := topic.AssignProperties_To_NamespacesTopic_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +var _ genruntime.FromARMConverter = &NamespacesTopic_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (topic *NamespacesTopic_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.NamespacesTopic_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (topic *NamespacesTopic_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.NamespacesTopic_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.NamespacesTopic_STATUS, 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 { + var temp string + temp = string(*typedInput.Properties.Status) + status := EntityStatus_STATUS(temp) + 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_NamespacesTopic_STATUS populates our NamespacesTopic_STATUS from the provided source NamespacesTopic_STATUS +func (topic *NamespacesTopic_STATUS) AssignProperties_From_NamespacesTopic_STATUS(source *storage.NamespacesTopic_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 eris.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 := *source.Status + statusTemp := genruntime.ToEnum(status, entityStatus_STATUS_Values) + topic.Status = &statusTemp + } 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 eris.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_NamespacesTopic_STATUS populates the provided destination NamespacesTopic_STATUS from our NamespacesTopic_STATUS +func (topic *NamespacesTopic_STATUS) AssignProperties_To_NamespacesTopic_STATUS(destination *storage.NamespacesTopic_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 storage.MessageCountDetails_STATUS + err := topic.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return eris.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 storage.SystemData_STATUS + err := topic.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // 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 +} + +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesTopicOperatorSpec struct { + // ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions). + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + + // SecretExpressions: configures where to place operator written dynamic secrets (created with CEL expressions). + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` +} + +// AssignProperties_From_NamespacesTopicOperatorSpec populates our NamespacesTopicOperatorSpec from the provided source NamespacesTopicOperatorSpec +func (operator *NamespacesTopicOperatorSpec) AssignProperties_From_NamespacesTopicOperatorSpec(source *storage.NamespacesTopicOperatorSpec) error { + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicOperatorSpec populates the provided destination NamespacesTopicOperatorSpec from our NamespacesTopicOperatorSpec +func (operator *NamespacesTopicOperatorSpec) AssignProperties_To_NamespacesTopicOperatorSpec(destination *storage.NamespacesTopicOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +func init() { + SchemeBuilder.Register(&NamespacesTopic{}, &NamespacesTopicList{}) +} diff --git a/v2/api/servicebus/v1api20240101/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1api20240101/namespaces_topic_types_gen_test.go new file mode 100644 index 00000000000..705a6a49f80 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/namespaces_topic_types_gen_test.go @@ -0,0 +1,535 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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 storage.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 storage 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 storage.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"] = NamespacesTopic_SpecGenerator() + gens["Status"] = NamespacesTopic_STATUSGenerator() +} + +func Test_NamespacesTopicOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicOperatorSpec to NamespacesTopicOperatorSpec via AssignProperties_To_NamespacesTopicOperatorSpec & AssignProperties_From_NamespacesTopicOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicOperatorSpec, NamespacesTopicOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicOperatorSpec tests if a specific instance of NamespacesTopicOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicOperatorSpec(subject NamespacesTopicOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicOperatorSpec + err := copied.AssignProperties_To_NamespacesTopicOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicOperatorSpec + err = actual.AssignProperties_From_NamespacesTopicOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesTopicOperatorSpec_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 NamespacesTopicOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicOperatorSpec, NamespacesTopicOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicOperatorSpec runs a test to see if a specific instance of NamespacesTopicOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicOperatorSpec(subject NamespacesTopicOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicOperatorSpec instances for property testing - lazily instantiated by +// NamespacesTopicOperatorSpecGenerator() +var namespacesTopicOperatorSpecGenerator gopter.Gen + +// NamespacesTopicOperatorSpecGenerator returns a generator of NamespacesTopicOperatorSpec instances for property testing. +func NamespacesTopicOperatorSpecGenerator() gopter.Gen { + if namespacesTopicOperatorSpecGenerator != nil { + return namespacesTopicOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesTopicOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicOperatorSpec{}), generators) + + return namespacesTopicOperatorSpecGenerator +} + +func Test_NamespacesTopic_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopic_STATUS to NamespacesTopic_STATUS via AssignProperties_To_NamespacesTopic_STATUS & AssignProperties_From_NamespacesTopic_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopic_STATUS, NamespacesTopic_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopic_STATUS tests if a specific instance of NamespacesTopic_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopic_STATUS(subject NamespacesTopic_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopic_STATUS + err := copied.AssignProperties_To_NamespacesTopic_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopic_STATUS + err = actual.AssignProperties_From_NamespacesTopic_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_NamespacesTopic_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 NamespacesTopic_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopic_STATUS, NamespacesTopic_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopic_STATUS runs a test to see if a specific instance of NamespacesTopic_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopic_STATUS(subject NamespacesTopic_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopic_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 NamespacesTopic_STATUS instances for property testing - lazily instantiated by +// NamespacesTopic_STATUSGenerator() +var namespacesTopic_STATUSGenerator gopter.Gen + +// NamespacesTopic_STATUSGenerator returns a generator of NamespacesTopic_STATUS instances for property testing. +// We first initialize namespacesTopic_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 NamespacesTopic_STATUSGenerator() gopter.Gen { + if namespacesTopic_STATUSGenerator != nil { + return namespacesTopic_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopic_STATUS(generators) + namespacesTopic_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopic_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesTopic_STATUS(generators) + namespacesTopic_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic_STATUS{}), generators) + + return namespacesTopic_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopic_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopic_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopic_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopic_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_NamespacesTopic_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopic_Spec to NamespacesTopic_Spec via AssignProperties_To_NamespacesTopic_Spec & AssignProperties_From_NamespacesTopic_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopic_Spec, NamespacesTopic_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopic_Spec tests if a specific instance of NamespacesTopic_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopic_Spec(subject NamespacesTopic_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopic_Spec + err := copied.AssignProperties_To_NamespacesTopic_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopic_Spec + err = actual.AssignProperties_From_NamespacesTopic_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_NamespacesTopic_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 NamespacesTopic_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopic_Spec, NamespacesTopic_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopic_Spec runs a test to see if a specific instance of NamespacesTopic_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopic_Spec(subject NamespacesTopic_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopic_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 NamespacesTopic_Spec instances for property testing - lazily instantiated by +// NamespacesTopic_SpecGenerator() +var namespacesTopic_SpecGenerator gopter.Gen + +// NamespacesTopic_SpecGenerator returns a generator of NamespacesTopic_Spec instances for property testing. +// We first initialize namespacesTopic_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 NamespacesTopic_SpecGenerator() gopter.Gen { + if namespacesTopic_SpecGenerator != nil { + return namespacesTopic_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopic_Spec(generators) + namespacesTopic_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopic_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesTopic_Spec(generators) + namespacesTopic_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic_Spec{}), generators) + + return namespacesTopic_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopic_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopic_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopic_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopic_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesTopicOperatorSpecGenerator()) +} diff --git a/v2/api/servicebus/v1api20240101/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20240101/namespaces_topics_subscription_types_gen.go new file mode 100644 index 00000000000..df7647bc1e6 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/namespaces_topics_subscription_types_gen.go @@ -0,0 +1,2071 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "fmt" + arm "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/arm" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 NamespacesTopicsSubscription_Spec `json:"spec,omitempty"` + Status NamespacesTopicsSubscription_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.(*storage.NamespacesTopicsSubscription) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/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.(*storage.NamespacesTopicsSubscription) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/NamespacesTopicsSubscription but received %T instead", hub) + } + + return subscription.AssignProperties_To_NamespacesTopicsSubscription(destination) +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20240101-namespacestopicssubscription,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptions,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.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 _ configmaps.Exporter = &NamespacesTopicsSubscription{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (subscription *NamespacesTopicsSubscription) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if subscription.Spec.OperatorSpec == nil { + return nil + } + return subscription.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &NamespacesTopicsSubscription{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (subscription *NamespacesTopicsSubscription) SecretDestinationExpressions() []*core.DestinationExpression { + if subscription.Spec.OperatorSpec == nil { + return nil + } + return subscription.Spec.OperatorSpec.SecretExpressions +} + +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.(*NamespacesTopicsSubscription_STATUS); ok { + return subscription.Spec.Initialize_From_NamespacesTopicsSubscription_STATUS(s) + } + + return fmt.Errorf("expected Status of type NamespacesTopicsSubscription_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 "2024-01-01" +func (subscription NamespacesTopicsSubscription) GetAPIVersion() string { + return "2024-01-01" +} + +// 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 +} + +// GetSupportedOperations returns the operations supported by the resource +func (subscription *NamespacesTopicsSubscription) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// 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 &NamespacesTopicsSubscription_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (subscription *NamespacesTopicsSubscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) + return subscription.Spec.Owner.AsResourceReference(group, kind) +} + +// 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.(*NamespacesTopicsSubscription_STATUS); ok { + subscription.Status = *st + return nil + } + + // Convert status to required version + var st NamespacesTopicsSubscription_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.Wrap(err, "failed to convert status") + } + + subscription.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-servicebus-azure-com-v1api20240101-namespacestopicssubscription,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptions,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.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, subscription.validateOwnerReference, subscription.validateSecretDestinations, subscription.validateConfigMapDestinations} +} + +// 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, + func(old runtime.Object) (admission.Warnings, error) { + return subscription.validateOwnerReference() + }, + func(old runtime.Object) (admission.Warnings, error) { + return subscription.validateSecretDestinations() + }, + func(old runtime.Object) (admission.Warnings, error) { + return subscription.validateConfigMapDestinations() + }, + } +} + +// validateConfigMapDestinations validates there are no colliding genruntime.ConfigMapDestinations +func (subscription *NamespacesTopicsSubscription) validateConfigMapDestinations() (admission.Warnings, error) { + if subscription.Spec.OperatorSpec == nil { + return nil, nil + } + return configmaps.ValidateDestinations(subscription, nil, subscription.Spec.OperatorSpec.ConfigMapExpressions) +} + +// validateOwnerReference validates the owner field +func (subscription *NamespacesTopicsSubscription) validateOwnerReference() (admission.Warnings, error) { + return genruntime.ValidateOwner(subscription) +} + +// 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) +} + +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (subscription *NamespacesTopicsSubscription) validateSecretDestinations() (admission.Warnings, error) { + if subscription.Spec.OperatorSpec == nil { + return nil, nil + } + return secrets.ValidateDestinations(subscription, nil, subscription.Spec.OperatorSpec.SecretExpressions) +} + +// 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 *storage.NamespacesTopicsSubscription) error { + + // ObjectMeta + subscription.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec NamespacesTopicsSubscription_Spec + err := spec.AssignProperties_From_NamespacesTopicsSubscription_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicsSubscription_Spec() to populate field Spec") + } + subscription.Spec = spec + + // Status + var status NamespacesTopicsSubscription_STATUS + err = status.AssignProperties_From_NamespacesTopicsSubscription_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicsSubscription_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 *storage.NamespacesTopicsSubscription) error { + + // ObjectMeta + destination.ObjectMeta = *subscription.ObjectMeta.DeepCopy() + + // Spec + var spec storage.NamespacesTopicsSubscription_Spec + err := subscription.Spec.AssignProperties_To_NamespacesTopicsSubscription_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicsSubscription_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.NamespacesTopicsSubscription_STATUS + err = subscription.Status.AssignProperties_To_NamespacesTopicsSubscription_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicsSubscription_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/2024-01-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 NamespacesTopicsSubscription_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"` + + // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not + // passed directly to Azure + OperatorSpec *NamespacesTopicsSubscriptionOperatorSpec `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/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 = &NamespacesTopicsSubscription_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (subscription *NamespacesTopicsSubscription_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if subscription == nil { + return nil, nil + } + result := &arm.NamespacesTopicsSubscription_Spec{} + + // 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 = &arm.SBSubscriptionProperties{} + } + 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.(*arm.SBClientAffineProperties) + 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 *NamespacesTopicsSubscription_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.NamespacesTopicsSubscription_Spec{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (subscription *NamespacesTopicsSubscription_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.NamespacesTopicsSubscription_Spec) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.NamespacesTopicsSubscription_Spec, 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 + } + } + + // no assignment for property "OperatorSpec" + + // Set property "Owner": + subscription.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + ARMID: owner.ARMID, + } + + // 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 = &NamespacesTopicsSubscription_Spec{} + +// ConvertSpecFrom populates our NamespacesTopicsSubscription_Spec from the provided source +func (subscription *NamespacesTopicsSubscription_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*storage.NamespacesTopicsSubscription_Spec) + if ok { + // Populate our instance from source + return subscription.AssignProperties_From_NamespacesTopicsSubscription_Spec(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesTopicsSubscription_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = subscription.AssignProperties_From_NamespacesTopicsSubscription_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our NamespacesTopicsSubscription_Spec +func (subscription *NamespacesTopicsSubscription_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*storage.NamespacesTopicsSubscription_Spec) + if ok { + // Populate destination from our instance + return subscription.AssignProperties_To_NamespacesTopicsSubscription_Spec(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesTopicsSubscription_Spec{} + err := subscription.AssignProperties_To_NamespacesTopicsSubscription_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesTopicsSubscription_Spec populates our NamespacesTopicsSubscription_Spec from the provided source NamespacesTopicsSubscription_Spec +func (subscription *NamespacesTopicsSubscription_Spec) AssignProperties_From_NamespacesTopicsSubscription_Spec(source *storage.NamespacesTopicsSubscription_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 eris.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) + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesTopicsSubscriptionOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesTopicsSubscriptionOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicsSubscriptionOperatorSpec() to populate field OperatorSpec") + } + subscription.OperatorSpec = &operatorSpec + } else { + subscription.OperatorSpec = nil + } + + // 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_NamespacesTopicsSubscription_Spec populates the provided destination NamespacesTopicsSubscription_Spec from our NamespacesTopicsSubscription_Spec +func (subscription *NamespacesTopicsSubscription_Spec) AssignProperties_To_NamespacesTopicsSubscription_Spec(destination *storage.NamespacesTopicsSubscription_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 storage.SBClientAffineProperties + err := subscription.ClientAffineProperties.AssignProperties_To_SBClientAffineProperties(&clientAffineProperty) + if err != nil { + return eris.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) + + // OperatorSpec + if subscription.OperatorSpec != nil { + var operatorSpec storage.NamespacesTopicsSubscriptionOperatorSpec + err := subscription.OperatorSpec.AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec(&operatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec() to populate field OperatorSpec") + } + destination.OperatorSpec = &operatorSpec + } else { + destination.OperatorSpec = nil + } + + // 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_NamespacesTopicsSubscription_STATUS populates our NamespacesTopicsSubscription_Spec from the provided source NamespacesTopicsSubscription_STATUS +func (subscription *NamespacesTopicsSubscription_Spec) Initialize_From_NamespacesTopicsSubscription_STATUS(source *NamespacesTopicsSubscription_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 eris.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 *NamespacesTopicsSubscription_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (subscription *NamespacesTopicsSubscription_Spec) SetAzureName(azureName string) { + subscription.AzureName = azureName +} + +type NamespacesTopicsSubscription_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 = &NamespacesTopicsSubscription_STATUS{} + +// ConvertStatusFrom populates our NamespacesTopicsSubscription_STATUS from the provided source +func (subscription *NamespacesTopicsSubscription_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*storage.NamespacesTopicsSubscription_STATUS) + if ok { + // Populate our instance from source + return subscription.AssignProperties_From_NamespacesTopicsSubscription_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesTopicsSubscription_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = subscription.AssignProperties_From_NamespacesTopicsSubscription_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our NamespacesTopicsSubscription_STATUS +func (subscription *NamespacesTopicsSubscription_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*storage.NamespacesTopicsSubscription_STATUS) + if ok { + // Populate destination from our instance + return subscription.AssignProperties_To_NamespacesTopicsSubscription_STATUS(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesTopicsSubscription_STATUS{} + err := subscription.AssignProperties_To_NamespacesTopicsSubscription_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +var _ genruntime.FromARMConverter = &NamespacesTopicsSubscription_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (subscription *NamespacesTopicsSubscription_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.NamespacesTopicsSubscription_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (subscription *NamespacesTopicsSubscription_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.NamespacesTopicsSubscription_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.NamespacesTopicsSubscription_STATUS, 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 { + var temp string + temp = string(*typedInput.Properties.Status) + status := EntityStatus_STATUS(temp) + 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_NamespacesTopicsSubscription_STATUS populates our NamespacesTopicsSubscription_STATUS from the provided source NamespacesTopicsSubscription_STATUS +func (subscription *NamespacesTopicsSubscription_STATUS) AssignProperties_From_NamespacesTopicsSubscription_STATUS(source *storage.NamespacesTopicsSubscription_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 eris.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 eris.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 := *source.Status + statusTemp := genruntime.ToEnum(status, entityStatus_STATUS_Values) + subscription.Status = &statusTemp + } 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 eris.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_NamespacesTopicsSubscription_STATUS populates the provided destination NamespacesTopicsSubscription_STATUS from our NamespacesTopicsSubscription_STATUS +func (subscription *NamespacesTopicsSubscription_STATUS) AssignProperties_To_NamespacesTopicsSubscription_STATUS(destination *storage.NamespacesTopicsSubscription_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 storage.SBClientAffineProperties_STATUS + err := subscription.ClientAffineProperties.AssignProperties_To_SBClientAffineProperties_STATUS(&clientAffineProperty) + if err != nil { + return eris.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 storage.MessageCountDetails_STATUS + err := subscription.CountDetails.AssignProperties_To_MessageCountDetails_STATUS(&countDetail) + if err != nil { + return eris.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 storage.SystemData_STATUS + err := subscription.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // 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 +} + +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesTopicsSubscriptionOperatorSpec struct { + // ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions). + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + + // SecretExpressions: configures where to place operator written dynamic secrets (created with CEL expressions). + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` +} + +// AssignProperties_From_NamespacesTopicsSubscriptionOperatorSpec populates our NamespacesTopicsSubscriptionOperatorSpec from the provided source NamespacesTopicsSubscriptionOperatorSpec +func (operator *NamespacesTopicsSubscriptionOperatorSpec) AssignProperties_From_NamespacesTopicsSubscriptionOperatorSpec(source *storage.NamespacesTopicsSubscriptionOperatorSpec) error { + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec populates the provided destination NamespacesTopicsSubscriptionOperatorSpec from our NamespacesTopicsSubscriptionOperatorSpec +func (operator *NamespacesTopicsSubscriptionOperatorSpec) AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec(destination *storage.NamespacesTopicsSubscriptionOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// 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 := &arm.SBClientAffineProperties{} + + // 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 &arm.SBClientAffineProperties{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (properties *SBClientAffineProperties) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.SBClientAffineProperties) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.SBClientAffineProperties, 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 *storage.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 *storage.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 &arm.SBClientAffineProperties_STATUS{} +} + +// 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.(arm.SBClientAffineProperties_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.SBClientAffineProperties_STATUS, 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 *storage.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 *storage.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/v1api20240101/namespaces_topics_subscription_types_gen_test.go b/v2/api/servicebus/v1api20240101/namespaces_topics_subscription_types_gen_test.go new file mode 100644 index 00000000000..2d6c7283821 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/namespaces_topics_subscription_types_gen_test.go @@ -0,0 +1,751 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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 storage.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 storage 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 storage.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"] = NamespacesTopicsSubscription_SpecGenerator() + gens["Status"] = NamespacesTopicsSubscription_STATUSGenerator() +} + +func Test_NamespacesTopicsSubscriptionOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscriptionOperatorSpec to NamespacesTopicsSubscriptionOperatorSpec via AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec & AssignProperties_From_NamespacesTopicsSubscriptionOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscriptionOperatorSpec, NamespacesTopicsSubscriptionOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscriptionOperatorSpec tests if a specific instance of NamespacesTopicsSubscriptionOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionOperatorSpec(subject NamespacesTopicsSubscriptionOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicsSubscriptionOperatorSpec + err := copied.AssignProperties_To_NamespacesTopicsSubscriptionOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscriptionOperatorSpec + err = actual.AssignProperties_From_NamespacesTopicsSubscriptionOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesTopicsSubscriptionOperatorSpec_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 NamespacesTopicsSubscriptionOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionOperatorSpec, NamespacesTopicsSubscriptionOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionOperatorSpec runs a test to see if a specific instance of NamespacesTopicsSubscriptionOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionOperatorSpec(subject NamespacesTopicsSubscriptionOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicsSubscriptionOperatorSpec instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionOperatorSpecGenerator() +var namespacesTopicsSubscriptionOperatorSpecGenerator gopter.Gen + +// NamespacesTopicsSubscriptionOperatorSpecGenerator returns a generator of NamespacesTopicsSubscriptionOperatorSpec instances for property testing. +func NamespacesTopicsSubscriptionOperatorSpecGenerator() gopter.Gen { + if namespacesTopicsSubscriptionOperatorSpecGenerator != nil { + return namespacesTopicsSubscriptionOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesTopicsSubscriptionOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionOperatorSpec{}), generators) + + return namespacesTopicsSubscriptionOperatorSpecGenerator +} + +func Test_NamespacesTopicsSubscription_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscription_STATUS to NamespacesTopicsSubscription_STATUS via AssignProperties_To_NamespacesTopicsSubscription_STATUS & AssignProperties_From_NamespacesTopicsSubscription_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscription_STATUS, NamespacesTopicsSubscription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscription_STATUS tests if a specific instance of NamespacesTopicsSubscription_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscription_STATUS(subject NamespacesTopicsSubscription_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicsSubscription_STATUS + err := copied.AssignProperties_To_NamespacesTopicsSubscription_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscription_STATUS + err = actual.AssignProperties_From_NamespacesTopicsSubscription_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_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscription_STATUS, NamespacesTopicsSubscription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscription_STATUS runs a test to see if a specific instance of NamespacesTopicsSubscription_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscription_STATUS(subject NamespacesTopicsSubscription_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_STATUS instances for property testing - lazily instantiated by +// NamespacesTopicsSubscription_STATUSGenerator() +var namespacesTopicsSubscription_STATUSGenerator gopter.Gen + +// NamespacesTopicsSubscription_STATUSGenerator returns a generator of NamespacesTopicsSubscription_STATUS instances for property testing. +// We first initialize namespacesTopicsSubscription_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 NamespacesTopicsSubscription_STATUSGenerator() gopter.Gen { + if namespacesTopicsSubscription_STATUSGenerator != nil { + return namespacesTopicsSubscription_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_STATUS(generators) + namespacesTopicsSubscription_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_STATUS(generators) + namespacesTopicsSubscription_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription_STATUS{}), generators) + + return namespacesTopicsSubscription_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_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_NamespacesTopicsSubscription_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscription_Spec to NamespacesTopicsSubscription_Spec via AssignProperties_To_NamespacesTopicsSubscription_Spec & AssignProperties_From_NamespacesTopicsSubscription_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscription_Spec, NamespacesTopicsSubscription_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscription_Spec tests if a specific instance of NamespacesTopicsSubscription_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscription_Spec(subject NamespacesTopicsSubscription_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicsSubscription_Spec + err := copied.AssignProperties_To_NamespacesTopicsSubscription_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscription_Spec + err = actual.AssignProperties_From_NamespacesTopicsSubscription_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_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscription_Spec, NamespacesTopicsSubscription_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscription_Spec runs a test to see if a specific instance of NamespacesTopicsSubscription_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscription_Spec(subject NamespacesTopicsSubscription_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_Spec instances for property testing - lazily instantiated by +// NamespacesTopicsSubscription_SpecGenerator() +var namespacesTopicsSubscription_SpecGenerator gopter.Gen + +// NamespacesTopicsSubscription_SpecGenerator returns a generator of NamespacesTopicsSubscription_Spec instances for property testing. +// We first initialize namespacesTopicsSubscription_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 NamespacesTopicsSubscription_SpecGenerator() gopter.Gen { + if namespacesTopicsSubscription_SpecGenerator != nil { + return namespacesTopicsSubscription_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_Spec(generators) + namespacesTopicsSubscription_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_Spec(generators) + namespacesTopicsSubscription_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription_Spec{}), generators) + + return namespacesTopicsSubscription_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_Spec(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffinePropertiesGenerator()) + gens["OperatorSpec"] = gen.PtrOf(NamespacesTopicsSubscriptionOperatorSpecGenerator()) +} + +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 storage 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 storage.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 storage 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 storage.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/v1api20240101/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20240101/namespaces_topics_subscriptions_rule_types_gen.go new file mode 100644 index 00000000000..d66711a1b73 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/namespaces_topics_subscriptions_rule_types_gen.go @@ -0,0 +1,2328 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "fmt" + arm "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/arm" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" + "github.com/Azure/azure-service-operator/v2/internal/reflecthelpers" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/controller-runtime/pkg/webhook/admission" +) + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity" +// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason" +// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message" +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 NamespacesTopicsSubscriptionsRule_Spec `json:"spec,omitempty"` + Status NamespacesTopicsSubscriptionsRule_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.(*storage.NamespacesTopicsSubscriptionsRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/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.(*storage.NamespacesTopicsSubscriptionsRule) + if !ok { + return fmt.Errorf("expected servicebus/v1api20240101/storage/NamespacesTopicsSubscriptionsRule but received %T instead", hub) + } + + return rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule(destination) +} + +// +kubebuilder:webhook:path=/mutate-servicebus-azure-com-v1api20240101-namespacestopicssubscriptionsrule,mutating=true,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptionsrules,verbs=create;update,versions=v1api20240101,name=default.v1api20240101.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 _ configmaps.Exporter = &NamespacesTopicsSubscriptionsRule{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (rule *NamespacesTopicsSubscriptionsRule) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if rule.Spec.OperatorSpec == nil { + return nil + } + return rule.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &NamespacesTopicsSubscriptionsRule{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (rule *NamespacesTopicsSubscriptionsRule) SecretDestinationExpressions() []*core.DestinationExpression { + if rule.Spec.OperatorSpec == nil { + return nil + } + return rule.Spec.OperatorSpec.SecretExpressions +} + +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.(*NamespacesTopicsSubscriptionsRule_STATUS); ok { + return rule.Spec.Initialize_From_NamespacesTopicsSubscriptionsRule_STATUS(s) + } + + return fmt.Errorf("expected Status of type NamespacesTopicsSubscriptionsRule_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 "2024-01-01" +func (rule NamespacesTopicsSubscriptionsRule) GetAPIVersion() string { + return "2024-01-01" +} + +// 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 +} + +// GetSupportedOperations returns the operations supported by the resource +func (rule *NamespacesTopicsSubscriptionsRule) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// 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 &NamespacesTopicsSubscriptionsRule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *NamespacesTopicsSubscriptionsRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return rule.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (rule *NamespacesTopicsSubscriptionsRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*NamespacesTopicsSubscriptionsRule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st NamespacesTopicsSubscriptionsRule_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.Wrap(err, "failed to convert status") + } + + rule.Status = st + return nil +} + +// +kubebuilder:webhook:path=/validate-servicebus-azure-com-v1api20240101-namespacestopicssubscriptionsrule,mutating=false,sideEffects=None,matchPolicy=Exact,failurePolicy=fail,groups=servicebus.azure.com,resources=namespacestopicssubscriptionsrules,verbs=create;update,versions=v1api20240101,name=validate.v1api20240101.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, rule.validateOwnerReference, rule.validateSecretDestinations, rule.validateConfigMapDestinations} +} + +// 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, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateOwnerReference() + }, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateSecretDestinations() + }, + func(old runtime.Object) (admission.Warnings, error) { + return rule.validateConfigMapDestinations() + }, + } +} + +// validateConfigMapDestinations validates there are no colliding genruntime.ConfigMapDestinations +func (rule *NamespacesTopicsSubscriptionsRule) validateConfigMapDestinations() (admission.Warnings, error) { + if rule.Spec.OperatorSpec == nil { + return nil, nil + } + return configmaps.ValidateDestinations(rule, nil, rule.Spec.OperatorSpec.ConfigMapExpressions) +} + +// validateOwnerReference validates the owner field +func (rule *NamespacesTopicsSubscriptionsRule) validateOwnerReference() (admission.Warnings, error) { + return genruntime.ValidateOwner(rule) +} + +// 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) +} + +// validateSecretDestinations validates there are no colliding genruntime.SecretDestination's +func (rule *NamespacesTopicsSubscriptionsRule) validateSecretDestinations() (admission.Warnings, error) { + if rule.Spec.OperatorSpec == nil { + return nil, nil + } + return secrets.ValidateDestinations(rule, nil, rule.Spec.OperatorSpec.SecretExpressions) +} + +// validateWriteOnceProperties validates all WriteOnce properties +func (rule *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 *storage.NamespacesTopicsSubscriptionsRule) error { + + // ObjectMeta + rule.ObjectMeta = *source.ObjectMeta.DeepCopy() + + // Spec + var spec NamespacesTopicsSubscriptionsRule_Spec + err := spec.AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec(&source.Spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec() to populate field Spec") + } + rule.Spec = spec + + // Status + var status NamespacesTopicsSubscriptionsRule_STATUS + err = status.AssignProperties_From_NamespacesTopicsSubscriptionsRule_STATUS(&source.Status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicsSubscriptionsRule_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 *storage.NamespacesTopicsSubscriptionsRule) error { + + // ObjectMeta + destination.ObjectMeta = *rule.ObjectMeta.DeepCopy() + + // Spec + var spec storage.NamespacesTopicsSubscriptionsRule_Spec + err := rule.Spec.AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec(&spec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec() to populate field Spec") + } + destination.Spec = spec + + // Status + var status storage.NamespacesTopicsSubscriptionsRule_STATUS + err = rule.Status.AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS(&status) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicsSubscriptionsRule_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/2024-01-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 NamespacesTopicsSubscriptionsRule_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"` + + // OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not + // passed directly to Azure + OperatorSpec *NamespacesTopicsSubscriptionsRuleOperatorSpec `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/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 = &NamespacesTopicsSubscriptionsRule_Spec{} + +// ConvertToARM converts from a Kubernetes CRD object to an ARM object +func (rule *NamespacesTopicsSubscriptionsRule_Spec) ConvertToARM(resolved genruntime.ConvertToARMResolvedDetails) (interface{}, error) { + if rule == nil { + return nil, nil + } + result := &arm.NamespacesTopicsSubscriptionsRule_Spec{} + + // 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 = &arm.Ruleproperties{} + } + if rule.Action != nil { + action_ARM, err := (*rule.Action).ConvertToARM(resolved) + if err != nil { + return nil, err + } + action := *action_ARM.(*arm.Action) + result.Properties.Action = &action + } + if rule.CorrelationFilter != nil { + correlationFilter_ARM, err := (*rule.CorrelationFilter).ConvertToARM(resolved) + if err != nil { + return nil, err + } + correlationFilter := *correlationFilter_ARM.(*arm.CorrelationFilter) + result.Properties.CorrelationFilter = &correlationFilter + } + if rule.FilterType != nil { + var temp string + temp = string(*rule.FilterType) + filterType := arm.FilterType(temp) + result.Properties.FilterType = &filterType + } + if rule.SqlFilter != nil { + sqlFilter_ARM, err := (*rule.SqlFilter).ConvertToARM(resolved) + if err != nil { + return nil, err + } + sqlFilter := *sqlFilter_ARM.(*arm.SqlFilter) + result.Properties.SqlFilter = &sqlFilter + } + return result, nil +} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *NamespacesTopicsSubscriptionsRule_Spec) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.NamespacesTopicsSubscriptionsRule_Spec{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *NamespacesTopicsSubscriptionsRule_Spec) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.NamespacesTopicsSubscriptionsRule_Spec) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.NamespacesTopicsSubscriptionsRule_Spec, 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 { + var temp string + temp = string(*typedInput.Properties.FilterType) + filterType := FilterType(temp) + rule.FilterType = &filterType + } + } + + // no assignment for property "OperatorSpec" + + // Set property "Owner": + rule.Owner = &genruntime.KnownResourceReference{ + Name: owner.Name, + ARMID: owner.ARMID, + } + + // 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 = &NamespacesTopicsSubscriptionsRule_Spec{} + +// ConvertSpecFrom populates our NamespacesTopicsSubscriptionsRule_Spec from the provided source +func (rule *NamespacesTopicsSubscriptionsRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + src, ok := source.(*storage.NamespacesTopicsSubscriptionsRule_Spec) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesTopicsSubscriptionsRule_Spec{} + err := src.ConvertSpecFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecFrom()") + } + + return nil +} + +// ConvertSpecTo populates the provided destination from our NamespacesTopicsSubscriptionsRule_Spec +func (rule *NamespacesTopicsSubscriptionsRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + dst, ok := destination.(*storage.NamespacesTopicsSubscriptionsRule_Spec) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesTopicsSubscriptionsRule_Spec{} + err := rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertSpecTo()") + } + + // Update dst from our instance + err = dst.ConvertSpecTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertSpecTo()") + } + + return nil +} + +// AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec populates our NamespacesTopicsSubscriptionsRule_Spec from the provided source NamespacesTopicsSubscriptionsRule_Spec +func (rule *NamespacesTopicsSubscriptionsRule_Spec) AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec(source *storage.NamespacesTopicsSubscriptionsRule_Spec) error { + + // Action + if source.Action != nil { + var action Action + err := action.AssignProperties_From_Action(source.Action) + if err != nil { + return eris.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 eris.Wrap(err, "calling AssignProperties_From_CorrelationFilter() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil + } + + // FilterType + if source.FilterType != nil { + filterType := *source.FilterType + filterTypeTemp := genruntime.ToEnum(filterType, filterType_Values) + rule.FilterType = &filterTypeTemp + } else { + rule.FilterType = nil + } + + // OperatorSpec + if source.OperatorSpec != nil { + var operatorSpec NamespacesTopicsSubscriptionsRuleOperatorSpec + err := operatorSpec.AssignProperties_From_NamespacesTopicsSubscriptionsRuleOperatorSpec(source.OperatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_NamespacesTopicsSubscriptionsRuleOperatorSpec() 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 + } + + // SqlFilter + if source.SqlFilter != nil { + var sqlFilter SqlFilter + err := sqlFilter.AssignProperties_From_SqlFilter(source.SqlFilter) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_From_SqlFilter() to populate field SqlFilter") + } + rule.SqlFilter = &sqlFilter + } else { + rule.SqlFilter = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec populates the provided destination NamespacesTopicsSubscriptionsRule_Spec from our NamespacesTopicsSubscriptionsRule_Spec +func (rule *NamespacesTopicsSubscriptionsRule_Spec) AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec(destination *storage.NamespacesTopicsSubscriptionsRule_Spec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Action + if rule.Action != nil { + var action storage.Action + err := rule.Action.AssignProperties_To_Action(&action) + if err != nil { + return eris.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 storage.CorrelationFilter + err := rule.CorrelationFilter.AssignProperties_To_CorrelationFilter(&correlationFilter) + if err != nil { + return eris.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 + } + + // OperatorSpec + if rule.OperatorSpec != nil { + var operatorSpec storage.NamespacesTopicsSubscriptionsRuleOperatorSpec + err := rule.OperatorSpec.AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec(&operatorSpec) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec() 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 + } + + // SqlFilter + if rule.SqlFilter != nil { + var sqlFilter storage.SqlFilter + err := rule.SqlFilter.AssignProperties_To_SqlFilter(&sqlFilter) + if err != nil { + return eris.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_NamespacesTopicsSubscriptionsRule_STATUS populates our NamespacesTopicsSubscriptionsRule_Spec from the provided source NamespacesTopicsSubscriptionsRule_STATUS +func (rule *NamespacesTopicsSubscriptionsRule_Spec) Initialize_From_NamespacesTopicsSubscriptionsRule_STATUS(source *NamespacesTopicsSubscriptionsRule_STATUS) error { + + // Action + if source.Action != nil { + var action Action + err := action.Initialize_From_Action_STATUS(source.Action) + if err != nil { + return eris.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 eris.Wrap(err, "calling Initialize_From_CorrelationFilter_STATUS() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil + } + + // FilterType + if source.FilterType != nil { + filterType := genruntime.ToEnum(string(*source.FilterType), filterType_Values) + 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 eris.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 *NamespacesTopicsSubscriptionsRule_Spec) OriginalVersion() string { + return GroupVersion.Version +} + +// SetAzureName sets the Azure name of the resource +func (rule *NamespacesTopicsSubscriptionsRule_Spec) SetAzureName(azureName string) { + rule.AzureName = azureName +} + +type NamespacesTopicsSubscriptionsRule_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 = &NamespacesTopicsSubscriptionsRule_STATUS{} + +// ConvertStatusFrom populates our NamespacesTopicsSubscriptionsRule_STATUS from the provided source +func (rule *NamespacesTopicsSubscriptionsRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + src, ok := source.(*storage.NamespacesTopicsSubscriptionsRule_STATUS) + if ok { + // Populate our instance from source + return rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule_STATUS(src) + } + + // Convert to an intermediate form + src = &storage.NamespacesTopicsSubscriptionsRule_STATUS{} + err := src.ConvertStatusFrom(source) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusFrom()") + } + + // Update our instance from src + err = rule.AssignProperties_From_NamespacesTopicsSubscriptionsRule_STATUS(src) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusFrom()") + } + + return nil +} + +// ConvertStatusTo populates the provided destination from our NamespacesTopicsSubscriptionsRule_STATUS +func (rule *NamespacesTopicsSubscriptionsRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + dst, ok := destination.(*storage.NamespacesTopicsSubscriptionsRule_STATUS) + if ok { + // Populate destination from our instance + return rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS(dst) + } + + // Convert to an intermediate form + dst = &storage.NamespacesTopicsSubscriptionsRule_STATUS{} + err := rule.AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS(dst) + if err != nil { + return eris.Wrap(err, "initial step of conversion in ConvertStatusTo()") + } + + // Update dst from our instance + err = dst.ConvertStatusTo(destination) + if err != nil { + return eris.Wrap(err, "final step of conversion in ConvertStatusTo()") + } + + return nil +} + +var _ genruntime.FromARMConverter = &NamespacesTopicsSubscriptionsRule_STATUS{} + +// NewEmptyARMValue returns an empty ARM value suitable for deserializing into +func (rule *NamespacesTopicsSubscriptionsRule_STATUS) NewEmptyARMValue() genruntime.ARMResourceStatus { + return &arm.NamespacesTopicsSubscriptionsRule_STATUS{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (rule *NamespacesTopicsSubscriptionsRule_STATUS) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.NamespacesTopicsSubscriptionsRule_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.NamespacesTopicsSubscriptionsRule_STATUS, 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 { + var temp string + temp = string(*typedInput.Properties.FilterType) + filterType := FilterType_STATUS(temp) + 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_NamespacesTopicsSubscriptionsRule_STATUS populates our NamespacesTopicsSubscriptionsRule_STATUS from the provided source NamespacesTopicsSubscriptionsRule_STATUS +func (rule *NamespacesTopicsSubscriptionsRule_STATUS) AssignProperties_From_NamespacesTopicsSubscriptionsRule_STATUS(source *storage.NamespacesTopicsSubscriptionsRule_STATUS) error { + + // Action + if source.Action != nil { + var action Action_STATUS + err := action.AssignProperties_From_Action_STATUS(source.Action) + if err != nil { + return eris.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 eris.Wrap(err, "calling AssignProperties_From_CorrelationFilter_STATUS() to populate field CorrelationFilter") + } + rule.CorrelationFilter = &correlationFilter + } else { + rule.CorrelationFilter = nil + } + + // FilterType + if source.FilterType != nil { + filterType := *source.FilterType + filterTypeTemp := genruntime.ToEnum(filterType, filterType_STATUS_Values) + rule.FilterType = &filterTypeTemp + } 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 eris.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 eris.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_NamespacesTopicsSubscriptionsRule_STATUS populates the provided destination NamespacesTopicsSubscriptionsRule_STATUS from our NamespacesTopicsSubscriptionsRule_STATUS +func (rule *NamespacesTopicsSubscriptionsRule_STATUS) AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS(destination *storage.NamespacesTopicsSubscriptionsRule_STATUS) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // Action + if rule.Action != nil { + var action storage.Action_STATUS + err := rule.Action.AssignProperties_To_Action_STATUS(&action) + if err != nil { + return eris.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 storage.CorrelationFilter_STATUS + err := rule.CorrelationFilter.AssignProperties_To_CorrelationFilter_STATUS(&correlationFilter) + if err != nil { + return eris.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 storage.SqlFilter_STATUS + err := rule.SqlFilter.AssignProperties_To_SqlFilter_STATUS(&sqlFilter) + if err != nil { + return eris.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 storage.SystemData_STATUS + err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum) + if err != nil { + return eris.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData") + } + destination.SystemData = &systemDatum + } else { + destination.SystemData = nil + } + + // 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 := &arm.Action{} + + // 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 &arm.Action{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (action *Action) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.Action) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Action, 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 *storage.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 *storage.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 &arm.Action_STATUS{} +} + +// 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.(arm.Action_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.Action_STATUS, 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 *storage.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 *storage.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 := &arm.CorrelationFilter{} + + // 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 &arm.CorrelationFilter{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (filter *CorrelationFilter) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.CorrelationFilter) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.CorrelationFilter, 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 *storage.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 *storage.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 &arm.CorrelationFilter_STATUS{} +} + +// 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.(arm.CorrelationFilter_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.CorrelationFilter_STATUS, 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 *storage.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 *storage.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") +) + +// Mapping from string to FilterType +var filterType_Values = map[string]FilterType{ + "correlationfilter": FilterType_CorrelationFilter, + "sqlfilter": FilterType_SqlFilter, +} + +// Rule filter types +type FilterType_STATUS string + +const ( + FilterType_STATUS_CorrelationFilter = FilterType_STATUS("CorrelationFilter") + FilterType_STATUS_SqlFilter = FilterType_STATUS("SqlFilter") +) + +// Mapping from string to FilterType_STATUS +var filterType_STATUS_Values = map[string]FilterType_STATUS{ + "correlationfilter": FilterType_STATUS_CorrelationFilter, + "sqlfilter": FilterType_STATUS_SqlFilter, +} + +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesTopicsSubscriptionsRuleOperatorSpec struct { + // ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions). + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + + // SecretExpressions: configures where to place operator written dynamic secrets (created with CEL expressions). + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` +} + +// AssignProperties_From_NamespacesTopicsSubscriptionsRuleOperatorSpec populates our NamespacesTopicsSubscriptionsRuleOperatorSpec from the provided source NamespacesTopicsSubscriptionsRuleOperatorSpec +func (operator *NamespacesTopicsSubscriptionsRuleOperatorSpec) AssignProperties_From_NamespacesTopicsSubscriptionsRuleOperatorSpec(source *storage.NamespacesTopicsSubscriptionsRuleOperatorSpec) error { + + // ConfigMapExpressions + if source.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(source.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range source.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + operator.ConfigMapExpressions = configMapExpressionList + } else { + operator.ConfigMapExpressions = nil + } + + // SecretExpressions + if source.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(source.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range source.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + operator.SecretExpressions = secretExpressionList + } else { + operator.SecretExpressions = nil + } + + // No error + return nil +} + +// AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec populates the provided destination NamespacesTopicsSubscriptionsRuleOperatorSpec from our NamespacesTopicsSubscriptionsRuleOperatorSpec +func (operator *NamespacesTopicsSubscriptionsRuleOperatorSpec) AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec(destination *storage.NamespacesTopicsSubscriptionsRuleOperatorSpec) error { + // Create a new property bag + propertyBag := genruntime.NewPropertyBag() + + // ConfigMapExpressions + if operator.ConfigMapExpressions != nil { + configMapExpressionList := make([]*core.DestinationExpression, len(operator.ConfigMapExpressions)) + for configMapExpressionIndex, configMapExpressionItem := range operator.ConfigMapExpressions { + // Shadow the loop variable to avoid aliasing + configMapExpressionItem := configMapExpressionItem + if configMapExpressionItem != nil { + configMapExpression := *configMapExpressionItem.DeepCopy() + configMapExpressionList[configMapExpressionIndex] = &configMapExpression + } else { + configMapExpressionList[configMapExpressionIndex] = nil + } + } + destination.ConfigMapExpressions = configMapExpressionList + } else { + destination.ConfigMapExpressions = nil + } + + // SecretExpressions + if operator.SecretExpressions != nil { + secretExpressionList := make([]*core.DestinationExpression, len(operator.SecretExpressions)) + for secretExpressionIndex, secretExpressionItem := range operator.SecretExpressions { + // Shadow the loop variable to avoid aliasing + secretExpressionItem := secretExpressionItem + if secretExpressionItem != nil { + secretExpression := *secretExpressionItem.DeepCopy() + secretExpressionList[secretExpressionIndex] = &secretExpression + } else { + secretExpressionList[secretExpressionIndex] = nil + } + } + destination.SecretExpressions = secretExpressionList + } else { + destination.SecretExpressions = nil + } + + // Update the property bag + if len(propertyBag) > 0 { + destination.PropertyBag = propertyBag + } else { + destination.PropertyBag = nil + } + + // No error + return nil +} + +// 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 := &arm.SqlFilter{} + + // 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 &arm.SqlFilter{} +} + +// PopulateFromARM populates a Kubernetes CRD object from an Azure ARM object +func (filter *SqlFilter) PopulateFromARM(owner genruntime.ArbitraryOwnerReference, armInput interface{}) error { + typedInput, ok := armInput.(arm.SqlFilter) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.SqlFilter, 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 *storage.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 *storage.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 &arm.SqlFilter_STATUS{} +} + +// 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.(arm.SqlFilter_STATUS) + if !ok { + return fmt.Errorf("unexpected type supplied for PopulateFromARM() function. Expected arm.SqlFilter_STATUS, 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 *storage.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 *storage.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/v1api20240101/namespaces_topics_subscriptions_rule_types_gen_test.go b/v2/api/servicebus/v1api20240101/namespaces_topics_subscriptions_rule_types_gen_test.go new file mode 100644 index 00000000000..e4c11c22098 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/namespaces_topics_subscriptions_rule_types_gen_test.go @@ -0,0 +1,1151 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package v1api20240101 + +import ( + "encoding/json" + storage "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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 storage 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 storage.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 storage 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 storage.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 storage 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 storage.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 storage 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 storage.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_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 storage.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 storage 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 storage.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"] = NamespacesTopicsSubscriptionsRule_SpecGenerator() + gens["Status"] = NamespacesTopicsSubscriptionsRule_STATUSGenerator() +} + +func Test_NamespacesTopicsSubscriptionsRuleOperatorSpec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscriptionsRuleOperatorSpec to NamespacesTopicsSubscriptionsRuleOperatorSpec via AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec & AssignProperties_From_NamespacesTopicsSubscriptionsRuleOperatorSpec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRuleOperatorSpec, NamespacesTopicsSubscriptionsRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRuleOperatorSpec tests if a specific instance of NamespacesTopicsSubscriptionsRuleOperatorSpec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRuleOperatorSpec(subject NamespacesTopicsSubscriptionsRuleOperatorSpec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicsSubscriptionsRuleOperatorSpec + err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscriptionsRuleOperatorSpec + err = actual.AssignProperties_From_NamespacesTopicsSubscriptionsRuleOperatorSpec(&other) + if err != nil { + return err.Error() + } + + // Check for a match + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +func Test_NamespacesTopicsSubscriptionsRuleOperatorSpec_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 NamespacesTopicsSubscriptionsRuleOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionsRuleOperatorSpec, NamespacesTopicsSubscriptionsRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionsRuleOperatorSpec runs a test to see if a specific instance of NamespacesTopicsSubscriptionsRuleOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionsRuleOperatorSpec(subject NamespacesTopicsSubscriptionsRuleOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionsRuleOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicsSubscriptionsRuleOperatorSpec instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionsRuleOperatorSpecGenerator() +var namespacesTopicsSubscriptionsRuleOperatorSpecGenerator gopter.Gen + +// NamespacesTopicsSubscriptionsRuleOperatorSpecGenerator returns a generator of NamespacesTopicsSubscriptionsRuleOperatorSpec instances for property testing. +func NamespacesTopicsSubscriptionsRuleOperatorSpecGenerator() gopter.Gen { + if namespacesTopicsSubscriptionsRuleOperatorSpecGenerator != nil { + return namespacesTopicsSubscriptionsRuleOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesTopicsSubscriptionsRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRuleOperatorSpec{}), generators) + + return namespacesTopicsSubscriptionsRuleOperatorSpecGenerator +} + +func Test_NamespacesTopicsSubscriptionsRule_STATUS_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscriptionsRule_STATUS to NamespacesTopicsSubscriptionsRule_STATUS via AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS & AssignProperties_From_NamespacesTopicsSubscriptionsRule_STATUS returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_STATUS, NamespacesTopicsSubscriptionsRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_STATUS tests if a specific instance of NamespacesTopicsSubscriptionsRule_STATUS can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_STATUS(subject NamespacesTopicsSubscriptionsRule_STATUS) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicsSubscriptionsRule_STATUS + err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule_STATUS(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscriptionsRule_STATUS + err = actual.AssignProperties_From_NamespacesTopicsSubscriptionsRule_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_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_STATUS, NamespacesTopicsSubscriptionsRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_STATUS runs a test to see if a specific instance of NamespacesTopicsSubscriptionsRule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_STATUS(subject NamespacesTopicsSubscriptionsRule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_STATUS instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionsRule_STATUSGenerator() +var namespacesTopicsSubscriptionsRule_STATUSGenerator gopter.Gen + +// NamespacesTopicsSubscriptionsRule_STATUSGenerator returns a generator of NamespacesTopicsSubscriptionsRule_STATUS instances for property testing. +// We first initialize namespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_STATUSGenerator() gopter.Gen { + if namespacesTopicsSubscriptionsRule_STATUSGenerator != nil { + return namespacesTopicsSubscriptionsRule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS(generators) + namespacesTopicsSubscriptionsRule_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS(generators) + namespacesTopicsSubscriptionsRule_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule_STATUS{}), generators) + + return namespacesTopicsSubscriptionsRule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_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_NamespacesTopicsSubscriptionsRule_Spec_WhenPropertiesConverted_RoundTripsWithoutLoss(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MaxSize = 10 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip from NamespacesTopicsSubscriptionsRule_Spec to NamespacesTopicsSubscriptionsRule_Spec via AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec & AssignProperties_From_NamespacesTopicsSubscriptionsRule_Spec returns original", + prop.ForAll(RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_Spec, NamespacesTopicsSubscriptionsRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(false, 240, os.Stdout)) +} + +// RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_Spec tests if a specific instance of NamespacesTopicsSubscriptionsRule_Spec can be assigned to storage and back losslessly +func RunPropertyAssignmentTestForNamespacesTopicsSubscriptionsRule_Spec(subject NamespacesTopicsSubscriptionsRule_Spec) string { + // Copy subject to make sure assignment doesn't modify it + copied := subject.DeepCopy() + + // Use AssignPropertiesTo() for the first stage of conversion + var other storage.NamespacesTopicsSubscriptionsRule_Spec + err := copied.AssignProperties_To_NamespacesTopicsSubscriptionsRule_Spec(&other) + if err != nil { + return err.Error() + } + + // Use AssignPropertiesFrom() to convert back to our original type + var actual NamespacesTopicsSubscriptionsRule_Spec + err = actual.AssignProperties_From_NamespacesTopicsSubscriptionsRule_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_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_Spec, NamespacesTopicsSubscriptionsRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_Spec runs a test to see if a specific instance of NamespacesTopicsSubscriptionsRule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_Spec(subject NamespacesTopicsSubscriptionsRule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_Spec instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionsRule_SpecGenerator() +var namespacesTopicsSubscriptionsRule_SpecGenerator gopter.Gen + +// NamespacesTopicsSubscriptionsRule_SpecGenerator returns a generator of NamespacesTopicsSubscriptionsRule_Spec instances for property testing. +// We first initialize namespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_SpecGenerator() gopter.Gen { + if namespacesTopicsSubscriptionsRule_SpecGenerator != nil { + return namespacesTopicsSubscriptionsRule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(generators) + namespacesTopicsSubscriptionsRule_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(generators) + namespacesTopicsSubscriptionsRule_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule_Spec{}), generators) + + return namespacesTopicsSubscriptionsRule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["FilterType"] = gen.PtrOf(gen.OneConstOf(FilterType_CorrelationFilter, FilterType_SqlFilter)) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(ActionGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilterGenerator()) + gens["OperatorSpec"] = gen.PtrOf(NamespacesTopicsSubscriptionsRuleOperatorSpecGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilterGenerator()) +} + +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 storage 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 storage.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 storage 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 storage.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/v1api20240101/storage/groupversion_info_gen.go b/v2/api/servicebus/v1api20240101/storage/groupversion_info_gen.go new file mode 100644 index 00000000000..829f0640961 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/groupversion_info_gen.go @@ -0,0 +1,32 @@ +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by azure-service-operator-codegen. DO NOT EDIT. + +// Package storage contains API Schema definitions for the servicebus storage 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 +// +versionName=v1api20240101storage +package storage + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "servicebus.azure.com", Version: "v1api20240101storage"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme + + localSchemeBuilder = SchemeBuilder.SchemeBuilder +) diff --git a/v2/api/servicebus/v1api20240101/storage/namespace_types_gen.go b/v2/api/servicebus/v1api20240101/storage/namespace_types_gen.go new file mode 100644 index 00000000000..76b9bb75ac6 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/namespace_types_gen.go @@ -0,0 +1,413 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=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 v1api20240101.Namespace +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 _ configmaps.Exporter = &Namespace{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (namespace *Namespace) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if namespace.Spec.OperatorSpec == nil { + return nil + } + return namespace.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &Namespace{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (namespace *Namespace) SecretDestinationExpressions() []*core.DestinationExpression { + if namespace.Spec.OperatorSpec == nil { + return nil + } + return namespace.Spec.OperatorSpec.SecretExpressions +} + +var _ genruntime.KubernetesResource = &Namespace{} + +// AzureName returns the Azure name of the resource +func (namespace *Namespace) AzureName() string { + return namespace.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (namespace Namespace) GetAPIVersion() string { + return "2024-01-01" +} + +// GetResourceScope returns the scope of the resource +func (namespace *Namespace) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (namespace *Namespace) GetSpec() genruntime.ConvertibleSpec { + return &namespace.Spec +} + +// GetStatus returns the status of this resource +func (namespace *Namespace) GetStatus() genruntime.ConvertibleStatus { + return &namespace.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (namespace *Namespace) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.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 { + if namespace.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(namespace.Spec) + return namespace.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (namespace *Namespace) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*Namespace_STATUS); ok { + namespace.Status = *st + return nil + } + + // Convert status to required version + var st Namespace_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.Wrap(err, "failed to convert status") + } + + namespace.Status = st + return nil +} + +// Hub marks that this Namespace is the hub type for conversion +func (namespace *Namespace) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (namespace *Namespace) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: namespace.Spec.OriginalVersion, + Kind: "Namespace", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20240101.Namespace +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 v1api20240101.APIVersion +// +kubebuilder:validation:Enum={"2024-01-01"} +type APIVersion string + +const APIVersion_Value = APIVersion("2024-01-01") + +// Storage version of v1api20240101.Namespace_Spec +type Namespace_Spec struct { + AlternateName *string `json:"alternateName,omitempty"` + + // AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it + // doesn't have to be. + AzureName string `json:"azureName,omitempty"` + 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 { + if source == namespace { + return eris.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 eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(namespace) +} + +// Storage version of v1api20240101.Namespace_STATUS +type Namespace_STATUS struct { + AlternateName *string `json:"alternateName,omitempty"` + 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 { + if source == namespace { + return eris.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 eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(namespace) +} + +// Storage version of v1api20240101.Encryption +// Properties to configure Encryption +type Encryption struct { + KeySource *string `json:"keySource,omitempty"` + KeyVaultProperties []KeyVaultProperties `json:"keyVaultProperties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` +} + +// Storage version of v1api20240101.Encryption_STATUS +// Properties to configure Encryption +type Encryption_STATUS struct { + KeySource *string `json:"keySource,omitempty"` + KeyVaultProperties []KeyVaultProperties_STATUS `json:"keyVaultProperties,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` +} + +// Storage version of v1api20240101.Identity +// Properties to configure 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 v1api20240101.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 v1api20240101.NamespaceOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespaceOperatorSpec struct { + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` + Secrets *NamespaceOperatorSecrets `json:"secrets,omitempty"` +} + +// Storage version of v1api20240101.PrivateEndpointConnection_STATUS +// Properties of the PrivateEndpointConnection. +type PrivateEndpointConnection_STATUS struct { + Id *string `json:"id,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20240101.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 v1api20240101.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 v1api20240101.SystemData_STATUS +// Metadata pertaining to creation and last modification of the resource. +type SystemData_STATUS struct { + CreatedAt *string `json:"createdAt,omitempty"` + CreatedBy *string `json:"createdBy,omitempty"` + CreatedByType *string `json:"createdByType,omitempty"` + LastModifiedAt *string `json:"lastModifiedAt,omitempty"` + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + LastModifiedByType *string `json:"lastModifiedByType,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20240101.KeyVaultProperties +// Properties to configure keyVault Properties +type KeyVaultProperties struct { + Identity *UserAssignedIdentityProperties `json:"identity,omitempty"` + KeyName *string `json:"keyName,omitempty"` + KeyVaultUri *string `json:"keyVaultUri,omitempty"` + KeyVersion *string `json:"keyVersion,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20240101.KeyVaultProperties_STATUS +// Properties to configure keyVault Properties +type KeyVaultProperties_STATUS struct { + Identity *UserAssignedIdentityProperties_STATUS `json:"identity,omitempty"` + KeyName *string `json:"keyName,omitempty"` + KeyVaultUri *string `json:"keyVaultUri,omitempty"` + KeyVersion *string `json:"keyVersion,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20240101.NamespaceOperatorSecrets +type NamespaceOperatorSecrets struct { + 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 v1api20240101.UserAssignedIdentity_STATUS +// Recognized Dictionary value. +type UserAssignedIdentity_STATUS struct { + ClientId *string `json:"clientId,omitempty"` + PrincipalId *string `json:"principalId,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` +} + +// Storage version of v1api20240101.UserAssignedIdentityDetails +// Information about the user assigned identity for the resource +type UserAssignedIdentityDetails struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + Reference genruntime.ResourceReference `armReference:"Reference" json:"reference,omitempty"` +} + +// Storage version of v1api20240101.UserAssignedIdentityProperties +type UserAssignedIdentityProperties struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + + // UserAssignedIdentityReference: ARM ID of user Identity selected for encryption + UserAssignedIdentityReference *genruntime.ResourceReference `armReference:"UserAssignedIdentity" json:"userAssignedIdentityReference,omitempty"` +} + +// Storage version of v1api20240101.UserAssignedIdentityProperties_STATUS +type UserAssignedIdentityProperties_STATUS struct { + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +func init() { + SchemeBuilder.Register(&Namespace{}, &NamespaceList{}) +} diff --git a/v2/api/servicebus/v1api20240101/storage/namespace_types_gen_test.go b/v2/api/servicebus/v1api20240101/storage/namespace_types_gen_test.go new file mode 100644 index 00000000000..ad9cf3bff33 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/namespace_types_gen_test.go @@ -0,0 +1,1317 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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_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_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_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_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_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_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_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_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()) +} + +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()) +} diff --git a/v2/api/servicebus/v1api20240101/storage/namespaces_authorization_rule_types_gen.go b/v2/api/servicebus/v1api20240101/storage/namespaces_authorization_rule_types_gen.go new file mode 100644 index 00000000000..8710243b39f --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/namespaces_authorization_rule_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 storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=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 v1api20240101.NamespacesAuthorizationRule +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 NamespacesAuthorizationRule_Spec `json:"spec,omitempty"` + Status NamespacesAuthorizationRule_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 _ configmaps.Exporter = &NamespacesAuthorizationRule{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (rule *NamespacesAuthorizationRule) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if rule.Spec.OperatorSpec == nil { + return nil + } + return rule.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &NamespacesAuthorizationRule{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (rule *NamespacesAuthorizationRule) SecretDestinationExpressions() []*core.DestinationExpression { + if rule.Spec.OperatorSpec == nil { + return nil + } + return rule.Spec.OperatorSpec.SecretExpressions +} + +var _ genruntime.KubernetesResource = &NamespacesAuthorizationRule{} + +// AzureName returns the Azure name of the resource +func (rule *NamespacesAuthorizationRule) AzureName() string { + return rule.Spec.AzureName +} + +// GetAPIVersion returns the ARM API version of the resource. This is always "2024-01-01" +func (rule NamespacesAuthorizationRule) GetAPIVersion() string { + return "2024-01-01" +} + +// GetResourceScope returns the scope of the resource +func (rule *NamespacesAuthorizationRule) GetResourceScope() genruntime.ResourceScope { + return genruntime.ResourceScopeResourceGroup +} + +// GetSpec returns the specification of this resource +func (rule *NamespacesAuthorizationRule) GetSpec() genruntime.ConvertibleSpec { + return &rule.Spec +} + +// GetStatus returns the status of this resource +func (rule *NamespacesAuthorizationRule) GetStatus() genruntime.ConvertibleStatus { + return &rule.Status +} + +// GetSupportedOperations returns the operations supported by the resource +func (rule *NamespacesAuthorizationRule) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// GetType returns the ARM Type of the resource. This is always "Microsoft.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 &NamespacesAuthorizationRule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return rule.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (rule *NamespacesAuthorizationRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*NamespacesAuthorizationRule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st NamespacesAuthorizationRule_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.Wrap(err, "failed to convert status") + } + + rule.Status = st + return nil +} + +// Hub marks that this NamespacesAuthorizationRule is the hub type for conversion +func (rule *NamespacesAuthorizationRule) Hub() {} + +// OriginalGVK returns a GroupValueKind for the original API version used to create the resource +func (rule *NamespacesAuthorizationRule) OriginalGVK() *schema.GroupVersionKind { + return &schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: rule.Spec.OriginalVersion, + Kind: "NamespacesAuthorizationRule", + } +} + +// +kubebuilder:object:root=true +// Storage version of v1api20240101.NamespacesAuthorizationRule +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 v1api20240101.NamespacesAuthorizationRule_Spec +type NamespacesAuthorizationRule_Spec struct { + // AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it + // doesn't have to be. + AzureName string `json:"azureName,omitempty"` + OperatorSpec *NamespacesAuthorizationRuleOperatorSpec `json:"operatorSpec,omitempty"` + OriginalVersion string `json:"originalVersion,omitempty"` + + // +kubebuilder:validation:Required + // Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also + // controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a + // reference to a 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 = &NamespacesAuthorizationRule_Spec{} + +// ConvertSpecFrom populates our NamespacesAuthorizationRule_Spec from the provided source +func (rule *NamespacesAuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == rule { + return eris.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 NamespacesAuthorizationRule_Spec +func (rule *NamespacesAuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == rule { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(rule) +} + +// Storage version of v1api20240101.NamespacesAuthorizationRule_STATUS +type NamespacesAuthorizationRule_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 = &NamespacesAuthorizationRule_STATUS{} + +// ConvertStatusFrom populates our NamespacesAuthorizationRule_STATUS from the provided source +func (rule *NamespacesAuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == rule { + return eris.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 NamespacesAuthorizationRule_STATUS +func (rule *NamespacesAuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == rule { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(rule) +} + +// Storage version of v1api20240101.NamespacesAuthorizationRuleOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesAuthorizationRuleOperatorSpec struct { + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` + Secrets *NamespacesAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"` +} + +// Storage version of v1api20240101.NamespacesAuthorizationRuleOperatorSecrets +type NamespacesAuthorizationRuleOperatorSecrets struct { + PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"` + PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"` + SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"` +} + +func init() { + SchemeBuilder.Register(&NamespacesAuthorizationRule{}, &NamespacesAuthorizationRuleList{}) +} diff --git a/v2/api/servicebus/v1api20240101/storage/namespaces_authorization_rule_types_gen_test.go b/v2/api/servicebus/v1api20240101/storage/namespaces_authorization_rule_types_gen_test.go new file mode 100644 index 00000000000..ba52d02d54b --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/namespaces_authorization_rule_types_gen_test.go @@ -0,0 +1,352 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_NamespacesAuthorizationRule_WhenSerializedToJson_DeserializesAsEqual(t *testing.T) { + t.Parallel() + parameters := gopter.DefaultTestParameters() + parameters.MinSuccessfulTests = 20 + parameters.MaxSize = 3 + properties := gopter.NewProperties(parameters) + properties.Property( + "Round trip of NamespacesAuthorizationRule via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRule, NamespacesAuthorizationRuleGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRule runs a test to see if a specific instance of NamespacesAuthorizationRule round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRule(subject NamespacesAuthorizationRule) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRule + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesAuthorizationRule instances for property testing - lazily instantiated by +// NamespacesAuthorizationRuleGenerator() +var namespacesAuthorizationRuleGenerator gopter.Gen + +// NamespacesAuthorizationRuleGenerator returns a generator of NamespacesAuthorizationRule instances for property testing. +func NamespacesAuthorizationRuleGenerator() gopter.Gen { + if namespacesAuthorizationRuleGenerator != nil { + return namespacesAuthorizationRuleGenerator + } + + generators := make(map[string]gopter.Gen) + AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule(generators) + namespacesAuthorizationRuleGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule{}), generators) + + return namespacesAuthorizationRuleGenerator +} + +// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule(gens map[string]gopter.Gen) { + gens["Spec"] = NamespacesAuthorizationRule_SpecGenerator() + gens["Status"] = NamespacesAuthorizationRule_STATUSGenerator() +} + +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 +} + +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_NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRule_STATUS, NamespacesAuthorizationRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRule_STATUS runs a test to see if a specific instance of NamespacesAuthorizationRule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRule_STATUS(subject NamespacesAuthorizationRule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_STATUS instances for property testing - lazily instantiated by +// NamespacesAuthorizationRule_STATUSGenerator() +var namespacesAuthorizationRule_STATUSGenerator gopter.Gen + +// NamespacesAuthorizationRule_STATUSGenerator returns a generator of NamespacesAuthorizationRule_STATUS instances for property testing. +// We first initialize namespacesAuthorizationRule_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 NamespacesAuthorizationRule_STATUSGenerator() gopter.Gen { + if namespacesAuthorizationRule_STATUSGenerator != nil { + return namespacesAuthorizationRule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_STATUS(generators) + namespacesAuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_STATUS(generators) + namespacesAuthorizationRule_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule_STATUS{}), generators) + + return namespacesAuthorizationRule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_STATUS(gens map[string]gopter.Gen) { + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesAuthorizationRule_Spec, NamespacesAuthorizationRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesAuthorizationRule_Spec runs a test to see if a specific instance of NamespacesAuthorizationRule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesAuthorizationRule_Spec(subject NamespacesAuthorizationRule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_Spec instances for property testing - lazily instantiated by +// NamespacesAuthorizationRule_SpecGenerator() +var namespacesAuthorizationRule_SpecGenerator gopter.Gen + +// NamespacesAuthorizationRule_SpecGenerator returns a generator of NamespacesAuthorizationRule_Spec instances for property testing. +// We first initialize namespacesAuthorizationRule_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 NamespacesAuthorizationRule_SpecGenerator() gopter.Gen { + if namespacesAuthorizationRule_SpecGenerator != nil { + return namespacesAuthorizationRule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_Spec(generators) + namespacesAuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_Spec(generators) + namespacesAuthorizationRule_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesAuthorizationRule_Spec{}), generators) + + return namespacesAuthorizationRule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesAuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["OriginalVersion"] = gen.AlphaString() + gens["Rights"] = gen.SliceOf(gen.AlphaString()) +} + +// AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesAuthorizationRule_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesAuthorizationRuleOperatorSpecGenerator()) +} diff --git a/v2/api/servicebus/v1api20240101/storage/namespaces_queue_types_gen.go b/v2/api/servicebus/v1api20240101/storage/namespaces_queue_types_gen.go new file mode 100644 index 00000000000..47eb57bba8d --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/namespaces_queue_types_gen.go @@ -0,0 +1,294 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=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 v1api20240101.NamespacesQueue +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 NamespacesQueue_Spec `json:"spec,omitempty"` + Status NamespacesQueue_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 _ configmaps.Exporter = &NamespacesQueue{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (queue *NamespacesQueue) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if queue.Spec.OperatorSpec == nil { + return nil + } + return queue.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &NamespacesQueue{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (queue *NamespacesQueue) SecretDestinationExpressions() []*core.DestinationExpression { + if queue.Spec.OperatorSpec == nil { + return nil + } + return queue.Spec.OperatorSpec.SecretExpressions +} + +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 "2024-01-01" +func (queue NamespacesQueue) GetAPIVersion() string { + return "2024-01-01" +} + +// 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 +} + +// GetSupportedOperations returns the operations supported by the resource +func (queue *NamespacesQueue) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// 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 &NamespacesQueue_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (queue *NamespacesQueue) Owner() *genruntime.ResourceReference { + if queue.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(queue.Spec) + return queue.Spec.Owner.AsResourceReference(group, kind) +} + +// 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.(*NamespacesQueue_STATUS); ok { + queue.Status = *st + return nil + } + + // Convert status to required version + var st NamespacesQueue_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.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 v1api20240101.NamespacesQueue +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 v1api20240101.NamespacesQueue_Spec +type NamespacesQueue_Spec struct { + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,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"` + 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"` + OperatorSpec *NamespacesQueueOperatorSpec `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"` + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + RequiresSession *bool `json:"requiresSession,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &NamespacesQueue_Spec{} + +// ConvertSpecFrom populates our NamespacesQueue_Spec from the provided source +func (queue *NamespacesQueue_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == queue { + return eris.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 NamespacesQueue_Spec +func (queue *NamespacesQueue_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == queue { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(queue) +} + +// Storage version of v1api20240101.NamespacesQueue_STATUS +type NamespacesQueue_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 = &NamespacesQueue_STATUS{} + +// ConvertStatusFrom populates our NamespacesQueue_STATUS from the provided source +func (queue *NamespacesQueue_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == queue { + return eris.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 NamespacesQueue_STATUS +func (queue *NamespacesQueue_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == queue { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(queue) +} + +// Storage version of v1api20240101.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"` +} + +// Storage version of v1api20240101.NamespacesQueueOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesQueueOperatorSpec struct { + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` +} + +func init() { + SchemeBuilder.Register(&NamespacesQueue{}, &NamespacesQueueList{}) +} diff --git a/v2/api/servicebus/v1api20240101/storage/namespaces_queue_types_gen_test.go b/v2/api/servicebus/v1api20240101/storage/namespaces_queue_types_gen_test.go new file mode 100644 index 00000000000..040f02b9e2e --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/namespaces_queue_types_gen_test.go @@ -0,0 +1,390 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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()) +} + +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"] = NamespacesQueue_SpecGenerator() + gens["Status"] = NamespacesQueue_STATUSGenerator() +} + +func Test_NamespacesQueueOperatorSpec_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 NamespacesQueueOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesQueueOperatorSpec, NamespacesQueueOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesQueueOperatorSpec runs a test to see if a specific instance of NamespacesQueueOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesQueueOperatorSpec(subject NamespacesQueueOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesQueueOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesQueueOperatorSpec instances for property testing - lazily instantiated by +// NamespacesQueueOperatorSpecGenerator() +var namespacesQueueOperatorSpecGenerator gopter.Gen + +// NamespacesQueueOperatorSpecGenerator returns a generator of NamespacesQueueOperatorSpec instances for property testing. +func NamespacesQueueOperatorSpecGenerator() gopter.Gen { + if namespacesQueueOperatorSpecGenerator != nil { + return namespacesQueueOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesQueueOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesQueueOperatorSpec{}), generators) + + return namespacesQueueOperatorSpecGenerator +} + +func Test_NamespacesQueue_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 NamespacesQueue_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesQueue_STATUS, NamespacesQueue_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesQueue_STATUS runs a test to see if a specific instance of NamespacesQueue_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesQueue_STATUS(subject NamespacesQueue_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesQueue_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 NamespacesQueue_STATUS instances for property testing - lazily instantiated by +// NamespacesQueue_STATUSGenerator() +var namespacesQueue_STATUSGenerator gopter.Gen + +// NamespacesQueue_STATUSGenerator returns a generator of NamespacesQueue_STATUS instances for property testing. +// We first initialize namespacesQueue_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 NamespacesQueue_STATUSGenerator() gopter.Gen { + if namespacesQueue_STATUSGenerator != nil { + return namespacesQueue_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesQueue_STATUS(generators) + namespacesQueue_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesQueue_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesQueue_STATUS(generators) + namespacesQueue_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue_STATUS{}), generators) + + return namespacesQueue_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesQueue_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesQueue_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesQueue_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesQueue_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_NamespacesQueue_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 NamespacesQueue_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesQueue_Spec, NamespacesQueue_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesQueue_Spec runs a test to see if a specific instance of NamespacesQueue_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesQueue_Spec(subject NamespacesQueue_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesQueue_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 NamespacesQueue_Spec instances for property testing - lazily instantiated by +// NamespacesQueue_SpecGenerator() +var namespacesQueue_SpecGenerator gopter.Gen + +// NamespacesQueue_SpecGenerator returns a generator of NamespacesQueue_Spec instances for property testing. +// We first initialize namespacesQueue_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 NamespacesQueue_SpecGenerator() gopter.Gen { + if namespacesQueue_SpecGenerator != nil { + return namespacesQueue_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesQueue_Spec(generators) + namespacesQueue_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesQueue_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesQueue_Spec(generators) + namespacesQueue_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesQueue_Spec{}), generators) + + return namespacesQueue_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesQueue_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesQueue_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesQueue_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesQueue_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesQueueOperatorSpecGenerator()) +} diff --git a/v2/api/servicebus/v1api20240101/storage/namespaces_topic_types_gen.go b/v2/api/servicebus/v1api20240101/storage/namespaces_topic_types_gen.go new file mode 100644 index 00000000000..7e0c5554e22 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/namespaces_topic_types_gen.go @@ -0,0 +1,273 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=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 v1api20240101.NamespacesTopic +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 NamespacesTopic_Spec `json:"spec,omitempty"` + Status NamespacesTopic_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 _ configmaps.Exporter = &NamespacesTopic{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (topic *NamespacesTopic) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if topic.Spec.OperatorSpec == nil { + return nil + } + return topic.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &NamespacesTopic{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (topic *NamespacesTopic) SecretDestinationExpressions() []*core.DestinationExpression { + if topic.Spec.OperatorSpec == nil { + return nil + } + return topic.Spec.OperatorSpec.SecretExpressions +} + +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 "2024-01-01" +func (topic NamespacesTopic) GetAPIVersion() string { + return "2024-01-01" +} + +// 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 +} + +// GetSupportedOperations returns the operations supported by the resource +func (topic *NamespacesTopic) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// 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 &NamespacesTopic_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (topic *NamespacesTopic) Owner() *genruntime.ResourceReference { + if topic.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(topic.Spec) + return topic.Spec.Owner.AsResourceReference(group, kind) +} + +// 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.(*NamespacesTopic_STATUS); ok { + topic.Status = *st + return nil + } + + // Convert status to required version + var st NamespacesTopic_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.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 v1api20240101.NamespacesTopic +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 v1api20240101.NamespacesTopic_Spec +type NamespacesTopic_Spec struct { + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,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"` + 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"` + OperatorSpec *NamespacesTopicOperatorSpec `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"` + RequiresDuplicateDetection *bool `json:"requiresDuplicateDetection,omitempty"` + SupportOrdering *bool `json:"supportOrdering,omitempty"` +} + +var _ genruntime.ConvertibleSpec = &NamespacesTopic_Spec{} + +// ConvertSpecFrom populates our NamespacesTopic_Spec from the provided source +func (topic *NamespacesTopic_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == topic { + return eris.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 NamespacesTopic_Spec +func (topic *NamespacesTopic_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == topic { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(topic) +} + +// Storage version of v1api20240101.NamespacesTopic_STATUS +type NamespacesTopic_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 = &NamespacesTopic_STATUS{} + +// ConvertStatusFrom populates our NamespacesTopic_STATUS from the provided source +func (topic *NamespacesTopic_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == topic { + return eris.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 NamespacesTopic_STATUS +func (topic *NamespacesTopic_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == topic { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(topic) +} + +// Storage version of v1api20240101.NamespacesTopicOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesTopicOperatorSpec struct { + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` +} + +func init() { + SchemeBuilder.Register(&NamespacesTopic{}, &NamespacesTopicList{}) +} diff --git a/v2/api/servicebus/v1api20240101/storage/namespaces_topic_types_gen_test.go b/v2/api/servicebus/v1api20240101/storage/namespaces_topic_types_gen_test.go new file mode 100644 index 00000000000..a9bde2ff7b6 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/namespaces_topic_types_gen_test.go @@ -0,0 +1,315 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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"] = NamespacesTopic_SpecGenerator() + gens["Status"] = NamespacesTopic_STATUSGenerator() +} + +func Test_NamespacesTopicOperatorSpec_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 NamespacesTopicOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicOperatorSpec, NamespacesTopicOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicOperatorSpec runs a test to see if a specific instance of NamespacesTopicOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicOperatorSpec(subject NamespacesTopicOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicOperatorSpec instances for property testing - lazily instantiated by +// NamespacesTopicOperatorSpecGenerator() +var namespacesTopicOperatorSpecGenerator gopter.Gen + +// NamespacesTopicOperatorSpecGenerator returns a generator of NamespacesTopicOperatorSpec instances for property testing. +func NamespacesTopicOperatorSpecGenerator() gopter.Gen { + if namespacesTopicOperatorSpecGenerator != nil { + return namespacesTopicOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesTopicOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicOperatorSpec{}), generators) + + return namespacesTopicOperatorSpecGenerator +} + +func Test_NamespacesTopic_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 NamespacesTopic_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopic_STATUS, NamespacesTopic_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopic_STATUS runs a test to see if a specific instance of NamespacesTopic_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopic_STATUS(subject NamespacesTopic_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopic_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 NamespacesTopic_STATUS instances for property testing - lazily instantiated by +// NamespacesTopic_STATUSGenerator() +var namespacesTopic_STATUSGenerator gopter.Gen + +// NamespacesTopic_STATUSGenerator returns a generator of NamespacesTopic_STATUS instances for property testing. +// We first initialize namespacesTopic_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 NamespacesTopic_STATUSGenerator() gopter.Gen { + if namespacesTopic_STATUSGenerator != nil { + return namespacesTopic_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopic_STATUS(generators) + namespacesTopic_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopic_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesTopic_STATUS(generators) + namespacesTopic_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic_STATUS{}), generators) + + return namespacesTopic_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopic_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopic_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopic_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopic_STATUS(gens map[string]gopter.Gen) { + gens["CountDetails"] = gen.PtrOf(MessageCountDetails_STATUSGenerator()) + gens["SystemData"] = gen.PtrOf(SystemData_STATUSGenerator()) +} + +func Test_NamespacesTopic_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 NamespacesTopic_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopic_Spec, NamespacesTopic_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopic_Spec runs a test to see if a specific instance of NamespacesTopic_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopic_Spec(subject NamespacesTopic_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopic_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 NamespacesTopic_Spec instances for property testing - lazily instantiated by +// NamespacesTopic_SpecGenerator() +var namespacesTopic_SpecGenerator gopter.Gen + +// NamespacesTopic_SpecGenerator returns a generator of NamespacesTopic_Spec instances for property testing. +// We first initialize namespacesTopic_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 NamespacesTopic_SpecGenerator() gopter.Gen { + if namespacesTopic_SpecGenerator != nil { + return namespacesTopic_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopic_Spec(generators) + namespacesTopic_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopic_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesTopic_Spec(generators) + namespacesTopic_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopic_Spec{}), generators) + + return namespacesTopic_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopic_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopic_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopic_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopic_Spec(gens map[string]gopter.Gen) { + gens["OperatorSpec"] = gen.PtrOf(NamespacesTopicOperatorSpecGenerator()) +} diff --git a/v2/api/servicebus/v1api20240101/storage/namespaces_topics_subscription_types_gen.go b/v2/api/servicebus/v1api20240101/storage/namespaces_topics_subscription_types_gen.go new file mode 100644 index 00000000000..c8444863305 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/namespaces_topics_subscription_types_gen.go @@ -0,0 +1,296 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=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 v1api20240101.NamespacesTopicsSubscription +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 NamespacesTopicsSubscription_Spec `json:"spec,omitempty"` + Status NamespacesTopicsSubscription_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 _ configmaps.Exporter = &NamespacesTopicsSubscription{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (subscription *NamespacesTopicsSubscription) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if subscription.Spec.OperatorSpec == nil { + return nil + } + return subscription.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &NamespacesTopicsSubscription{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (subscription *NamespacesTopicsSubscription) SecretDestinationExpressions() []*core.DestinationExpression { + if subscription.Spec.OperatorSpec == nil { + return nil + } + return subscription.Spec.OperatorSpec.SecretExpressions +} + +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 "2024-01-01" +func (subscription NamespacesTopicsSubscription) GetAPIVersion() string { + return "2024-01-01" +} + +// 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 +} + +// GetSupportedOperations returns the operations supported by the resource +func (subscription *NamespacesTopicsSubscription) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// 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 &NamespacesTopicsSubscription_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (subscription *NamespacesTopicsSubscription) Owner() *genruntime.ResourceReference { + if subscription.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(subscription.Spec) + return subscription.Spec.Owner.AsResourceReference(group, kind) +} + +// 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.(*NamespacesTopicsSubscription_STATUS); ok { + subscription.Status = *st + return nil + } + + // Convert status to required version + var st NamespacesTopicsSubscription_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.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 v1api20240101.NamespacesTopicsSubscription +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 v1api20240101.NamespacesTopicsSubscription_Spec +type NamespacesTopicsSubscription_Spec struct { + AutoDeleteOnIdle *string `json:"autoDeleteOnIdle,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"` + 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"` + OperatorSpec *NamespacesTopicsSubscriptionOperatorSpec `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/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 = &NamespacesTopicsSubscription_Spec{} + +// ConvertSpecFrom populates our NamespacesTopicsSubscription_Spec from the provided source +func (subscription *NamespacesTopicsSubscription_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == subscription { + return eris.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 NamespacesTopicsSubscription_Spec +func (subscription *NamespacesTopicsSubscription_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == subscription { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(subscription) +} + +// Storage version of v1api20240101.NamespacesTopicsSubscription_STATUS +type NamespacesTopicsSubscription_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 = &NamespacesTopicsSubscription_STATUS{} + +// ConvertStatusFrom populates our NamespacesTopicsSubscription_STATUS from the provided source +func (subscription *NamespacesTopicsSubscription_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == subscription { + return eris.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 NamespacesTopicsSubscription_STATUS +func (subscription *NamespacesTopicsSubscription_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == subscription { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(subscription) +} + +// Storage version of v1api20240101.NamespacesTopicsSubscriptionOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesTopicsSubscriptionOperatorSpec struct { + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` +} + +// Storage version of v1api20240101.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 v1api20240101.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/v1api20240101/storage/namespaces_topics_subscription_types_gen_test.go b/v2/api/servicebus/v1api20240101/storage/namespaces_topics_subscription_types_gen_test.go new file mode 100644 index 00000000000..b93cfa1ccc6 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/namespaces_topics_subscription_types_gen_test.go @@ -0,0 +1,447 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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"] = NamespacesTopicsSubscription_SpecGenerator() + gens["Status"] = NamespacesTopicsSubscription_STATUSGenerator() +} + +func Test_NamespacesTopicsSubscriptionOperatorSpec_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 NamespacesTopicsSubscriptionOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionOperatorSpec, NamespacesTopicsSubscriptionOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionOperatorSpec runs a test to see if a specific instance of NamespacesTopicsSubscriptionOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionOperatorSpec(subject NamespacesTopicsSubscriptionOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicsSubscriptionOperatorSpec instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionOperatorSpecGenerator() +var namespacesTopicsSubscriptionOperatorSpecGenerator gopter.Gen + +// NamespacesTopicsSubscriptionOperatorSpecGenerator returns a generator of NamespacesTopicsSubscriptionOperatorSpec instances for property testing. +func NamespacesTopicsSubscriptionOperatorSpecGenerator() gopter.Gen { + if namespacesTopicsSubscriptionOperatorSpecGenerator != nil { + return namespacesTopicsSubscriptionOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesTopicsSubscriptionOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionOperatorSpec{}), generators) + + return namespacesTopicsSubscriptionOperatorSpecGenerator +} + +func Test_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscription_STATUS, NamespacesTopicsSubscription_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscription_STATUS runs a test to see if a specific instance of NamespacesTopicsSubscription_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscription_STATUS(subject NamespacesTopicsSubscription_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_STATUS instances for property testing - lazily instantiated by +// NamespacesTopicsSubscription_STATUSGenerator() +var namespacesTopicsSubscription_STATUSGenerator gopter.Gen + +// NamespacesTopicsSubscription_STATUSGenerator returns a generator of NamespacesTopicsSubscription_STATUS instances for property testing. +// We first initialize namespacesTopicsSubscription_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 NamespacesTopicsSubscription_STATUSGenerator() gopter.Gen { + if namespacesTopicsSubscription_STATUSGenerator != nil { + return namespacesTopicsSubscription_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_STATUS(generators) + namespacesTopicsSubscription_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_STATUS(generators) + namespacesTopicsSubscription_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription_STATUS{}), generators) + + return namespacesTopicsSubscription_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_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_NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscription_Spec, NamespacesTopicsSubscription_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscription_Spec runs a test to see if a specific instance of NamespacesTopicsSubscription_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscription_Spec(subject NamespacesTopicsSubscription_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_Spec instances for property testing - lazily instantiated by +// NamespacesTopicsSubscription_SpecGenerator() +var namespacesTopicsSubscription_SpecGenerator gopter.Gen + +// NamespacesTopicsSubscription_SpecGenerator returns a generator of NamespacesTopicsSubscription_Spec instances for property testing. +// We first initialize namespacesTopicsSubscription_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 NamespacesTopicsSubscription_SpecGenerator() gopter.Gen { + if namespacesTopicsSubscription_SpecGenerator != nil { + return namespacesTopicsSubscription_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_Spec(generators) + namespacesTopicsSubscription_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_Spec(generators) + namespacesTopicsSubscription_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscription_Spec{}), generators) + + return namespacesTopicsSubscription_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopicsSubscription_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscription_Spec(gens map[string]gopter.Gen) { + gens["ClientAffineProperties"] = gen.PtrOf(SBClientAffinePropertiesGenerator()) + gens["OperatorSpec"] = gen.PtrOf(NamespacesTopicsSubscriptionOperatorSpecGenerator()) +} + +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/v1api20240101/storage/namespaces_topics_subscriptions_rule_types_gen.go b/v2/api/servicebus/v1api20240101/storage/namespaces_topics_subscriptions_rule_types_gen.go new file mode 100644 index 00000000000..973541a1c0b --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/namespaces_topics_subscriptions_rule_types_gen.go @@ -0,0 +1,324 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/configmaps" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/secrets" + "github.com/rotisserie/eris" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// +kubebuilder:rbac:groups=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 v1api20240101.NamespacesTopicsSubscriptionsRule +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 NamespacesTopicsSubscriptionsRule_Spec `json:"spec,omitempty"` + Status NamespacesTopicsSubscriptionsRule_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 _ configmaps.Exporter = &NamespacesTopicsSubscriptionsRule{} + +// ConfigMapDestinationExpressions returns the Spec.OperatorSpec.ConfigMapExpressions property +func (rule *NamespacesTopicsSubscriptionsRule) ConfigMapDestinationExpressions() []*core.DestinationExpression { + if rule.Spec.OperatorSpec == nil { + return nil + } + return rule.Spec.OperatorSpec.ConfigMapExpressions +} + +var _ secrets.Exporter = &NamespacesTopicsSubscriptionsRule{} + +// SecretDestinationExpressions returns the Spec.OperatorSpec.SecretExpressions property +func (rule *NamespacesTopicsSubscriptionsRule) SecretDestinationExpressions() []*core.DestinationExpression { + if rule.Spec.OperatorSpec == nil { + return nil + } + return rule.Spec.OperatorSpec.SecretExpressions +} + +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 "2024-01-01" +func (rule NamespacesTopicsSubscriptionsRule) GetAPIVersion() string { + return "2024-01-01" +} + +// 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 +} + +// GetSupportedOperations returns the operations supported by the resource +func (rule *NamespacesTopicsSubscriptionsRule) GetSupportedOperations() []genruntime.ResourceOperation { + return []genruntime.ResourceOperation{ + genruntime.ResourceOperationDelete, + genruntime.ResourceOperationGet, + genruntime.ResourceOperationPut, + } +} + +// 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 &NamespacesTopicsSubscriptionsRule_STATUS{} +} + +// Owner returns the ResourceReference of the owner +func (rule *NamespacesTopicsSubscriptionsRule) Owner() *genruntime.ResourceReference { + if rule.Spec.Owner == nil { + return nil + } + + group, kind := genruntime.LookupOwnerGroupKind(rule.Spec) + return rule.Spec.Owner.AsResourceReference(group, kind) +} + +// SetStatus sets the status of this resource +func (rule *NamespacesTopicsSubscriptionsRule) SetStatus(status genruntime.ConvertibleStatus) error { + // If we have exactly the right type of status, assign it + if st, ok := status.(*NamespacesTopicsSubscriptionsRule_STATUS); ok { + rule.Status = *st + return nil + } + + // Convert status to required version + var st NamespacesTopicsSubscriptionsRule_STATUS + err := status.ConvertStatusTo(&st) + if err != nil { + return eris.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 v1api20240101.NamespacesTopicsSubscriptionsRule +// Generator information: +// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/stable/2024-01-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 v1api20240101.NamespacesTopicsSubscriptionsRule_Spec +type NamespacesTopicsSubscriptionsRule_Spec struct { + Action *Action `json:"action,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"` + CorrelationFilter *CorrelationFilter `json:"correlationFilter,omitempty"` + FilterType *string `json:"filterType,omitempty"` + OperatorSpec *NamespacesTopicsSubscriptionsRuleOperatorSpec `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/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 = &NamespacesTopicsSubscriptionsRule_Spec{} + +// ConvertSpecFrom populates our NamespacesTopicsSubscriptionsRule_Spec from the provided source +func (rule *NamespacesTopicsSubscriptionsRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error { + if source == rule { + return eris.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 NamespacesTopicsSubscriptionsRule_Spec +func (rule *NamespacesTopicsSubscriptionsRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error { + if destination == rule { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec") + } + + return destination.ConvertSpecFrom(rule) +} + +// Storage version of v1api20240101.NamespacesTopicsSubscriptionsRule_STATUS +type NamespacesTopicsSubscriptionsRule_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 = &NamespacesTopicsSubscriptionsRule_STATUS{} + +// ConvertStatusFrom populates our NamespacesTopicsSubscriptionsRule_STATUS from the provided source +func (rule *NamespacesTopicsSubscriptionsRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error { + if source == rule { + return eris.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 NamespacesTopicsSubscriptionsRule_STATUS +func (rule *NamespacesTopicsSubscriptionsRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error { + if destination == rule { + return eris.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus") + } + + return destination.ConvertStatusFrom(rule) +} + +// Storage version of v1api20240101.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 v1api20240101.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 v1api20240101.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 v1api20240101.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 v1api20240101.NamespacesTopicsSubscriptionsRuleOperatorSpec +// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure +type NamespacesTopicsSubscriptionsRuleOperatorSpec struct { + ConfigMapExpressions []*core.DestinationExpression `json:"configMapExpressions,omitempty"` + PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"` + SecretExpressions []*core.DestinationExpression `json:"secretExpressions,omitempty"` +} + +// Storage version of v1api20240101.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 v1api20240101.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/v1api20240101/storage/namespaces_topics_subscriptions_rule_types_gen_test.go b/v2/api/servicebus/v1api20240101/storage/namespaces_topics_subscriptions_rule_types_gen_test.go new file mode 100644 index 00000000000..ae7a756de2a --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/namespaces_topics_subscriptions_rule_types_gen_test.go @@ -0,0 +1,688 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package storage + +import ( + "encoding/json" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/kr/pretty" + "github.com/kylelemons/godebug/diff" + "github.com/leanovate/gopter" + "github.com/leanovate/gopter/gen" + "github.com/leanovate/gopter/prop" + "os" + "reflect" + "testing" +) + +func Test_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_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"] = NamespacesTopicsSubscriptionsRule_SpecGenerator() + gens["Status"] = NamespacesTopicsSubscriptionsRule_STATUSGenerator() +} + +func Test_NamespacesTopicsSubscriptionsRuleOperatorSpec_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 NamespacesTopicsSubscriptionsRuleOperatorSpec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionsRuleOperatorSpec, NamespacesTopicsSubscriptionsRuleOperatorSpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionsRuleOperatorSpec runs a test to see if a specific instance of NamespacesTopicsSubscriptionsRuleOperatorSpec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionsRuleOperatorSpec(subject NamespacesTopicsSubscriptionsRuleOperatorSpec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionsRuleOperatorSpec + err = json.Unmarshal(bin, &actual) + if err != nil { + return err.Error() + } + + // Check for outcome + match := cmp.Equal(subject, actual, cmpopts.EquateEmpty()) + if !match { + actualFmt := pretty.Sprint(actual) + subjectFmt := pretty.Sprint(subject) + result := diff.Diff(subjectFmt, actualFmt) + return result + } + + return "" +} + +// Generator of NamespacesTopicsSubscriptionsRuleOperatorSpec instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionsRuleOperatorSpecGenerator() +var namespacesTopicsSubscriptionsRuleOperatorSpecGenerator gopter.Gen + +// NamespacesTopicsSubscriptionsRuleOperatorSpecGenerator returns a generator of NamespacesTopicsSubscriptionsRuleOperatorSpec instances for property testing. +func NamespacesTopicsSubscriptionsRuleOperatorSpecGenerator() gopter.Gen { + if namespacesTopicsSubscriptionsRuleOperatorSpecGenerator != nil { + return namespacesTopicsSubscriptionsRuleOperatorSpecGenerator + } + + generators := make(map[string]gopter.Gen) + namespacesTopicsSubscriptionsRuleOperatorSpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRuleOperatorSpec{}), generators) + + return namespacesTopicsSubscriptionsRuleOperatorSpecGenerator +} + +func Test_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_STATUS via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_STATUS, NamespacesTopicsSubscriptionsRule_STATUSGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_STATUS runs a test to see if a specific instance of NamespacesTopicsSubscriptionsRule_STATUS round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_STATUS(subject NamespacesTopicsSubscriptionsRule_STATUS) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_STATUS instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionsRule_STATUSGenerator() +var namespacesTopicsSubscriptionsRule_STATUSGenerator gopter.Gen + +// NamespacesTopicsSubscriptionsRule_STATUSGenerator returns a generator of NamespacesTopicsSubscriptionsRule_STATUS instances for property testing. +// We first initialize namespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_STATUSGenerator() gopter.Gen { + if namespacesTopicsSubscriptionsRule_STATUSGenerator != nil { + return namespacesTopicsSubscriptionsRule_STATUSGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS(generators) + namespacesTopicsSubscriptionsRule_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule_STATUS{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS(generators) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS(generators) + namespacesTopicsSubscriptionsRule_STATUSGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule_STATUS{}), generators) + + return namespacesTopicsSubscriptionsRule_STATUSGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_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()) +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_STATUS is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_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_NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_Spec via JSON returns original", + prop.ForAll(RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_Spec, NamespacesTopicsSubscriptionsRule_SpecGenerator())) + properties.TestingRun(t, gopter.NewFormatedReporter(true, 240, os.Stdout)) +} + +// RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_Spec runs a test to see if a specific instance of NamespacesTopicsSubscriptionsRule_Spec round trips to JSON and back losslessly +func RunJSONSerializationTestForNamespacesTopicsSubscriptionsRule_Spec(subject NamespacesTopicsSubscriptionsRule_Spec) string { + // Serialize to JSON + bin, err := json.Marshal(subject) + if err != nil { + return err.Error() + } + + // Deserialize back into memory + var actual NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_Spec instances for property testing - lazily instantiated by +// NamespacesTopicsSubscriptionsRule_SpecGenerator() +var namespacesTopicsSubscriptionsRule_SpecGenerator gopter.Gen + +// NamespacesTopicsSubscriptionsRule_SpecGenerator returns a generator of NamespacesTopicsSubscriptionsRule_Spec instances for property testing. +// We first initialize namespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_SpecGenerator() gopter.Gen { + if namespacesTopicsSubscriptionsRule_SpecGenerator != nil { + return namespacesTopicsSubscriptionsRule_SpecGenerator + } + + generators := make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(generators) + namespacesTopicsSubscriptionsRule_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule_Spec{}), generators) + + // The above call to gen.Struct() captures the map, so create a new one + generators = make(map[string]gopter.Gen) + AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(generators) + AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(generators) + namespacesTopicsSubscriptionsRule_SpecGenerator = gen.Struct(reflect.TypeOf(NamespacesTopicsSubscriptionsRule_Spec{}), generators) + + return namespacesTopicsSubscriptionsRule_SpecGenerator +} + +// AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec is a factory method for creating gopter generators +func AddIndependentPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(gens map[string]gopter.Gen) { + gens["AzureName"] = gen.AlphaString() + gens["FilterType"] = gen.PtrOf(gen.AlphaString()) + gens["OriginalVersion"] = gen.AlphaString() +} + +// AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec is a factory method for creating gopter generators +func AddRelatedPropertyGeneratorsForNamespacesTopicsSubscriptionsRule_Spec(gens map[string]gopter.Gen) { + gens["Action"] = gen.PtrOf(ActionGenerator()) + gens["CorrelationFilter"] = gen.PtrOf(CorrelationFilterGenerator()) + gens["OperatorSpec"] = gen.PtrOf(NamespacesTopicsSubscriptionsRuleOperatorSpecGenerator()) + gens["SqlFilter"] = gen.PtrOf(SqlFilterGenerator()) +} + +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/v1api20240101/storage/structure.txt b/v2/api/servicebus/v1api20240101/storage/structure.txt new file mode 100644 index 00000000000..3269e554b7d --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/structure.txt @@ -0,0 +1,417 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage +------------------------------------------------------------------------------- +APIVersion: Enum (1 value) +└── "2024-01-01" +Namespace: Resource +├── Owner: 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 (4 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── SecretExpressions: *core.DestinationExpression[] +│ │ └── 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: servicebus/v1api20240101.Namespace +├── Spec: Object (6 properties) +│ ├── AzureName: string +│ ├── OperatorSpec: *Object (4 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── SecretExpressions: *core.DestinationExpression[] +│ │ └── 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: servicebus/v1api20240101.Namespace +├── Spec: Object (20 properties) +│ ├── AutoDeleteOnIdle: *string +│ ├── AzureName: 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 +│ ├── OperatorSpec: *Object (3 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── SecretExpressions: *core.DestinationExpression[] +│ ├── 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: servicebus/v1api20240101.Namespace +├── Spec: Object (15 properties) +│ ├── AutoDeleteOnIdle: *string +│ ├── AzureName: string +│ ├── DefaultMessageTimeToLive: *string +│ ├── DuplicateDetectionHistoryTimeWindow: *string +│ ├── EnableBatchedOperations: *bool +│ ├── EnableExpress: *bool +│ ├── EnablePartitioning: *bool +│ ├── MaxMessageSizeInKilobytes: *int +│ ├── MaxSizeInMegabytes: *int +│ ├── OperatorSpec: *Object (3 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── SecretExpressions: *core.DestinationExpression[] +│ ├── 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: servicebus/v1api20240101.NamespacesTopic +├── Spec: Object (18 properties) +│ ├── AutoDeleteOnIdle: *string +│ ├── AzureName: string +│ ├── 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 +│ ├── OperatorSpec: *Object (3 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── SecretExpressions: *core.DestinationExpression[] +│ ├── 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: servicebus/v1api20240101.NamespacesTopicsSubscription +├── Spec: Object (9 properties) +│ ├── Action: *Object (4 properties) +│ │ ├── CompatibilityLevel: *int +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ ├── RequiresPreprocessing: *bool +│ │ └── SqlExpression: *string +│ ├── AzureName: string +│ ├── 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 +│ ├── OperatorSpec: *Object (3 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ ├── PropertyBag: genruntime.PropertyBag +│ │ └── SecretExpressions: *core.DestinationExpression[] +│ ├── 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/v1api20240101/storage/zz_generated.deepcopy.go b/v2/api/servicebus/v1api20240101/storage/zz_generated.deepcopy.go new file mode 100644 index 00000000000..36b158c95a2 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/storage/zz_generated.deepcopy.go @@ -0,0 +1,2845 @@ +//go:build !ignore_autogenerated + +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package storage + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *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.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = new(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.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = new(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 *NamespacesAuthorizationRule_STATUS) DeepCopyInto(out *NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_STATUS. +func (in *NamespacesAuthorizationRule_STATUS) DeepCopy() *NamespacesAuthorizationRule_STATUS { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRule_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 *NamespacesAuthorizationRule_Spec) DeepCopyInto(out *NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_Spec. +func (in *NamespacesAuthorizationRule_Spec) DeepCopy() *NamespacesAuthorizationRule_Spec { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRule_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 *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 *NamespacesQueueOperatorSpec) DeepCopyInto(out *NamespacesQueueOperatorSpec) { + *out = *in + if in.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesQueueOperatorSpec. +func (in *NamespacesQueueOperatorSpec) DeepCopy() *NamespacesQueueOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesQueueOperatorSpec) + 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_STATUS) DeepCopyInto(out *NamespacesQueue_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 NamespacesQueue_STATUS. +func (in *NamespacesQueue_STATUS) DeepCopy() *NamespacesQueue_STATUS { + if in == nil { + return nil + } + out := new(NamespacesQueue_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 *NamespacesQueue_Spec) DeepCopyInto(out *NamespacesQueue_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.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesQueueOperatorSpec) + (*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.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 NamespacesQueue_Spec. +func (in *NamespacesQueue_Spec) DeepCopy() *NamespacesQueue_Spec { + if in == nil { + return nil + } + out := new(NamespacesQueue_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 *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 *NamespacesTopicOperatorSpec) DeepCopyInto(out *NamespacesTopicOperatorSpec) { + *out = *in + if in.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicOperatorSpec. +func (in *NamespacesTopicOperatorSpec) DeepCopy() *NamespacesTopicOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesTopicOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesTopic_STATUS) DeepCopyInto(out *NamespacesTopic_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 NamespacesTopic_STATUS. +func (in *NamespacesTopic_STATUS) DeepCopy() *NamespacesTopic_STATUS { + if in == nil { + return nil + } + out := new(NamespacesTopic_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 *NamespacesTopic_Spec) DeepCopyInto(out *NamespacesTopic_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.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesTopicOperatorSpec) + (*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.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 NamespacesTopic_Spec. +func (in *NamespacesTopic_Spec) DeepCopy() *NamespacesTopic_Spec { + if in == nil { + return nil + } + out := new(NamespacesTopic_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 *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 *NamespacesTopicsSubscriptionOperatorSpec) DeepCopyInto(out *NamespacesTopicsSubscriptionOperatorSpec) { + *out = *in + if in.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicsSubscriptionOperatorSpec. +func (in *NamespacesTopicsSubscriptionOperatorSpec) DeepCopy() *NamespacesTopicsSubscriptionOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesTopicsSubscription_STATUS) DeepCopyInto(out *NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_STATUS. +func (in *NamespacesTopicsSubscription_STATUS) DeepCopy() *NamespacesTopicsSubscription_STATUS { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscription_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 *NamespacesTopicsSubscription_Spec) DeepCopyInto(out *NamespacesTopicsSubscription_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.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesTopicsSubscriptionOperatorSpec) + (*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.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 NamespacesTopicsSubscription_Spec. +func (in *NamespacesTopicsSubscription_Spec) DeepCopy() *NamespacesTopicsSubscription_Spec { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscription_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 *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 *NamespacesTopicsSubscriptionsRuleOperatorSpec) DeepCopyInto(out *NamespacesTopicsSubscriptionsRuleOperatorSpec) { + *out = *in + if in.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.PropertyBag != nil { + in, out := &in.PropertyBag, &out.PropertyBag + *out = make(genruntime.PropertyBag, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicsSubscriptionsRuleOperatorSpec. +func (in *NamespacesTopicsSubscriptionsRuleOperatorSpec) DeepCopy() *NamespacesTopicsSubscriptionsRuleOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRuleOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesTopicsSubscriptionsRule_STATUS) DeepCopyInto(out *NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_STATUS. +func (in *NamespacesTopicsSubscriptionsRule_STATUS) DeepCopy() *NamespacesTopicsSubscriptionsRule_STATUS { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRule_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 *NamespacesTopicsSubscriptionsRule_Spec) DeepCopyInto(out *NamespacesTopicsSubscriptionsRule_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.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesTopicsSubscriptionsRuleOperatorSpec) + (*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.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 NamespacesTopicsSubscriptionsRule_Spec. +func (in *NamespacesTopicsSubscriptionsRule_Spec) DeepCopy() *NamespacesTopicsSubscriptionsRule_Spec { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRule_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/v1api20240101/structure.txt b/v2/api/servicebus/v1api20240101/structure.txt new file mode 100644 index 00000000000..d18b76af1ba --- /dev/null +++ b/v2/api/servicebus/v1api20240101/structure.txt @@ -0,0 +1,488 @@ +// Code generated by azure-service-operator-codegen. DO NOT EDIT. +github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101 +----------------------------------------------------------------------- +APIVersion: Enum (1 value) +└── "2024-01-01" +Namespace: Resource +├── Owner: 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 (3 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ ├── SecretExpressions: *core.DestinationExpression[] +│ │ └── 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 +NamespacesAuthorizationRule: Resource +├── Owner: Namespace +├── Spec: Object (4 properties) +│ ├── AzureName: Validated (2 rules) +│ │ ├── Rule 0: MaxLength: 50 +│ │ └── Rule 1: MinLength: 1 +│ ├── OperatorSpec: *Object (3 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ ├── SecretExpressions: *core.DestinationExpression[] +│ │ └── 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 (18 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 +│ ├── OperatorSpec: *Object (2 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ └── SecretExpressions: *core.DestinationExpression[] +│ ├── 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 (13 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 +│ ├── OperatorSpec: *Object (2 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ └── SecretExpressions: *core.DestinationExpression[] +│ ├── 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 (16 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 +│ ├── OperatorSpec: *Object (2 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ └── SecretExpressions: *core.DestinationExpression[] +│ ├── 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 (7 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" +│ ├── OperatorSpec: *Object (2 properties) +│ │ ├── ConfigMapExpressions: *core.DestinationExpression[] +│ │ └── SecretExpressions: *core.DestinationExpression[] +│ ├── 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 diff --git a/v2/api/servicebus/v1api20240101/zz_generated.deepcopy.go b/v2/api/servicebus/v1api20240101/zz_generated.deepcopy.go new file mode 100644 index 00000000000..4432dd81f65 --- /dev/null +++ b/v2/api/servicebus/v1api20240101/zz_generated.deepcopy.go @@ -0,0 +1,2542 @@ +//go:build !ignore_autogenerated + +/* +Copyright (c) Microsoft Corporation. +Licensed under the MIT license. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1api20240101 + +import ( + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime/core" + "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *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_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 *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_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 *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_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 *Identity) DeepCopyInto(out *Identity) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(Identity_Type) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make([]UserAssignedIdentityDetails, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Identity. +func (in *Identity) DeepCopy() *Identity { + if in == nil { + return nil + } + out := new(Identity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Identity_STATUS) DeepCopyInto(out *Identity_STATUS) { + *out = *in + if in.PrincipalId != nil { + in, out := &in.PrincipalId, &out.PrincipalId + *out = new(string) + **out = **in + } + if in.TenantId != nil { + in, out := &in.TenantId, &out.TenantId + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(Identity_Type_STATUS) + **out = **in + } + if in.UserAssignedIdentities != nil { + in, out := &in.UserAssignedIdentities, &out.UserAssignedIdentities + *out = make(map[string]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 + } +} + +// 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 + } +} + +// 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.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.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.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = new(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_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 *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.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = new(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 *NamespacesAuthorizationRule_STATUS) DeepCopyInto(out *NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_STATUS. +func (in *NamespacesAuthorizationRule_STATUS) DeepCopy() *NamespacesAuthorizationRule_STATUS { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRule_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 *NamespacesAuthorizationRule_Spec) DeepCopyInto(out *NamespacesAuthorizationRule_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 NamespacesAuthorizationRule_Spec. +func (in *NamespacesAuthorizationRule_Spec) DeepCopy() *NamespacesAuthorizationRule_Spec { + if in == nil { + return nil + } + out := new(NamespacesAuthorizationRule_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 *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 *NamespacesQueueOperatorSpec) DeepCopyInto(out *NamespacesQueueOperatorSpec) { + *out = *in + if in.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesQueueOperatorSpec. +func (in *NamespacesQueueOperatorSpec) DeepCopy() *NamespacesQueueOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesQueueOperatorSpec) + 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_STATUS) DeepCopyInto(out *NamespacesQueue_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 NamespacesQueue_STATUS. +func (in *NamespacesQueue_STATUS) DeepCopy() *NamespacesQueue_STATUS { + if in == nil { + return nil + } + out := new(NamespacesQueue_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 *NamespacesQueue_Spec) DeepCopyInto(out *NamespacesQueue_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.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesQueueOperatorSpec) + (*in).DeepCopyInto(*out) + } + 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 NamespacesQueue_Spec. +func (in *NamespacesQueue_Spec) DeepCopy() *NamespacesQueue_Spec { + if in == nil { + return nil + } + out := new(NamespacesQueue_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 *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 *NamespacesTopicOperatorSpec) DeepCopyInto(out *NamespacesTopicOperatorSpec) { + *out = *in + if in.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicOperatorSpec. +func (in *NamespacesTopicOperatorSpec) DeepCopy() *NamespacesTopicOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesTopicOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesTopic_STATUS) DeepCopyInto(out *NamespacesTopic_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 NamespacesTopic_STATUS. +func (in *NamespacesTopic_STATUS) DeepCopy() *NamespacesTopic_STATUS { + if in == nil { + return nil + } + out := new(NamespacesTopic_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 *NamespacesTopic_Spec) DeepCopyInto(out *NamespacesTopic_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.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesTopicOperatorSpec) + (*in).DeepCopyInto(*out) + } + 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 NamespacesTopic_Spec. +func (in *NamespacesTopic_Spec) DeepCopy() *NamespacesTopic_Spec { + if in == nil { + return nil + } + out := new(NamespacesTopic_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 *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 *NamespacesTopicsSubscriptionOperatorSpec) DeepCopyInto(out *NamespacesTopicsSubscriptionOperatorSpec) { + *out = *in + if in.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicsSubscriptionOperatorSpec. +func (in *NamespacesTopicsSubscriptionOperatorSpec) DeepCopy() *NamespacesTopicsSubscriptionOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesTopicsSubscription_STATUS) DeepCopyInto(out *NamespacesTopicsSubscription_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 NamespacesTopicsSubscription_STATUS. +func (in *NamespacesTopicsSubscription_STATUS) DeepCopy() *NamespacesTopicsSubscription_STATUS { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscription_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 *NamespacesTopicsSubscription_Spec) DeepCopyInto(out *NamespacesTopicsSubscription_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.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesTopicsSubscriptionOperatorSpec) + (*in).DeepCopyInto(*out) + } + 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 NamespacesTopicsSubscription_Spec. +func (in *NamespacesTopicsSubscription_Spec) DeepCopy() *NamespacesTopicsSubscription_Spec { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscription_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 *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 *NamespacesTopicsSubscriptionsRuleOperatorSpec) DeepCopyInto(out *NamespacesTopicsSubscriptionsRuleOperatorSpec) { + *out = *in + if in.ConfigMapExpressions != nil { + in, out := &in.ConfigMapExpressions, &out.ConfigMapExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } + if in.SecretExpressions != nil { + in, out := &in.SecretExpressions, &out.SecretExpressions + *out = make([]*core.DestinationExpression, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(core.DestinationExpression) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacesTopicsSubscriptionsRuleOperatorSpec. +func (in *NamespacesTopicsSubscriptionsRuleOperatorSpec) DeepCopy() *NamespacesTopicsSubscriptionsRuleOperatorSpec { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRuleOperatorSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespacesTopicsSubscriptionsRule_STATUS) DeepCopyInto(out *NamespacesTopicsSubscriptionsRule_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 NamespacesTopicsSubscriptionsRule_STATUS. +func (in *NamespacesTopicsSubscriptionsRule_STATUS) DeepCopy() *NamespacesTopicsSubscriptionsRule_STATUS { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRule_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 *NamespacesTopicsSubscriptionsRule_Spec) DeepCopyInto(out *NamespacesTopicsSubscriptionsRule_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.OperatorSpec != nil { + in, out := &in.OperatorSpec, &out.OperatorSpec + *out = new(NamespacesTopicsSubscriptionsRuleOperatorSpec) + (*in).DeepCopyInto(*out) + } + 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 NamespacesTopicsSubscriptionsRule_Spec. +func (in *NamespacesTopicsSubscriptionsRule_Spec) DeepCopy() *NamespacesTopicsSubscriptionsRule_Spec { + if in == nil { + return nil + } + out := new(NamespacesTopicsSubscriptionsRule_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 + } +} + +// 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 + } +} + +// 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 + } +} + +// 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(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_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 *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_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 *SystemData_STATUS) DeepCopyInto(out *SystemData_STATUS) { + *out = *in + if in.CreatedAt != nil { + in, out := &in.CreatedAt, &out.CreatedAt + *out = new(string) + **out = **in + } + if in.CreatedBy != nil { + in, out := &in.CreatedBy, &out.CreatedBy + *out = new(string) + **out = **in + } + if in.CreatedByType != nil { + in, out := &in.CreatedByType, &out.CreatedByType + *out = new(SystemData_CreatedByType_STATUS) + **out = **in + } + if in.LastModifiedAt != nil { + in, out := &in.LastModifiedAt, &out.LastModifiedAt + *out = new(string) + **out = **in + } + if in.LastModifiedBy != nil { + in, out := &in.LastModifiedBy, &out.LastModifiedBy + *out = new(string) + **out = **in + } + if in.LastModifiedByType != nil { + in, out := &in.LastModifiedByType, &out.LastModifiedByType + *out = new(SystemData_LastModifiedByType_STATUS) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SystemData_STATUS. +func (in *SystemData_STATUS) DeepCopy() *SystemData_STATUS { + if in == nil { + return nil + } + out := new(SystemData_STATUS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserAssignedIdentityDetails) DeepCopyInto(out *UserAssignedIdentityDetails) { + *out = *in + out.Reference = in.Reference +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserAssignedIdentityDetails. +func (in *UserAssignedIdentityDetails) DeepCopy() *UserAssignedIdentityDetails { + if in == nil { + return nil + } + out := new(UserAssignedIdentityDetails) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *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_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 *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 +} diff --git a/v2/api/servicebus/versions_matrix.md b/v2/api/servicebus/versions_matrix.md index 55436432728..efc9566cc21 100644 --- a/v2/api/servicebus/versions_matrix.md +++ b/v2/api/servicebus/versions_matrix.md @@ -1,76 +1,76 @@ -| Type Definitions in package "servicebus" | v1api20210101preview | v1api20211101 | v1api20221001preview | -|-------------------------------------------------------|----------------------|---------------|----------------------| -| APIVersion | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Action | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Action_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| CorrelationFilter | v1api20210101preview | v1api20211101 | v1api20221001preview | -| CorrelationFilter_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| DictionaryValue_STATUS | v1api20210101preview | | | -| Encryption | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Encryption_KeySource | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Encryption_KeySource_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Encryption_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| EntityStatus_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| FilterType | v1api20210101preview | v1api20211101 | v1api20221001preview | -| FilterType_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Identity | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Identity_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Identity_Type | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Identity_Type_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| KeyVaultProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | -| KeyVaultProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| MessageCountDetails_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Namespace | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Namespace_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Namespace_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesAuthorizationRule | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesAuthorizationRule_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesAuthorizationRule_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesQueue | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesQueue_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesQueue_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesTopic | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesTopic_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesTopic_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesTopicsSubscription | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesTopicsSubscription_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesTopicsSubscription_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesTopicsSubscriptionsRule | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesTopicsSubscriptionsRule_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| NamespacesTopicsSubscriptionsRule_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | -| 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 | -| PrivateEndpointConnection_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Ruleproperties | v1api20210101preview | v1api20211101 | v1api20221001preview | -| Ruleproperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBClientAffineProperties | | v1api20211101 | v1api20221001preview | -| SBClientAffineProperties_STATUS | | v1api20211101 | v1api20221001preview | -| SBNamespaceProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBNamespaceProperties_MinimumTlsVersion | | | v1api20221001preview | -| SBNamespaceProperties_MinimumTlsVersion_STATUS | | | v1api20221001preview | -| SBNamespaceProperties_PublicNetworkAccess | | | v1api20221001preview | -| SBNamespaceProperties_PublicNetworkAccess_STATUS | | | v1api20221001preview | -| SBNamespaceProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBQueueProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBQueueProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBSku | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBSku_Name | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBSku_Name_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBSku_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBSku_Tier | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBSku_Tier_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBSubscriptionProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBSubscriptionProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBTopicProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SBTopicProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SqlFilter | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SqlFilter_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SystemData_CreatedByType_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SystemData_LastModifiedByType_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| SystemData_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| UserAssignedIdentityDetails | v1api20210101preview | v1api20211101 | v1api20221001preview | -| UserAssignedIdentityProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | -| UserAssignedIdentityProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | -| UserAssignedIdentity_STATUS | | v1api20211101 | v1api20221001preview | +| Type Definitions in package "servicebus" | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +|-------------------------------------------------------|----------------------|---------------|----------------------|---------------| +| APIVersion | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Action | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Action_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| CorrelationFilter | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| CorrelationFilter_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| DictionaryValue_STATUS | v1api20210101preview | | | | +| Encryption | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Encryption_KeySource | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Encryption_KeySource_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Encryption_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| EntityStatus_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| FilterType | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| FilterType_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Identity | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Identity_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Identity_Type | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Identity_Type_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| KeyVaultProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| KeyVaultProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| MessageCountDetails_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Namespace | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Namespace_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Namespace_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesAuthorizationRule | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesAuthorizationRule_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesAuthorizationRule_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesQueue | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesQueue_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesQueue_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesTopic | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesTopic_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesTopic_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesTopicsSubscription | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesTopicsSubscription_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesTopicsSubscription_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesTopicsSubscriptionsRule | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesTopicsSubscriptionsRule_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| NamespacesTopicsSubscriptionsRule_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Namespaces_AuthorizationRule_Properties_Rights_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Namespaces_AuthorizationRule_Properties_Rights_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Namespaces_AuthorizationRule_Properties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Namespaces_AuthorizationRule_Properties_Spec | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| PrivateEndpointConnection_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Ruleproperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| Ruleproperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBClientAffineProperties | | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBClientAffineProperties_STATUS | | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBNamespaceProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBNamespaceProperties_MinimumTlsVersion | | | v1api20221001preview | v1api20240101 | +| SBNamespaceProperties_MinimumTlsVersion_STATUS | | | v1api20221001preview | v1api20240101 | +| SBNamespaceProperties_PublicNetworkAccess | | | v1api20221001preview | v1api20240101 | +| SBNamespaceProperties_PublicNetworkAccess_STATUS | | | v1api20221001preview | v1api20240101 | +| SBNamespaceProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBQueueProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBQueueProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBSku | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBSku_Name | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBSku_Name_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBSku_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBSku_Tier | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBSku_Tier_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBSubscriptionProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBSubscriptionProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBTopicProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SBTopicProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SqlFilter | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SqlFilter_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SystemData_CreatedByType_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SystemData_LastModifiedByType_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| SystemData_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| UserAssignedIdentityDetails | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| UserAssignedIdentityProperties | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| UserAssignedIdentityProperties_STATUS | v1api20210101preview | v1api20211101 | v1api20221001preview | v1api20240101 | +| UserAssignedIdentity_STATUS | | v1api20211101 | v1api20221001preview | v1api20240101 | diff --git a/v2/azure-arm.yaml b/v2/azure-arm.yaml index 2f971489879..6a9cefa1ea9 100644 --- a/v2/azure-arm.yaml +++ b/v2/azure-arm.yaml @@ -3843,6 +3843,39 @@ objectModelConfiguration: Namespaces_Topics_Subscriptions_Rule: $exportAs: NamespacesTopicsSubscriptionsRule $supportedFrom: v2.3.0 + 2024-01-01: + Namespace: + $export: true + $supportedFrom: v2.12.0 + $azureGeneratedSecrets: + - Endpoint + - PrimaryKey + - PrimaryConnectionString + - SecondaryKey + - SecondaryConnectionString + Namespaces_AuthorizationRule: + $exportAs: NamespacesAuthorizationRule + $supportedFrom: v2.12.0 + $azureGeneratedSecrets: + - PrimaryKey + - PrimaryConnectionString + - SecondaryKey + - SecondaryConnectionString + Namespaces_Queue: + $exportAs: NamespacesQueue + $supportedFrom: v2.12.0 + Namespaces_Topic: + $exportAs: NamespacesTopic + $supportedFrom: v2.12.0 + UserAssignedIdentityProperties: + UserAssignedIdentity: + $armReference: true + Namespaces_Topics_Subscription: + $exportAs: NamespacesTopicsSubscription + $supportedFrom: v2.12.0 + Namespaces_Topics_Subscriptions_Rule: + $exportAs: NamespacesTopicsSubscriptionsRule + $supportedFrom: v2.12.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 59209a53ebc..0fe31141deb 100644 --- a/v2/internal/controllers/controller_resources_gen.go +++ b/v2/internal/controllers/controller_resources_gen.go @@ -209,6 +209,8 @@ import ( servicebus_v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/storage" servicebus_v20221001p "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview" servicebus_v20221001ps "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20221001preview/storage" + servicebus_v20240101 "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101" + servicebus_v20240101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20240101/storage" signalrservice_customizations "github.com/Azure/azure-service-operator/v2/api/signalrservice/customizations" signalrservice_v20211001 "github.com/Azure/azure-service-operator/v2/api/signalrservice/v1api20211001" signalrservice_v20211001s "github.com/Azure/azure-service-operator/v2/api/signalrservice/v1api20211001/storage" @@ -1530,12 +1532,12 @@ func getKnownStorageTypes() []*registration.StorageType { }) 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_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(servicebus_v20240101s.Namespace)}) + result = append(result, ®istration.StorageType{Obj: new(servicebus_v20240101s.NamespacesAuthorizationRule)}) + result = append(result, ®istration.StorageType{Obj: new(servicebus_v20240101s.NamespacesQueue)}) + result = append(result, ®istration.StorageType{Obj: new(servicebus_v20240101s.NamespacesTopic)}) + result = append(result, ®istration.StorageType{Obj: new(servicebus_v20240101s.NamespacesTopicsSubscription)}) + result = append(result, ®istration.StorageType{Obj: new(servicebus_v20240101s.NamespacesTopicsSubscriptionsRule)}) result = append(result, ®istration.StorageType{ Obj: new(signalrservice_v20240301s.CustomCertificate), Indexes: []registration.Index{ @@ -2664,6 +2666,22 @@ func getKnownTypes() []client.Object { new(servicebus_v20221001ps.NamespacesTopic), new(servicebus_v20221001ps.NamespacesTopicsSubscription), new(servicebus_v20221001ps.NamespacesTopicsSubscriptionsRule)) + result = append( + result, + new(servicebus_v20240101.Namespace), + new(servicebus_v20240101.NamespacesAuthorizationRule), + new(servicebus_v20240101.NamespacesQueue), + new(servicebus_v20240101.NamespacesTopic), + new(servicebus_v20240101.NamespacesTopicsSubscription), + new(servicebus_v20240101.NamespacesTopicsSubscriptionsRule)) + result = append( + result, + new(servicebus_v20240101s.Namespace), + new(servicebus_v20240101s.NamespacesAuthorizationRule), + new(servicebus_v20240101s.NamespacesQueue), + new(servicebus_v20240101s.NamespacesTopic), + new(servicebus_v20240101s.NamespacesTopicsSubscription), + new(servicebus_v20240101s.NamespacesTopicsSubscriptionsRule)) result = append(result, new(signalrservice_v20211001.SignalR)) result = append(result, new(signalrservice_v20211001s.SignalR)) result = append( @@ -2987,6 +3005,8 @@ func createScheme() *runtime.Scheme { _ = servicebus_v20211101s.AddToScheme(scheme) _ = servicebus_v20221001p.AddToScheme(scheme) _ = servicebus_v20221001ps.AddToScheme(scheme) + _ = servicebus_v20240101.AddToScheme(scheme) + _ = servicebus_v20240101s.AddToScheme(scheme) _ = signalrservice_v20211001.AddToScheme(scheme) _ = signalrservice_v20211001s.AddToScheme(scheme) _ = signalrservice_v20240301.AddToScheme(scheme) diff --git a/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api20240101_CreationAndDeletion.yaml b/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api20240101_CreationAndDeletion.yaml new file mode 100644 index 00000000000..9110803d1a0 --- /dev/null +++ b/v2/internal/controllers/recordings/Test_Samples_CreationAndDeletion/Test_Servicebus_v1api20240101_CreationAndDeletion.yaml @@ -0,0 +1,1514 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 93 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westus2","name":"asotest-rg-qdlabl","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "93" + Content-Type: + - application/json + Test-Request-Hash: + - 395e4420ec45317aea37029ddcf869fb056cf3cc85a0d4a3fdde44d37abc9a8f + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl?api-version=2020-06-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 276 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl","name":"asotest-rg-qdlabl","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "276" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: AF06FE91F2474C229100357561A2363D Ref B: MAA201060516009 Ref C: 2025-02-05T04:45:54Z' + status: 201 Created + code: 201 + duration: 4.185531304s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl?api-version=2020-06-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 276 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl","name":"asotest-rg-qdlabl","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "276" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 0396DECBA7CC4065901D56596CF0B31B Ref B: MAA201060516009 Ref C: 2025-02-05T04:46:02Z' + status: 200 OK + code: 200 + duration: 587.251733ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 114 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westcentralus","name":"asotesttldeoh","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "114" + Content-Type: + - application/json + Test-Request-Hash: + - d5a1c72a2279461086373bf149c26adf7c7cb05f10ba2b407da0494d4c8ab833 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 872 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh","name":"asotesttldeoh","type":"Microsoft.ServiceBus/Namespaces","location":"westcentralus","tags":{},"properties":{"geoDataReplication":{"maxReplicationLagDurationInSeconds":0,"locations":[{"locationName":"westcentralus","roleType":"Primary","replicaState":"InBuild"}]},"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotesttldeoh","serviceBusEndpoint":"https://asotesttldeoh.servicebus.windows.net:443/","provisioningState":"Creating","status":"Creating","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "872" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 4765d896-0fb5-4716-9af3-4c8becf03b9e + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G0|2025-02-05T04:46:12 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "12000" + X-Msedge-Ref: + - 'Ref A: 057FD1EA61FB4161AA643152349F2654 Ref B: MAA201060516009 Ref C: 2025-02-05T04:46:07Z' + status: 201 Created + code: 201 + duration: 5.780733582s + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 870 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh","name":"asotesttldeoh","type":"Microsoft.ServiceBus/Namespaces","location":"westcentralus","tags":{},"properties":{"geoDataReplication":{"maxReplicationLagDurationInSeconds":0,"locations":[{"locationName":"westcentralus","roleType":"Primary","replicaState":"Ready"}]},"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotesttldeoh","serviceBusEndpoint":"https://asotesttldeoh.servicebus.windows.net:443/","provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "870" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 13b007d7-20e2-47ea-9f33-bab53141b6ee + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G0|2025-02-05T04:46:22 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 0619E22882CE449BA9024CC0C81E26EF Ref B: MAA201060516009 Ref C: 2025-02-05T04:46:21Z' + status: 200 OK + code: 200 + duration: 1.215432129s + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 870 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh","name":"asotesttldeoh","type":"Microsoft.ServiceBus/Namespaces","location":"westcentralus","tags":{},"properties":{"geoDataReplication":{"maxReplicationLagDurationInSeconds":0,"locations":[{"locationName":"westcentralus","roleType":"Primary","replicaState":"Ready"}]},"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":false,"metricId":"00000000-0000-0000-0000-000000000000:asotesttldeoh","serviceBusEndpoint":"https://asotesttldeoh.servicebus.windows.net:443/","provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "870" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - e298c350-e027-4a44-86cb-e952318b0178 + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G3|2025-02-05T04:46:24 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: C9CCE2D97499461BA272456917AC0750 Ref B: MAA201060516009 Ref C: 2025-02-05T04:46:23Z' + status: 200 OK + code: 200 + duration: 1.249371891s + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 24 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotestmabvje"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "24" + Content-Type: + - application/json + Test-Request-Hash: + - 51a3e65c27b07c736f2f40fe1af602ff189903dae0cc2467c900202c9fa8f757 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/queues/asotestmabvje?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1032 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/queues/asotestmabvje","name":"asotestmabvje","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-Length: + - "1032" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 38848a6e-0a6a-44db-b65a-c57b0d8ac632 + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G3|2025-02-05T04:46:41 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 130C88901D7F4314A80BC90100DEFCCB Ref B: MAA201060516009 Ref C: 2025-02-05T04:46:39Z' + status: 200 OK + code: 200 + duration: 2.739845519s + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 24 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotestwsdqxg"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "24" + Content-Type: + - application/json + Test-Request-Hash: + - 58db7e328b5944ee15028d5024da90da70e4f2c8bcc593518dabf8c6d444cb9d + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 951 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg","name":"asotestwsdqxg","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-Length: + - "951" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 4a202970-a081-4c37-9a70-b7ffc2c1ed4d + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G1|2025-02-05T04:46:42 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: FF8077EF78244F2791128160E48E88A5 Ref B: MAA201060516009 Ref C: 2025-02-05T04:46:39Z' + status: 200 OK + code: 200 + duration: 3.478044903s + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/queues/asotestmabvje?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1033 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/queues/asotestmabvje","name":"asotestmabvje","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-Length: + - "1033" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 1e289aef-63d1-47c6-accc-bec8bdb811ae + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G3|2025-02-05T04:46:46 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 22E5E175655A4CA1913F96B476B7E5A9 Ref B: MAA201060516009 Ref C: 2025-02-05T04:46:45Z' + status: 200 OK + code: 200 + duration: 1.382299707s + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 66 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotestebkgqc","properties":{"rights":["Listen","Send"]}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "66" + Content-Type: + - application/json + Test-Request-Hash: + - 7d0351fc2554258b99060c6ba65fa5c884e23d98b2dde0625f730e2a0550a1f2 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/AuthorizationRules/asotestebkgqc?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 334 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/AuthorizationRules/asotestebkgqc","name":"asotestebkgqc","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"westcentralus","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "334" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 5ccf84ff-c419-4968-9253-7ef533a4d0b0 + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G3|2025-02-05T04:46:47 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 753F8AA3EA514EB5AA95A089EEFC6F68 Ref B: MAA201060516009 Ref C: 2025-02-05T04:46:39Z' + status: 200 OK + code: 200 + duration: 7.618894102s + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 952 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg","name":"asotestwsdqxg","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-Length: + - "952" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - d762b882-0d69-4249-a765-4ff7daddc276 + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G2|2025-02-05T04:46:47 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 73ABE358722840A79036E41C3A81156D Ref B: MAA201060516009 Ref C: 2025-02-05T04:46:46Z' + status: 200 OK + code: 200 + duration: 1.395473588s + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/AuthorizationRules/asotestebkgqc?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 334 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/authorizationrules/asotestebkgqc","name":"asotestebkgqc","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"westcentralus","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "334" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 8bfe0532-e276-4949-808b-6170b5884a0b + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G3|2025-02-05T04:46:56 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 84397CE7A6EC4744B243249D47DB0D00 Ref B: MAA201060516009 Ref C: 2025-02-05T04:46:55Z' + status: 200 OK + code: 200 + duration: 1.039271434s + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/AuthorizationRules/asotestebkgqc/listKeys?api-version=2021-11-01 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 501 + uncompressed: false + body: '{"primaryConnectionString":"Endpoint=sb://asotesttldeoh.servicebus.windows.net/;SharedAccessKeyName=asotestebkgqc;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotesttldeoh.servicebus.windows.net/;SharedAccessKeyName=asotestebkgqc;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"asotestebkgqc"}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "501" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 11006571-14a0-47c4-8f87-4ce560eaecb4 + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G0|2025-02-05T04:46:59 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 306DD79B8E4D4C2CA1D7D088786A3DB8 Ref B: MAA201060516009 Ref C: 2025-02-05T04:46:58Z' + status: 200 OK + code: 200 + duration: 1.722554898s + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 24 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotestnxtftv"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "24" + Content-Type: + - application/json + Test-Request-Hash: + - 9fac712bde7f8997c6f5ce372bac820c12aa132f85d520feb5c5a261f074edc6 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg/subscriptions/asotestnxtftv?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 948 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg/subscriptions/asotestnxtftv","name":"asotestnxtftv","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-Length: + - "948" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 1eae9296-5ce6-4570-a252-037444b37dd1 + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G3|2025-02-05T04:47:15 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 5299DF9EB5FC40EFA5CB01D2E9E097F7 Ref B: MAA201060516009 Ref C: 2025-02-05T04:47:12Z' + status: 200 OK + code: 200 + duration: 2.976874549s + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg/subscriptions/asotestnxtftv?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 959 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg/subscriptions/asotestnxtftv","name":"asotestnxtftv","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-Length: + - "959" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 5d7648be-b82d-462c-8f25-7c31ed3bb44c + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G0|2025-02-05T04:47:20 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 5892A4F31B8544DAA0ED04DD72EBB074 Ref B: MAA201060516009 Ref C: 2025-02-05T04:47:19Z' + status: 200 OK + code: 200 + duration: 1.392747181s + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 285 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotestjrzwwf","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-Hash: + - 17d7df5f83f5c579a4a824012d505fb7bddd4925a48cad1c0cba54c143727350 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg/subscriptions/asotestnxtftv/rules/asotestjrzwwf?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 548 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg/subscriptions/asotestnxtftv/rules/asotestjrzwwf","name":"asotestjrzwwf","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-Length: + - "548" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 31d0c7a9-2c2b-4280-974f-a2ae377c42dd + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G4|2025-02-05T04:48:18 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: C5178FD678154C8281F67E42C7073B3B Ref B: MAA201060516009 Ref C: 2025-02-05T04:48:15Z' + status: 200 OK + code: 200 + duration: 2.90821912s + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg/subscriptions/asotestnxtftv/rules/asotestjrzwwf?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 580 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg/subscriptions/asotestnxtftv/rules/asotestjrzwwf","name":"asotestjrzwwf","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-Length: + - "580" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - eb1dbddf-3765-459b-840f-34cd28472e5b + X-Ms-Messaging-Routing-Id: + - WESTCENTRALUS|WESTCENTRALUS|G0|2025-02-05T04:48:22 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: EC15E3FAC53245638C99AE3E272F386B Ref B: MAA201060516009 Ref C: 2025-02-05T04:48:21Z' + status: 200 OK + code: 200 + duration: 1.185784362s + - id: 16 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl?api-version=2020-06-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRRExBQkwtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638743277113325438&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=j5Hj-FX9GGmqZ7o-3-VM3Y89U07ve4e40Wlemt38zJDZZbTWowy6S3TLhhnsI9zCiPl6zPxow0PTcDKzVK64XKAwmRzbRuQDtwa-6EicdehGFGAFhnQPj-Tq2eQcacWoZGRFSqkgDf2KD7QYi20hq3i4Aq0uIMz7B7L-DiBOwCghIChuAHZAzw-ltUj02ohk0FckX8Et9uZRTByWneCMSEXy5DxURvU7Qs9DQjOWVMBUCH58CZyjA58yMTItRlLN6sdAZNHLN7VykeKlIsmRzOHBbBKUR6_UW4iw1i2BsdvZR0kaOSY2hDrydDF8jeE9xGlQJ6cQD4RWbdNLJ32m3g&h=es6btZ3grcNPZoYYgmdF8vQ35CSvqCtb-jYHJDd5P14 + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "11999" + X-Msedge-Ref: + - 'Ref A: AC7DD24B1CBE450F94AE74DFBF6A8F47 Ref B: MAA201060516009 Ref C: 2025-02-05T04:48:27Z' + status: 202 Accepted + code: 202 + duration: 4.275477678s + - id: 17 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRRExBQkwtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638743277113325438&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=j5Hj-FX9GGmqZ7o-3-VM3Y89U07ve4e40Wlemt38zJDZZbTWowy6S3TLhhnsI9zCiPl6zPxow0PTcDKzVK64XKAwmRzbRuQDtwa-6EicdehGFGAFhnQPj-Tq2eQcacWoZGRFSqkgDf2KD7QYi20hq3i4Aq0uIMz7B7L-DiBOwCghIChuAHZAzw-ltUj02ohk0FckX8Et9uZRTByWneCMSEXy5DxURvU7Qs9DQjOWVMBUCH58CZyjA58yMTItRlLN6sdAZNHLN7VykeKlIsmRzOHBbBKUR6_UW4iw1i2BsdvZR0kaOSY2hDrydDF8jeE9xGlQJ6cQD4RWbdNLJ32m3g&h=es6btZ3grcNPZoYYgmdF8vQ35CSvqCtb-jYHJDd5P14 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRRExBQkwtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638743277326742914&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=SluzJrlntbS9MYPvveeDkGLCCbyPk_611zhS7s3io8yDIV4rYYQqaqCGBXxZ7X4C9HnSvARsC5XVXaCXLnpoaDxRQIULDgO44x3HhSGtvFjvx1EC5jzR9EY5IKDzQJ1WbduT5AOq-1eXArSLSJNG6YKwKg-dtb6m_aOGlpGp5e50Ut9pBMh4UHgjOkYRvRBc7uRnZGECT0H3pNAQ_jvAfOc8srnSVp9Td_2tE6t8DJ4eI96MCL6MN2lnmvEqWf6ZnliNRuUpW1C8F2hlbvRv_-NLez7IlAxQx4P5NO7QegTld1Vj6AXkkoi4FhFNk3urUpmbsyVzN57a2TLjno7k-Q&h=6aGib1gCZirlhjCkePIfFvnw9RScSHwGAJvwUtCQ0mM + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: BAB587567CD74A77BF8266E347741C18 Ref B: MAA201060516009 Ref C: 2025-02-05T04:48:51Z' + status: 202 Accepted + code: 202 + duration: 1.142256623s + - id: 18 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRRExBQkwtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638743277113325438&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=j5Hj-FX9GGmqZ7o-3-VM3Y89U07ve4e40Wlemt38zJDZZbTWowy6S3TLhhnsI9zCiPl6zPxow0PTcDKzVK64XKAwmRzbRuQDtwa-6EicdehGFGAFhnQPj-Tq2eQcacWoZGRFSqkgDf2KD7QYi20hq3i4Aq0uIMz7B7L-DiBOwCghIChuAHZAzw-ltUj02ohk0FckX8Et9uZRTByWneCMSEXy5DxURvU7Qs9DQjOWVMBUCH58CZyjA58yMTItRlLN6sdAZNHLN7VykeKlIsmRzOHBbBKUR6_UW4iw1i2BsdvZR0kaOSY2hDrydDF8jeE9xGlQJ6cQD4RWbdNLJ32m3g&h=es6btZ3grcNPZoYYgmdF8vQ35CSvqCtb-jYHJDd5P14 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRRExBQkwtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638743277506823102&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=jOdEqIbKYvJPQMk0VInrAJlIiP9DmPPjlGyhaaZTCCVNKIVsbS4d0pEpoWkgPy0vJ2IhrdcVPWobGzScUvyq3VvrjP3tTFUIVtcr-urSZVn0VyECUSAGK56FpZBlXj0JIdIQKakk7BUa7IfMnbg7-EsrkmLKXs91aZqSZXZO3FMiODMgvzlxdcCDaWlHz2qFeLg82OC4vnxAyYm4MqE14kAnohB_BGrh8zFdNxthNhRBcCZfoOJmU7SBdsdtnHDRdVW2n2p7JMp13ZDN-q4kvONTxyTWGrC4klvp-aFNAWd4KuqPCWONw79jgh2Wj-O1L_HCtLCtk_tZKJARvPQrPw&h=9wK7zTdY3qF_iA7qVKoE6FNheqnhhNArdKv-GwcpCVM + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: BE738C6E653F4751A787BA6DEB533A28 Ref B: MAA201060516009 Ref C: 2025-02-05T04:49:09Z' + status: 202 Accepted + code: 202 + duration: 1.034120033s + - id: 19 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRRExBQkwtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638743277113325438&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=j5Hj-FX9GGmqZ7o-3-VM3Y89U07ve4e40Wlemt38zJDZZbTWowy6S3TLhhnsI9zCiPl6zPxow0PTcDKzVK64XKAwmRzbRuQDtwa-6EicdehGFGAFhnQPj-Tq2eQcacWoZGRFSqkgDf2KD7QYi20hq3i4Aq0uIMz7B7L-DiBOwCghIChuAHZAzw-ltUj02ohk0FckX8Et9uZRTByWneCMSEXy5DxURvU7Qs9DQjOWVMBUCH58CZyjA58yMTItRlLN6sdAZNHLN7VykeKlIsmRzOHBbBKUR6_UW4iw1i2BsdvZR0kaOSY2hDrydDF8jeE9xGlQJ6cQD4RWbdNLJ32m3g&h=es6btZ3grcNPZoYYgmdF8vQ35CSvqCtb-jYHJDd5P14 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRRExBQkwtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638743277684592235&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=sjBxvan8GfVqln51cZHhcOUzGDCQ5G8a3wp8FjyVRiGqid33qld1lgr15JKifFWRh5xjUsTs-zLZczx0I1QQgZYSZ6l0g7IzKhszL5kh0j8khUom1ou1DM48RmF6yzvJaUKV-rEe--gTDF79fm3ZYh1kS_2raHq99uyQrrGcfsGm_tay1GvRhEmexEMD_djQh1EFOkU8bCzLfIvOt0vXi54ENGdIA0XozdEX91ayKyr6_OkmF3Zxs8FZAX0O-Z62NX9WgZFkj40bQm_mUi5QgezsGhRt86zbyL00ILnsy282ZeNHb65sMqLkFUBMVtPihpGxNlXrfCEasPGR1H7aTw&h=2tsKejqKKk3kJRX03CLmgX906LYbQ8Vv1avkSBGp28Y + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 783661C55C0D4654822105FFE5F361B5 Ref B: MAA201060516009 Ref C: 2025-02-05T04:49:27Z' + status: 202 Accepted + code: 202 + duration: 1.025947611s + - id: 20 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRRExBQkwtV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638743277113325438&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=j5Hj-FX9GGmqZ7o-3-VM3Y89U07ve4e40Wlemt38zJDZZbTWowy6S3TLhhnsI9zCiPl6zPxow0PTcDKzVK64XKAwmRzbRuQDtwa-6EicdehGFGAFhnQPj-Tq2eQcacWoZGRFSqkgDf2KD7QYi20hq3i4Aq0uIMz7B7L-DiBOwCghIChuAHZAzw-ltUj02ohk0FckX8Et9uZRTByWneCMSEXy5DxURvU7Qs9DQjOWVMBUCH58CZyjA58yMTItRlLN6sdAZNHLN7VykeKlIsmRzOHBbBKUR6_UW4iw1i2BsdvZR0kaOSY2hDrydDF8jeE9xGlQJ6cQD4RWbdNLJ32m3g&h=es6btZ3grcNPZoYYgmdF8vQ35CSvqCtb-jYHJDd5P14 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: D4D35FBA59C74C60B5D2549A7AB26D77 Ref B: MAA201060516009 Ref C: 2025-02-05T04:49:45Z' + status: 200 OK + code: 200 + duration: 1.01757686s + - id: 21 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 109 + uncompressed: false + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-qdlabl'' could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "109" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: BE68B6E74C094C51A70CF98DCDA77858 Ref B: MAA201060516009 Ref C: 2025-02-05T04:49:50Z' + status: 404 Not Found + code: 404 + duration: 1.382175474s + - id: 22 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/queues/asotestmabvje?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 109 + uncompressed: false + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-qdlabl'' could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "109" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: BD226F6C51DC42C0B3A39DE8F33E5E6A Ref B: MAA201060516009 Ref C: 2025-02-05T04:49:55Z' + status: 404 Not Found + code: 404 + duration: 335.910494ms + - id: 23 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/AuthorizationRules/asotestebkgqc?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 109 + uncompressed: false + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-qdlabl'' could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "109" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: 1E3A2C6526B04F1895C979E78B72F017 Ref B: MAA201060516009 Ref C: 2025-02-05T04:49:55Z' + status: 404 Not Found + code: 404 + duration: 472.665178ms + - id: 24 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 109 + uncompressed: false + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-qdlabl'' could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "109" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: C4559A252FA14444B9599BDBBEB60A7A Ref B: MAA201060516009 Ref C: 2025-02-05T04:49:56Z' + status: 404 Not Found + code: 404 + duration: 458.576382ms + - id: 25 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg/subscriptions/asotestnxtftv?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 109 + uncompressed: false + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-qdlabl'' could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "109" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: 0BFAFE7FBD754BD0BDEB76AA1FC25D3C Ref B: MAA201060516009 Ref C: 2025-02-05T04:50:01Z' + status: 404 Not Found + code: 404 + duration: 403.331775ms + - id: 26 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qdlabl/providers/Microsoft.ServiceBus/namespaces/asotesttldeoh/topics/asotestwsdqxg/subscriptions/asotestnxtftv/rules/asotestjrzwwf?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 109 + uncompressed: false + body: '{"error":{"code":"ResourceGroupNotFound","message":"Resource group ''asotest-rg-qdlabl'' could not be found."}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "109" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Failure-Cause: + - gateway + X-Msedge-Ref: + - 'Ref A: 9A0D6A9A59E74CC0A799B1C3CCE5C9D6 Ref B: MAA201060516009 Ref C: 2025-02-05T04:50:06Z' + status: 404 Not Found + code: 404 + duration: 473.034746ms diff --git a/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_v1api20240101_CRUD.yaml b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_v1api20240101_CRUD.yaml new file mode 100644 index 00000000000..8f63697700e --- /dev/null +++ b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Basic_v1api20240101_CRUD.yaml @@ -0,0 +1,905 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 93 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westus2","name":"asotest-rg-qqelci","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "93" + Content-Type: + - application/json + Test-Request-Hash: + - 3ed3e8a582c894a1bddc2d7944685b14fbab0d4eed1aea1f473f28f839bd60a6 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci?api-version=2020-06-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 276 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci","name":"asotest-rg-qqelci","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "276" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 1CCADB15E5524139914FEDA43C083484 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:01Z' + status: 201 Created + code: 201 + duration: 3.834760456s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci?api-version=2020-06-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 276 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci","name":"asotest-rg-qqelci","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "276" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 78FE91BAE0EF41FCA7CAFC2A075448D0 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:08Z' + status: 200 OK + code: 200 + duration: 492.724683ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 116 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westus2","name":"asotest-namespace-nfctrx","properties":{"zoneRedundant":false},"sku":{"name":"Basic"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "116" + Content-Type: + - application/json + Test-Request-Hash: + - 4f7df0b158687c5ace0d90d875477054e41b23c93142eb08647873583129beb8 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 899 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx","name":"asotest-namespace-nfctrx","type":"Microsoft.ServiceBus/Namespaces","location":"westus2","tags":{},"properties":{"geoDataReplication":{"maxReplicationLagDurationInSeconds":0,"locations":[{"locationName":"westus2","roleType":"Primary","replicaState":"InBuild"}]},"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":true,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nfctrx","serviceBusEndpoint":"https://asotest-namespace-nfctrx.servicebus.windows.net:443/","provisioningState":"Creating","status":"Creating","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Basic","tier":"Basic"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "899" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 1cc7ca25-64d1-4cb0-90fb-57ac45b38b8f + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G10|2025-02-05T03:55:18 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 3F460331E90A49F49F7A582BB4587414 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:13Z' + status: 201 Created + code: 201 + duration: 4.881038671s + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 896 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx","name":"asotest-namespace-nfctrx","type":"Microsoft.ServiceBus/Namespaces","location":"westus2","tags":{},"properties":{"geoDataReplication":{"maxReplicationLagDurationInSeconds":0,"locations":[{"locationName":"westus2","roleType":"Primary","replicaState":"Ready"}]},"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":true,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nfctrx","serviceBusEndpoint":"https://asotest-namespace-nfctrx.servicebus.windows.net:443/","provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Basic","tier":"Basic"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "896" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 78770d50-be7d-4d06-b270-e4b88eeb6c37 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G3|2025-02-05T03:55:26 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 38262357A40D4591ADF1BE876C403C1A Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:25Z' + status: 200 OK + code: 200 + duration: 1.056595659s + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 896 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx","name":"asotest-namespace-nfctrx","type":"Microsoft.ServiceBus/Namespaces","location":"westus2","tags":{},"properties":{"geoDataReplication":{"maxReplicationLagDurationInSeconds":0,"locations":[{"locationName":"westus2","roleType":"Primary","replicaState":"Ready"}]},"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":true,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nfctrx","serviceBusEndpoint":"https://asotest-namespace-nfctrx.servicebus.windows.net:443/","provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Basic","tier":"Basic"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "896" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 289514bd-31fc-41c3-bb49-faa1ea7a21f6 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G7|2025-02-05T03:55:29 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 041314F791EE4AEBB3F3E38DEBE4C896 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:28Z' + status: 200 OK + code: 200 + duration: 1.169845487s + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 31 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotest-queue-fujars"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "31" + Content-Type: + - application/json + Test-Request-Hash: + - 1813ab7aeff0c7eaa2ab74c070665df9b6d66120685993f91baf35850dfb2e10 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx/queues/asotest-queue-fujars?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1027 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx/queues/asotest-queue-fujars","name":"asotest-queue-fujars","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-Length: + - "1027" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 0fffbc88-1bdf-4782-9793-d5116dc6bef4 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G6|2025-02-05T03:55:37 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 7498081004EB4AB28D96543CCC98808D Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:34Z' + status: 200 OK + code: 200 + duration: 3.353660138s + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx/queues/asotest-queue-fujars?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1028 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx/queues/asotest-queue-fujars","name":"asotest-queue-fujars","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-Length: + - "1028" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - b3d25035-5c6c-4f30-85c9-b2ee46a61b27 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G1|2025-02-05T03:55:42 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: E3DEE8425F2A4618BD8264BF84893E2C Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:41Z' + status: 200 OK + code: 200 + duration: 1.050715034s + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx/queues/asotest-queue-fujars?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000004724 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G1|2025-02-05T03:55:49 + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 161C4C232DEA407E8E85DC753FEBEDD9 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:49Z' + status: 200 OK + code: 200 + duration: 1.068073995s + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 116 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westus2","name":"asotest-namespace-nfctrx","properties":{"zoneRedundant":false},"sku":{"name":"Basic"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "116" + Content-Type: + - application/json + Test-Request-Hash: + - 4f7df0b158687c5ace0d90d875477054e41b23c93142eb08647873583129beb8 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 896 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx","name":"asotest-namespace-nfctrx","type":"Microsoft.ServiceBus/Namespaces","location":"westus2","tags":{},"properties":{"geoDataReplication":{"maxReplicationLagDurationInSeconds":0,"locations":[{"locationName":"westus2","roleType":"Primary","replicaState":"Ready"}]},"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":true,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nfctrx","serviceBusEndpoint":"https://asotest-namespace-nfctrx.servicebus.windows.net:443/","provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Basic","tier":"Basic"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "896" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - c3fc78d5-cd25-45ee-be22-64dbe837bad7 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G3|2025-02-05T03:55:58 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 2F8D9B1E773F4C22895E1A6E64589C36 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:54Z' + status: 200 OK + code: 200 + duration: 4.743094231s + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 896 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx","name":"asotest-namespace-nfctrx","type":"Microsoft.ServiceBus/Namespaces","location":"westus2","tags":{},"properties":{"geoDataReplication":{"maxReplicationLagDurationInSeconds":0,"locations":[{"locationName":"westus2","roleType":"Primary","replicaState":"Ready"}]},"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":true,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-nfctrx","serviceBusEndpoint":"https://asotest-namespace-nfctrx.servicebus.windows.net:443/","provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Basic","tier":"Basic"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "896" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - cd8f83db-ab92-4fe1-93e9-051ef8b90e52 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G1|2025-02-05T03:56:05 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 05F46D104CE24E2D92A45B3FF50D0086 Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:04Z' + status: 200 OK + code: 200 + duration: 1.273096322s + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx/AuthorizationRules/RootManageSharedAccessKey/listKeys?api-version=2021-11-01 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 559 + uncompressed: false + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-nfctrx.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-nfctrx.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"RootManageSharedAccessKey"}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "559" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 8d697907-eb6a-4227-8c78-95e3f3bc77e7 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G11|2025-02-05T03:56:08 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 621BC22689D240FB817F1C6FC44885A8 Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:07Z' + status: 200 OK + code: 200 + duration: 1.471590815s + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceBus/locations/westus2/namespaceOperationResults/2d950154-97f2-4b2b-8b92-b656ed3d1210?isAsyncHeader=false&resourceName=asotest-namespace-nfctrx&resourceType=namespace&api-version=2024-01-01&operationType=Deleted&t=638743245776800502&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=A6W-l0iigbhTHl93WK5ZOSjzm50GBSVNQC4lEg8mzgMUMCwWjf50z27D0GTkv0QMVq0UDCJICuQqr3El6n4MD5aowFRK3nk9wKtNOFYvRsuMGeatd7ZgwlUJ0ZRvxfxKkcXQv2ALjYXmVxVRyQAJ0xI6sYBMg8Lok5ubcaLJ1Z6p_8183RTnTclFoM3bJcqxR1QhkUdJeN7cpWCtTwWD1VaOhaIoewa96P_GXwp2woNomeLVxvhVRqU-jVOaE9k_Z2Fu4IrcUsfPeLh7v5KiXNaNFSysdIN6wslYoMWf1UtWPS4Sfm8AjUoVLaKb6aQ5sb-vbJnMTfnnsGWiAp_LZA&h=zLvrF-kV89xfm9ujw_bk6vqgRRlRJR67gBs8kzAOBR4 + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000000592 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G6|2025-02-05T03:56:17 + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "11999" + X-Msedge-Ref: + - 'Ref A: DC965079E2EA4358A8BC3C8C49F5BE2D Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:15Z' + status: 202 Accepted + code: 202 + duration: 2.662946381s + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceBus/locations/westus2/namespaceOperationResults/2d950154-97f2-4b2b-8b92-b656ed3d1210?isAsyncHeader=false&resourceName=asotest-namespace-nfctrx&resourceType=namespace&api-version=2024-01-01&operationType=Deleted&t=638743245776800502&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=A6W-l0iigbhTHl93WK5ZOSjzm50GBSVNQC4lEg8mzgMUMCwWjf50z27D0GTkv0QMVq0UDCJICuQqr3El6n4MD5aowFRK3nk9wKtNOFYvRsuMGeatd7ZgwlUJ0ZRvxfxKkcXQv2ALjYXmVxVRyQAJ0xI6sYBMg8Lok5ubcaLJ1Z6p_8183RTnTclFoM3bJcqxR1QhkUdJeN7cpWCtTwWD1VaOhaIoewa96P_GXwp2woNomeLVxvhVRqU-jVOaE9k_Z2Fu4IrcUsfPeLh7v5KiXNaNFSysdIN6wslYoMWf1UtWPS4Sfm8AjUoVLaKb6aQ5sb-vbJnMTfnnsGWiAp_LZA&h=zLvrF-kV89xfm9ujw_bk6vqgRRlRJR67gBs8kzAOBR4 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceBus/locations/westus2/namespaceOperationResults/2d950154-97f2-4b2b-8b92-b656ed3d1210?isAsyncHeader=false&resourceName=asotest-namespace-nfctrx&resourceType=namespace&api-version=2024-01-01&operationType=Deleted&t=638743245824868524&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=CzPHis3wF2062ieneGG-LAhckNOYKrYdoKSi4nJGtWdHdU4gqTT0Kia-BztYH62PSY7-DbUab0v8wCEltO-eSi7ujUZWhdFf3B_0xleS8Igo3S_hscjxbjSdrJQZs3o1GuslOYcowcGZBonl0jFMjFe_P9X_tlMbiTA2czuZ6L-7cJ72ul4G4CwrJIMUeqYWWfbQdHtLb0zDBSCY_jfaL9TnyaGC8BQYaAdaSZEUusgoLipofpxseDxDiurA5QAqd7XyYjwAlhuxOzSJXx_kfY5xtNsFevLH4hpJqnC94njgGgfWjvDbC0PnD-mrPWuQccXlHbwnxiCMrBQ6FaxnSg&h=yo2dluS7a3jioE1Rd7eri4zWjOCQQsFytUXV2_w9prg + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000006416 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G13|2025-02-05T03:56:22 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: CEE8CB8EBCA0493988A396D8A4B68211 Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:21Z' + status: 204 No Content + code: 204 + duration: 990.35981ms + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-nfctrx?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 97 + uncompressed: false + body: '{"error":{"code":"NamespaceNotFound","message":"Namespace ''asotest-namespace-nfctrx'' not found"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "97" + Content-Type: + - application/json + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - d003996c-8a10-4888-af50-24175b398549 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G14|2025-02-05T03:56:26 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: E359161EAEE24D92852E99AEAD089576 Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:25Z' + status: 404 Not Found + code: 404 + duration: 2.611524312s + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-qqelci?api-version=2020-06-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRUUVMQ0ktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638743245957719777&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=E3ot7xF6ZhLsCBg5fYfPMU6cnNz9lCG48fCgsuyDq52QGD1N66_u36wRLsGowDJrlwRK04AskqsEcQWtjDo5c2QQ22wztmdEoSR9L-1wA-Yg4RV8XfOfdyFptinAFDRFkuqf_AvSrvjKLJ4Y3pvbEVOKO1ODI78NVhplO_4k4IC9ewP8bJFinKAKZQ91J0-dc1Q3TcIqGdkTbS6iJV8J9cB2-rUE4YvvZutZ-7_jEUmQaULWw7T6OzNNwYdvFYoWOtcrqA8Xk8aF4Ofq4mIUA3W_yA2scNzryP3HMa_IrQbRIIsva0TO4Sc5_pKB8GJ4c9_PhxtiJBdKh9MYPhibAQ&h=9M731mBVnN0V1gTeCkJ7sKMX4iizC6hOQBFGjFC3YvQ + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 8806F582F06749B888D8DA1FCD23CC8B Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:31Z' + status: 202 Accepted + code: 202 + duration: 4.487607666s + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRRUUVMQ0ktV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638743245957719777&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=E3ot7xF6ZhLsCBg5fYfPMU6cnNz9lCG48fCgsuyDq52QGD1N66_u36wRLsGowDJrlwRK04AskqsEcQWtjDo5c2QQ22wztmdEoSR9L-1wA-Yg4RV8XfOfdyFptinAFDRFkuqf_AvSrvjKLJ4Y3pvbEVOKO1ODI78NVhplO_4k4IC9ewP8bJFinKAKZQ91J0-dc1Q3TcIqGdkTbS6iJV8J9cB2-rUE4YvvZutZ-7_jEUmQaULWw7T6OzNNwYdvFYoWOtcrqA8Xk8aF4Ofq4mIUA3W_yA2scNzryP3HMa_IrQbRIIsva0TO4Sc5_pKB8GJ4c9_PhxtiJBdKh9MYPhibAQ&h=9M731mBVnN0V1gTeCkJ7sKMX4iizC6hOQBFGjFC3YvQ + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: C5359BFF46964D55B8E61CB166907DC9 Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:56Z' + status: 200 OK + code: 200 + duration: 1.109181499s diff --git a/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Standard_v1api20240101_CRUD.yaml b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Standard_v1api20240101_CRUD.yaml new file mode 100644 index 00000000000..1d13d91bbaf --- /dev/null +++ b/v2/internal/controllers/recordings/Test_ServiceBus_Namespace_Standard_v1api20240101_CRUD.yaml @@ -0,0 +1,1768 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 93 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westus2","name":"asotest-rg-gwclgz","tags":{"CreatedAt":"2001-02-03T04:05:06Z"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "93" + Content-Type: + - application/json + Test-Request-Hash: + - 7fd94c4759f88d1eaa93806cbea8398b940b8997247f4d0d3aa84b8393ebf6bb + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz?api-version=2020-06-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 276 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz","name":"asotest-rg-gwclgz","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "276" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 75AEEBC545454C9CA120DAA8D76516C2 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:01Z' + status: 201 Created + code: 201 + duration: 3.86006255s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz?api-version=2020-06-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 276 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz","name":"asotest-rg-gwclgz","type":"Microsoft.Resources/resourceGroups","location":"westus2","tags":{"CreatedAt":"2001-02-03T04:05:06Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "276" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 43DB2A5E8CED498A8E436155D435C5DA Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:08Z' + status: 200 OK + code: 200 + duration: 390.885763ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 119 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westus2","name":"asotest-namespace-oasony","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "119" + Content-Type: + - application/json + Test-Request-Hash: + - 0dc955a9ddfa11c0867fe016b326a6fc76b37c89524326c9b141fa33fc7fc2c4 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 905 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony","name":"asotest-namespace-oasony","type":"Microsoft.ServiceBus/Namespaces","location":"westus2","tags":{},"properties":{"geoDataReplication":{"maxReplicationLagDurationInSeconds":0,"locations":[{"locationName":"westus2","roleType":"Primary","replicaState":"InBuild"}]},"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":true,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-oasony","serviceBusEndpoint":"https://asotest-namespace-oasony.servicebus.windows.net:443/","provisioningState":"Creating","status":"Creating","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "905" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - c9b95281-5667-4175-b533-3f1a7037752e + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G13|2025-02-05T03:55:18 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 65D5AC0D825A4DE3B48EA44962716B2C Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:13Z' + status: 201 Created + code: 201 + duration: 5.369376933s + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 902 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony","name":"asotest-namespace-oasony","type":"Microsoft.ServiceBus/Namespaces","location":"westus2","tags":{},"properties":{"geoDataReplication":{"maxReplicationLagDurationInSeconds":0,"locations":[{"locationName":"westus2","roleType":"Primary","replicaState":"Ready"}]},"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":true,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-oasony","serviceBusEndpoint":"https://asotest-namespace-oasony.servicebus.windows.net:443/","provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "902" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 0c5b53e9-88cc-4c11-8665-3f864cdb31e9 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G8|2025-02-05T03:55:28 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 8F19344851E449E98FF434A309058C55 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:27Z' + status: 200 OK + code: 200 + duration: 1.166079999s + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 902 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony","name":"asotest-namespace-oasony","type":"Microsoft.ServiceBus/Namespaces","location":"westus2","tags":{},"properties":{"geoDataReplication":{"maxReplicationLagDurationInSeconds":0,"locations":[{"locationName":"westus2","roleType":"Primary","replicaState":"Ready"}]},"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":true,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-oasony","serviceBusEndpoint":"https://asotest-namespace-oasony.servicebus.windows.net:443/","provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "902" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 867721b7-580b-4e04-8e76-adc5e28baa01 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G3|2025-02-05T03:55:30 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: AAE1FE2BE46D49F68A431E3AD81B1C18 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:29Z' + status: 200 OK + code: 200 + duration: 1.096729563s + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 31 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotest-topic-zrcxcl"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "31" + Content-Type: + - application/json + Test-Request-Hash: + - b6c4706e943bf4c1209246e0ce6dfaad173ee9fca5286fb95975d41c011ea5bb + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 969 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl","name":"asotest-topic-zrcxcl","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-Length: + - "969" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 4e58a781-8e93-48a6-8708-9ef602e596cd + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G2|2025-02-05T03:55:37 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 6C7E82C91D06465D82F22DC6C31AACD6 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:34Z' + status: 200 OK + code: 200 + duration: 3.35347522s + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 31 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotest-queue-cjxazc"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "31" + Content-Type: + - application/json + Test-Request-Hash: + - b2ef33e0f446197029b5f2303d51fcbb833887fe641599df7819df3c59c442f0 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/queues/asotest-queue-cjxazc?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1050 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/queues/asotest-queue-cjxazc","name":"asotest-queue-cjxazc","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-Length: + - "1050" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 26f03352-60cc-4131-8f6f-9aeb09e6f1fe + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G2|2025-02-05T03:55:37 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: E25CD346D333415C82C128D6E4C2ABC1 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:34Z' + status: 200 OK + code: 200 + duration: 3.738864856s + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 72 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotest-rule-cabdiu","properties":{"rights":["Listen","Send"]}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "72" + Content-Type: + - application/json + Test-Request-Hash: + - 35ba507e32a9a3ac3becccb395db0a4a5deb5d1d41e627b342939b35f4327f98 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/AuthorizationRules/asotest-rule-cabdiu?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 351 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/AuthorizationRules/asotest-rule-cabdiu","name":"asotest-rule-cabdiu","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"westus2","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "351" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 8efa769d-1315-4644-9385-b874b97d7028 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G12|2025-02-05T03:55:42 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "12000" + X-Msedge-Ref: + - 'Ref A: 31FF0FD2B94A4EC4A44AA07BDF69BFB0 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:34Z' + status: 200 OK + code: 200 + duration: 7.781826926s + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 970 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl","name":"asotest-topic-zrcxcl","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-Length: + - "970" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 20666cd9-599e-493c-8e48-35bdf7e8d96a + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G12|2025-02-05T03:55:42 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 92BFA3B7AD3E4DA7B2A37304AFBF4BB4 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:41Z' + status: 200 OK + code: 200 + duration: 1.113988454s + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/queues/asotest-queue-cjxazc?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 1051 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/queues/asotest-queue-cjxazc","name":"asotest-queue-cjxazc","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-Length: + - "1051" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 50942a44-f7d0-4745-883a-51aa1db41e82 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G6|2025-02-05T03:55:42 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 250C268A52B640B894FBF6646447EFE9 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:42Z' + status: 200 OK + code: 200 + duration: 549.159213ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/queues/asotest-queue-cjxazc?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000001284 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G2|2025-02-05T03:55:44 + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "11999" + X-Msedge-Ref: + - 'Ref A: BA79361594004538B6850776BEE5A6ED Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:43Z' + status: 200 OK + code: 200 + duration: 1.130679626s + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/AuthorizationRules/asotest-rule-cabdiu?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 351 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/authorizationrules/asotest-rule-cabdiu","name":"asotest-rule-cabdiu","type":"Microsoft.ServiceBus/Namespaces/AuthorizationRules","location":"westus2","properties":{"rights":["Listen","Send"]}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "351" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - a6a048ae-c552-417b-b7cd-fa13df3bc458 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G6|2025-02-05T03:55:51 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: A9CFDD07E1A54E15AB9879296805B5C7 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:50Z' + status: 200 OK + code: 200 + duration: 1.218405026s + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 38 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotest-subscription-ysnblz"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "38" + Content-Type: + - application/json + Test-Request-Hash: + - bbe661124d204e9edcb4aac1f7f6439d884f9182c76c0fe80187236c78334ec5 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl/subscriptions/asotest-subscription-ysnblz?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 990 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl/subscriptions/asotest-subscription-ysnblz","name":"asotest-subscription-ysnblz","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-Length: + - "990" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 5bf76548-b695-41f8-8212-7f088b0e69de + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G14|2025-02-05T03:55:52 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: D19346FDEEE74A38BD2F6ACC9842292B Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:50Z' + status: 200 OK + code: 200 + duration: 3.174098887s + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/AuthorizationRules/asotest-rule-cabdiu/listKeys?api-version=2021-11-01 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 541 + uncompressed: false + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-oasony.servicebus.windows.net/;SharedAccessKeyName=asotest-rule-cabdiu;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-oasony.servicebus.windows.net/;SharedAccessKeyName=asotest-rule-cabdiu;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"asotest-rule-cabdiu"}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "541" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 97b4148c-ef9c-466c-8dce-46de38c19452 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G10|2025-02-05T03:55:54 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 5BA868AABAF04AA589EB7D06E42F0916 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:53Z' + status: 200 OK + code: 200 + duration: 1.40716587s + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl/subscriptions/asotest-subscription-ysnblz?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 995 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl/subscriptions/asotest-subscription-ysnblz","name":"asotest-subscription-ysnblz","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-Length: + - "995" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - bc218fad-779a-4bac-ab48-8ec7f78aa506 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G7|2025-02-05T03:55:57 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 5D2DB2BAEC054336BECEBD5B7A51CFF3 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:56Z' + status: 200 OK + code: 200 + duration: 1.034439181s + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 33 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"name":"asotest-subrule-tnzvjb"}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "33" + Content-Type: + - application/json + Test-Request-Hash: + - 20619d08960310efa50fa9a75c4f00f19ea039bf52f39dcf8fbdadc2776cde20 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl/subscriptions/asotest-subscription-ysnblz/rules/asotest-subrule-tnzvjb?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 492 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl/subscriptions/asotest-subscription-ysnblz/rules/asotest-subrule-tnzvjb","name":"asotest-subrule-tnzvjb","type":"Microsoft.ServiceBus/namespaces/topics/subscriptions/rules","location":"westus2","properties":{"action":{},"filterType":"SqlFilter","sqlFilter":{"sqlExpression":"1=1","compatibilityLevel":20}}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "492" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 4348d171-1591-4548-add3-aa9df69c003d + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G2|2025-02-05T03:56:02 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 7B5A81A621144E8999DD7B486299BA7A Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:00Z' + status: 200 OK + code: 200 + duration: 2.711140872s + - id: 16 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/AuthorizationRules/asotest-rule-cabdiu?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000004912 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G9|2025-02-05T03:56:06 + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "12000" + X-Msedge-Ref: + - 'Ref A: 36747D4610F24F9E9B77C9CC03B660B4 Ref B: MAA201060514031 Ref C: 2025-02-05T03:55:59Z' + status: 200 OK + code: 200 + duration: 6.640663359s + - id: 17 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl/subscriptions/asotest-subscription-ysnblz/rules/asotest-subrule-tnzvjb?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 508 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl/subscriptions/asotest-subscription-ysnblz/rules/asotest-subrule-tnzvjb","name":"asotest-subrule-tnzvjb","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-Length: + - "508" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 6e8e36ba-8975-4024-a7c7-b6f222cdbbae + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G7|2025-02-05T03:56:06 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 7DE50D4DE13A42AB8CC543230C47AD02 Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:06Z' + status: 200 OK + code: 200 + duration: 546.331061ms + - id: 18 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl/subscriptions/asotest-subscription-ysnblz/rules/asotest-subrule-tnzvjb?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000006416 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G13|2025-02-05T03:56:11 + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "11999" + X-Msedge-Ref: + - 'Ref A: A8241E5D0EE44B0C8DB99847484A25BF Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:09Z' + status: 200 OK + code: 200 + duration: 1.326075647s + - id: 19 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl/subscriptions/asotest-subscription-ysnblz/rules/asotest-subrule-tnzvjb?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 73 + uncompressed: false + 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 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 1ed747b8-9fb3-483b-ad25-b55b9035df20 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G11|2025-02-05T03:56:17 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 79C58243786F472283B2384E766ADD23 Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:15Z' + status: 404 Not Found + code: 404 + duration: 2.058722485s + - id: 20 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl/subscriptions/asotest-subscription-ysnblz?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000003012 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G10|2025-02-05T03:56:20 + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "11999" + X-Msedge-Ref: + - 'Ref A: B215F52B13E54E7B898E2D0E146FEF52 Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:19Z' + status: 200 OK + code: 200 + duration: 1.121307724s + - id: 21 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "1" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl/subscriptions/asotest-subscription-ysnblz?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 81 + uncompressed: false + 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 + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 6646f00b-64a0-40b8-af43-8f1700ffee6b + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G1|2025-02-05T03:56:26 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: DA92C053D095495EB2EF53ADBF650132 Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:25Z' + status: 404 Not Found + code: 404 + duration: 1.457577036s + - id: 22 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/topics/asotest-topic-zrcxcl?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000004724 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G1|2025-02-05T03:56:29 + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "11999" + X-Msedge-Ref: + - 'Ref A: F52A0AEE4595404481E6F7244437B0B7 Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:28Z' + status: 200 OK + code: 200 + duration: 1.172122078s + - id: 23 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 119 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: '{"location":"westus2","name":"asotest-namespace-oasony","properties":{"zoneRedundant":false},"sku":{"name":"Standard"}}' + form: {} + headers: + Accept: + - application/json + Content-Length: + - "119" + Content-Type: + - application/json + Test-Request-Hash: + - 0dc955a9ddfa11c0867fe016b326a6fc76b37c89524326c9b141fa33fc7fc2c4 + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony?api-version=2024-01-01 + method: PUT + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 902 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony","name":"asotest-namespace-oasony","type":"Microsoft.ServiceBus/Namespaces","location":"westus2","tags":{},"properties":{"geoDataReplication":{"maxReplicationLagDurationInSeconds":0,"locations":[{"locationName":"westus2","roleType":"Primary","replicaState":"Ready"}]},"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":true,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-oasony","serviceBusEndpoint":"https://asotest-namespace-oasony.servicebus.windows.net:443/","provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "902" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 1668e688-f04b-49a7-9dcf-9cfdff907203 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G8|2025-02-05T03:56:37 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 51C69ECE1F584808BD3BCFA6CF7FF1B0 Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:33Z' + status: 200 OK + code: 200 + duration: 5.02407666s + - id: 24 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "2" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 902 + uncompressed: false + body: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony","name":"asotest-namespace-oasony","type":"Microsoft.ServiceBus/Namespaces","location":"westus2","tags":{},"properties":{"geoDataReplication":{"maxReplicationLagDurationInSeconds":0,"locations":[{"locationName":"westus2","roleType":"Primary","replicaState":"Ready"}]},"premiumMessagingPartitions":0,"minimumTlsVersion":"1.2","publicNetworkAccess":"Enabled","disableLocalAuth":false,"zoneRedundant":true,"metricId":"00000000-0000-0000-0000-000000000000:asotest-namespace-oasony","serviceBusEndpoint":"https://asotest-namespace-oasony.servicebus.windows.net:443/","provisioningState":"Succeeded","status":"Active","createdAt":"2001-02-03T04:05:06Z","updatedAt":"2001-02-03T04:05:06Z"},"sku":{"name":"Standard","tier":"Standard"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "902" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - d0282929-6235-40e7-a787-f8baa4107f13 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G7|2025-02-05T03:56:44 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 1A8F854035F745B78DA90C5791C82A8F Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:43Z' + status: 200 OK + code: 200 + duration: 1.295090052s + - id: 25 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony/AuthorizationRules/RootManageSharedAccessKey/listKeys?api-version=2021-11-01 + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 559 + uncompressed: false + body: '{"primaryConnectionString":"Endpoint=sb://asotest-namespace-oasony.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","secondaryConnectionString":"Endpoint=sb://asotest-namespace-oasony.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey={KEY}","primaryKey":"{KEY}","secondaryKey":"{KEY}","keyName":"RootManageSharedAccessKey"}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "559" + Content-Type: + - application/json; charset=utf-8 + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - c332dd41-a529-486a-a09d-62b246303806 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G7|2025-02-05T03:56:48 + X-Ms-Ratelimit-Remaining-Subscription-Global-Writes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 781AACD34F624014A4059F6E01FC017A Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:46Z' + status: 200 OK + code: 200 + duration: 1.460232501s + - id: 26 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony?api-version=2024-01-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceBus/locations/westus2/namespaceOperationResults/fe3ae655-fab2-485e-af78-9f09e85b5c5d?isAsyncHeader=false&resourceName=asotest-namespace-oasony&resourceType=namespace&api-version=2024-01-01&operationType=Deleted&t=638743246169834491&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=q-TDLhQcIy3zRhzsSBu98aLdbKp0_GhzZZ6wlVBBvuPXASdJkoX3S2-Q05DDz13nt6H1VJlPuZS4I5fOShmBMAaoRhjMWgaQoqOPrsHvs6qpwZ7wj0eQES5-8PBkpXbbvqR5VzQJtlnFXsGmCJg9CzQazjjFIn26w47mOfIAQC5SupSdmoPLWGMMOUgwfYP16WQi3YEyANv1urJ3uf6aMUew4il_DB68DBkStydLs4FiB1vdKCcRzE7T7WYQz3_GCwbuNVG6JMYhkOGRU2k1ZEKwsO4Pz1CxzDThb9GzFARzDfit4uhtS_Ib7pLI7SaHKDhWJyfa1FWcQAxCqONjAg&h=4h_ZOJYFKwrGe2sRKQGuZin8-C-33EsD5p8-US4Gm2o + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000005732 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G12|2025-02-05T03:56:56 + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 1F83977D235F45F9B58FC5A76EDA6B37 Ref B: MAA201060514031 Ref C: 2025-02-05T03:56:54Z' + status: 202 Accepted + code: 202 + duration: 2.847962832s + - id: 27 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceBus/locations/westus2/namespaceOperationResults/fe3ae655-fab2-485e-af78-9f09e85b5c5d?isAsyncHeader=false&resourceName=asotest-namespace-oasony&resourceType=namespace&api-version=2024-01-01&operationType=Deleted&t=638743246169834491&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=q-TDLhQcIy3zRhzsSBu98aLdbKp0_GhzZZ6wlVBBvuPXASdJkoX3S2-Q05DDz13nt6H1VJlPuZS4I5fOShmBMAaoRhjMWgaQoqOPrsHvs6qpwZ7wj0eQES5-8PBkpXbbvqR5VzQJtlnFXsGmCJg9CzQazjjFIn26w47mOfIAQC5SupSdmoPLWGMMOUgwfYP16WQi3YEyANv1urJ3uf6aMUew4il_DB68DBkStydLs4FiB1vdKCcRzE7T7WYQz3_GCwbuNVG6JMYhkOGRU2k1ZEKwsO4Pz1CxzDThb9GzFARzDfit4uhtS_Ib7pLI7SaHKDhWJyfa1FWcQAxCqONjAg&h=4h_ZOJYFKwrGe2sRKQGuZin8-C-33EsD5p8-US4Gm2o + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: -1 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceBus/locations/westus2/namespaceOperationResults/fe3ae655-fab2-485e-af78-9f09e85b5c5d?isAsyncHeader=false&resourceName=asotest-namespace-oasony&resourceType=namespace&api-version=2024-01-01&operationType=Deleted&t=638743246219821170&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=Ptfvlee605hDwhNTmA-MfKykxVgacxd7YSF3dNpF4rpxv_B9apnBB7eckdRn0mkPv6BzTgGn5D-Yu1bI2AwlPBgof6mrp4Mfs-HrIIcISlYbBamxy2eGcPmfcD-locVmwVVuYBGKlKMrmGl7nbg08P_sR8ixJzc9i3OIT5vR7vLL779k2MTJ0joa0bJVTtPUpyJM4xPxdYgRgytcvKq1a1giJUeCXrZqAUfZ9alhtfvAo0kipqgogX8EwoLcMgSuMZYSgX3g5u5D6A_kCYD0y2PVIFmSltpSY_MZZPYfGyv3UT-8K2XrsP8moupx92MYP9_BqCDlXyhzKbrdi6xSWQ&h=om25UE-PppzFm3yRnTbAbC3lgs2VZ4wwNRGXh1Dxt1g + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 00000001-0000-0000-0002-000000004912 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G9|2025-02-05T03:57:01 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16498" + X-Msedge-Ref: + - 'Ref A: A8E52991B5DF48F7A0B254CADA986A2A Ref B: MAA201060514031 Ref C: 2025-02-05T03:57:01Z' + status: 204 No Content + code: 204 + duration: 912.853965ms + - id: 28 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "3" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz/providers/Microsoft.ServiceBus/namespaces/asotest-namespace-oasony?api-version=2024-01-01 + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 97 + uncompressed: false + body: '{"error":{"code":"NamespaceNotFound","message":"Namespace ''asotest-namespace-oasony'' not found"}}' + headers: + Cache-Control: + - no-cache + Content-Length: + - "97" + Content-Type: + - application/json + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Messaging-Activity-Id: + - 94ee4fc8-7b49-48ad-8b98-832b33090f89 + X-Ms-Messaging-Routing-Id: + - WESTUS2|WESTUS2|G10|2025-02-05T03:57:05 + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: 311F955E987F4747AD248B9B483CD4BF Ref B: MAA201060514031 Ref C: 2025-02-05T03:57:04Z' + status: 404 Not Found + code: 404 + duration: 2.548372838s + - id: 29 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Accept: + - application/json + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/asotest-rg-gwclgz?api-version=2020-06-01 + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRHV0NMR1otV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638743246341856873&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=EzRkOsz1OM0VyBpsE22zfHyttHGAeq74OSmYLCsaAk66z9ebQnQTH0Xw2I9oIghVbac2JAkn8-fDEZUcTmPjn4cPBB4Zf6wH5C6LAaE92rjk29WVuGywzgGbzna4bB1I3plpBwuVulqM2J0d1Zv7NwUhsxJTosGHXdgV7YzOsnXRf-t7kwPt17CQDODMqve0t0-_jiFUoYeRid9s7EPpBai-VbstY-tMS9fN8p-m0eMwnP2AftYy0jE1-08ZIC26x4xu_YM-u6GaR-kSlq4See4fLrx1-tZi0IHT5dWrRBDIKtH1uDecd3IVZkXVImFHIWYiGk2gAGDpEGJHYx-f9A&h=RU3yuS9Ul14EU5eyJLe0XCsCLxdEuVkdUkO7EHbV2Mo + Pragma: + - no-cache + Retry-After: + - "15" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Deletes: + - "11999" + X-Msedge-Ref: + - 'Ref A: 12E047AB70BD472186082AD491C9A236 Ref B: MAA201060514031 Ref C: 2025-02-05T03:57:10Z' + status: 202 Accepted + code: 202 + duration: 4.075953535s + - id: 30 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [] + trailer: {} + host: management.azure.com + remote_addr: "" + request_uri: "" + body: "" + form: {} + headers: + Test-Request-Attempt: + - "0" + url: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BU09URVNUOjJEUkc6MkRHV0NMR1otV0VTVFVTMiIsImpvYkxvY2F0aW9uIjoid2VzdHVzMiJ9?api-version=2020-06-01&t=638743246341856873&c=MIIHpTCCBo2gAwIBAgITfwTbn828Ducmmj24MgAEBNufzTANBgkqhkiG9w0BAQsFADBEMRMwEQYKCZImiZPyLGQBGRYDR0JMMRMwEQYKCZImiZPyLGQBGRYDQU1FMRgwFgYDVQQDEw9BTUUgSW5mcmEgQ0EgMDIwHhcNMjUwMTI1MTI1MTUzWhcNMjUwNzI0MTI1MTUzWjBAMT4wPAYDVQQDEzVhc3luY29wZXJhdGlvbnNpZ25pbmdjZXJ0aWZpY2F0ZS5tYW5hZ2VtZW50LmF6dXJlLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL20TJQJbhV5Jrwzn-fiGrag_COjmaTwDy9Ir0oe1CLIfiJ9ageBVfcEmW-k5bUVL3eg6B8mQTEYE-FJDVVZ4jbJ9Qw8REpm2kBASDRwoItVVD_HBpJf1VhdViEPJPMDvLg0mAmde0X2m3HVEO6Y7eggJ9iL31DDv9PF-Xvn6x9xlWvO3_OCJReOoV_HCTDyzds4Pq9OySlnAGAozKYzOumbcVPz_WEMc_vwW80fjQLmdihJgp6_15qlnMdx48MQhVGT3y4gdbknMQJghyzTFcsASVncSqtmz8nAx5qT9dZ63iaF6E7Fbx76fnF4lx5K72ANX5cjlfVOig5jzgf8RPkCAwEAAaOCBJIwggSOMCcGCSsGAQQBgjcVCgQaMBgwCgYIKwYBBQUHAwEwCgYIKwYBBQUHAwIwPQYJKwYBBAGCNxUHBDAwLgYmKwYBBAGCNxUIhpDjDYTVtHiE8Ys-hZvdFs6dEoFghfmRS4WsmTQCAWQCAQcwggHaBggrBgEFBQcBAQSCAcwwggHIMGYGCCsGAQUFBzAChlpodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpaW5mcmEvQ2VydHMvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmwxLmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MFYGCCsGAQUFBzAChkpodHRwOi8vY3JsMi5hbWUuZ2JsL2FpYS9CTDJQS0lJTlRDQTAxLkFNRS5HQkxfQU1FJTIwSW5mcmElMjBDQSUyMDAyKDQpLmNydDBWBggrBgEFBQcwAoZKaHR0cDovL2NybDMuYW1lLmdibC9haWEvQkwyUEtJSU5UQ0EwMS5BTUUuR0JMX0FNRSUyMEluZnJhJTIwQ0ElMjAwMig0KS5jcnQwVgYIKwYBBQUHMAKGSmh0dHA6Ly9jcmw0LmFtZS5nYmwvYWlhL0JMMlBLSUlOVENBMDEuQU1FLkdCTF9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3J0MB0GA1UdDgQWBBQp8DW_okjTMbIBWANCvQr_FrvzazAOBgNVHQ8BAf8EBAMCBaAwggE1BgNVHR8EggEsMIIBKDCCASSgggEgoIIBHIZCaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraWluZnJhL0NSTC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMS5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMi5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsMy5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JshjRodHRwOi8vY3JsNC5hbWUuZ2JsL2NybC9BTUUlMjBJbmZyYSUyMENBJTIwMDIoNCkuY3JsMIGdBgNVHSAEgZUwgZIwDAYKKwYBBAGCN3sBATBmBgorBgEEAYI3ewICMFgwVgYIKwYBBQUHAgIwSh5IADMAMwBlADAAMQA5ADIAMQAtADQAZAA2ADQALQA0AGYAOABjAC0AYQAwADUANQAtADUAYgBkAGEAZgBmAGQANQBlADMAMwBkMAwGCisGAQQBgjd7AwIwDAYKKwYBBAGCN3sEAjAfBgNVHSMEGDAWgBSuecJrXSWIEwb2BwnDl3x7l48dVTAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAA5sOyKXcQwQQAVKz9J8GIjVymZkoHVSft4TqdgNxSdoIAYkk_tYdx_dEZChJfSvIfzhzAb8k57EHRKNwKtP752SSUr0Q0oB60Y3Fq7il1fMKFTbVk9ZMTyOoo3hJmRwJaisv9rK2UVHWvwD2iUKD0IK_tHwy3m6bqbGDVKaRn1K9UYM39wEvEdy-k8J2z3Olfn6yYpcrVBHWzDzSy7TVdgUzaa0IZ670aJGPrNVYMvsCepP2_T_FdHVk4LoK9K4_0-GkZbvBLZPQO6FYgttg78s6Nn34TUcXWeTeeXArlkf48rbeL5fDY_CJyKYXLv3arwG7gUdcU5T8MGHeLLzcyo&s=EzRkOsz1OM0VyBpsE22zfHyttHGAeq74OSmYLCsaAk66z9ebQnQTH0Xw2I9oIghVbac2JAkn8-fDEZUcTmPjn4cPBB4Zf6wH5C6LAaE92rjk29WVuGywzgGbzna4bB1I3plpBwuVulqM2J0d1Zv7NwUhsxJTosGHXdgV7YzOsnXRf-t7kwPt17CQDODMqve0t0-_jiFUoYeRid9s7EPpBai-VbstY-tMS9fN8p-m0eMwnP2AftYy0jE1-08ZIC26x4xu_YM-u6GaR-kSlq4See4fLrx1-tZi0IHT5dWrRBDIKtH1uDecd3IVZkXVImFHIWYiGk2gAGDpEGJHYx-f9A&h=RU3yuS9Ul14EU5eyJLe0XCsCLxdEuVkdUkO7EHbV2Mo + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 0 + uncompressed: false + body: "" + headers: + Cache-Control: + - no-cache + Content-Length: + - "0" + Expires: + - "-1" + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=31536000; includeSubDomains + X-Cache: + - CONFIG_NOCACHE + X-Content-Type-Options: + - nosniff + X-Ms-Ratelimit-Remaining-Subscription-Global-Reads: + - "16499" + X-Msedge-Ref: + - 'Ref A: BCD9A856E6F74AB88512D2DAD848A59B Ref B: MAA201060514031 Ref C: 2025-02-05T03:57:34Z' + status: 200 OK + code: 200 + duration: 1.337725354s diff --git a/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20210101preview_test.go b/v2/internal/controllers/servicebus_namespace_basic_v1api20210101preview_test.go similarity index 100% rename from v2/internal/controllers/crd_servicebus_namespace_basic_v1api20210101preview_test.go rename to v2/internal/controllers/servicebus_namespace_basic_v1api20210101preview_test.go diff --git a/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20211101_test.go b/v2/internal/controllers/servicebus_namespace_basic_v1api20211101_test.go similarity index 100% rename from v2/internal/controllers/crd_servicebus_namespace_basic_v1api20211101_test.go rename to v2/internal/controllers/servicebus_namespace_basic_v1api20211101_test.go diff --git a/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20221001preview_test.go b/v2/internal/controllers/servicebus_namespace_basic_v1api20221001preview_test.go similarity index 100% rename from v2/internal/controllers/crd_servicebus_namespace_basic_v1api20221001preview_test.go rename to v2/internal/controllers/servicebus_namespace_basic_v1api20221001preview_test.go diff --git a/v2/internal/controllers/servicebus_namespace_basic_v1api20240101_test.go b/v2/internal/controllers/servicebus_namespace_basic_v1api20240101_test.go new file mode 100644 index 00000000000..899f85c97b8 --- /dev/null +++ b/v2/internal/controllers/servicebus_namespace_basic_v1api20240101_test.go @@ -0,0 +1,114 @@ +/* +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/v1api20240101" + "github.com/Azure/azure-service-operator/v2/internal/testcommon" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" +) + +func Test_ServiceBus_Namespace_Basic_v1api20240101_CRUD(t *testing.T) { + t.Parallel() + + tc := globalTestContext.ForTest(t) + + rg := tc.CreateTestResourceGroupAndWait() + + sku := servicebus.SBSku_Name_Basic + namespace := NewServiceBusNamespace_v1api20240101(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_v1api20240101_CRUD(tc, namespace) + }, + }, + ) + + // This must run at the end as it modifies the namespace + tc.RunSubtests( + testcommon.Subtest{ + Name: "Namespace secrets", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_Namespace_Secrets_v1api20240101(tc, namespace) + }, + }) + + tc.DeleteResourceAndWait(namespace) + + // Ensure that the resource was really deleted in Azure + tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) +} + +func ServiceBus_NamespacesQueue_v1api20240101_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { + queue := &servicebus.NamespacesQueue{ + ObjectMeta: tc.MakeObjectMeta("queue"), + Spec: servicebus.NamespacesQueue_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_v1api20240101(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { + namespace := sbNamespace.(*servicebus.Namespace) + secretName := "namespace-secrets-20240101" + + 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/servicebus_namespace_standard_v1api20210101preview_test.go similarity index 100% rename from v2/internal/controllers/crd_servicebus_namespace_standard_v1api20210101preview_test.go rename to v2/internal/controllers/servicebus_namespace_standard_v1api20210101preview_test.go diff --git a/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20211101_test.go b/v2/internal/controllers/servicebus_namespace_standard_v1api20211101_test.go similarity index 100% rename from v2/internal/controllers/crd_servicebus_namespace_standard_v1api20211101_test.go rename to v2/internal/controllers/servicebus_namespace_standard_v1api20211101_test.go diff --git a/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20221001preview_test.go b/v2/internal/controllers/servicebus_namespace_standard_v1api20221001preview_test.go similarity index 100% rename from v2/internal/controllers/crd_servicebus_namespace_standard_v1api20221001preview_test.go rename to v2/internal/controllers/servicebus_namespace_standard_v1api20221001preview_test.go diff --git a/v2/internal/controllers/servicebus_namespace_standard_v1api20240101_test.go b/v2/internal/controllers/servicebus_namespace_standard_v1api20240101_test.go new file mode 100644 index 00000000000..266639dc01c --- /dev/null +++ b/v2/internal/controllers/servicebus_namespace_standard_v1api20240101_test.go @@ -0,0 +1,199 @@ +/* +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/v1api20240101" + "github.com/Azure/azure-service-operator/v2/internal/testcommon" + "github.com/Azure/azure-service-operator/v2/pkg/genruntime" +) + +func Test_ServiceBus_Namespace_Standard_v1api20240101_CRUD(t *testing.T) { + t.Parallel() + + tc := globalTestContext.ForTest(t) + + rg := tc.CreateTestResourceGroupAndWait() + + sku := servicebus.SBSku_Name_Standard + namespace := NewServiceBusNamespace_v1api20240101(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_v1api20240101_CRUD(tc, namespace) + }, + }, + testcommon.Subtest{ + Name: "Topic CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_Topic_v1api20240101_CRUD(tc, namespace) + }, + }, + testcommon.Subtest{ + Name: "AuthorizationRule CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_AuthorizationRule_v1api20240101_CRUD(tc, namespace) + }, + }, + ) + + // This must run at the end as it modifies the namespace. + tc.RunSubtests( + testcommon.Subtest{ + Name: "NamespaceSecrets CRUD", + Test: func(tc *testcommon.KubePerTestContext) { + ServiceBus_Namespace_Secrets_v1api20240101(tc, namespace) + }, + }) + + tc.DeleteResourceAndWait(namespace) + + // Ensure that the resource was really deleted in Azure + tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) +} + +func NewServiceBusNamespace_v1api20240101(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_AuthorizationRule_v1api20240101_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { + secretName := "rule-secrets" + + rule := &servicebus.NamespacesAuthorizationRule{ + ObjectMeta: tc.MakeObjectMetaWithName(tc.Namer.GenerateName("rule")), + Spec: servicebus.NamespacesAuthorizationRule_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_Topic_v1api20240101_CRUD(tc *testcommon.KubePerTestContext, sbNamespace client.Object) { + topic := &servicebus.NamespacesTopic{ + ObjectMeta: tc.MakeObjectMeta("topic"), + Spec: servicebus.NamespacesTopic_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_Subscription_v1api20240101_CRUD(tc, topic) }, + }, + ) +} + +func ServiceBus_Subscription_v1api20240101_CRUD(tc *testcommon.KubePerTestContext, sbTopic client.Object) { + subscription := &servicebus.NamespacesTopicsSubscription{ + ObjectMeta: tc.MakeObjectMeta("subscription"), + Spec: servicebus.NamespacesTopicsSubscription_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_Subscriptions_Rule_v1api20240101_CRUD(tc, subscription) + }, + }, + ) + + tc.DeleteResourceAndWait(subscription) + // Ensure that the resource was really deleted in Azure + tc.ExpectResourceIsDeletedInAzure(armId, string(servicebus.APIVersion_Value)) +} + +func ServiceBus_Subscriptions_Rule_v1api20240101_CRUD(tc *testcommon.KubePerTestContext, sbSubscription client.Object) { + rule := &servicebus.NamespacesTopicsSubscriptionsRule{ + ObjectMeta: tc.MakeObjectMeta("subrule"), + Spec: servicebus.NamespacesTopicsSubscriptionsRule_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/samples/servicebus/v1api20240101/v1api20240101_namespace.yaml b/v2/samples/servicebus/v1api20240101/v1api20240101_namespace.yaml new file mode 100644 index 00000000000..738b3324c87 --- /dev/null +++ b/v2/samples/servicebus/v1api20240101/v1api20240101_namespace.yaml @@ -0,0 +1,12 @@ +apiVersion: servicebus.azure.com/v1api20240101 +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/v1api20240101/v1api20240101_namespacesauthorizationrule.yaml b/v2/samples/servicebus/v1api20240101/v1api20240101_namespacesauthorizationrule.yaml new file mode 100644 index 00000000000..0c84c6edfea --- /dev/null +++ b/v2/samples/servicebus/v1api20240101/v1api20240101_namespacesauthorizationrule.yaml @@ -0,0 +1,25 @@ +apiVersion: servicebus.azure.com/v1api20240101 +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/v1api20240101/v1api20240101_namespacesqueue.yaml b/v2/samples/servicebus/v1api20240101/v1api20240101_namespacesqueue.yaml new file mode 100644 index 00000000000..209b60d4ba9 --- /dev/null +++ b/v2/samples/servicebus/v1api20240101/v1api20240101_namespacesqueue.yaml @@ -0,0 +1,8 @@ +apiVersion: servicebus.azure.com/v1api20240101 +kind: NamespacesQueue +metadata: + name: samplequeue + namespace: default +spec: + owner: + name: aso-namespace diff --git a/v2/samples/servicebus/v1api20240101/v1api20240101_namespacestopic.yaml b/v2/samples/servicebus/v1api20240101/v1api20240101_namespacestopic.yaml new file mode 100644 index 00000000000..aa5985957e5 --- /dev/null +++ b/v2/samples/servicebus/v1api20240101/v1api20240101_namespacestopic.yaml @@ -0,0 +1,8 @@ +apiVersion: servicebus.azure.com/v1api20240101 +kind: NamespacesTopic +metadata: + name: sampletopic + namespace: default +spec: + owner: + name: aso-namespace diff --git a/v2/samples/servicebus/v1api20240101/v1api20240101_namespacestopicssubscription.yaml b/v2/samples/servicebus/v1api20240101/v1api20240101_namespacestopicssubscription.yaml new file mode 100644 index 00000000000..ce8b5bef66f --- /dev/null +++ b/v2/samples/servicebus/v1api20240101/v1api20240101_namespacestopicssubscription.yaml @@ -0,0 +1,8 @@ +apiVersion: servicebus.azure.com/v1api20240101 +kind: NamespacesTopicsSubscription +metadata: + name: sampletopicsubscription + namespace: default +spec: + owner: + name: sampletopic diff --git a/v2/samples/servicebus/v1api20240101/v1api20240101_namespacestopicssubscriptionsrule.yaml b/v2/samples/servicebus/v1api20240101/v1api20240101_namespacestopicssubscriptionsrule.yaml new file mode 100644 index 00000000000..6761f68622d --- /dev/null +++ b/v2/samples/servicebus/v1api20240101/v1api20240101_namespacestopicssubscriptionsrule.yaml @@ -0,0 +1,17 @@ +apiVersion: servicebus.azure.com/v1api20240101 +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')"