From 96c0258a94b5b71eae50dd6c062ed1a70be8486e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 16 Nov 2022 01:42:12 +0000 Subject: [PATCH] CodeGen from PR 20724 in Azure/azure-rest-api-specs Merge bab92a6c44d56af3542de1a386d1257adcc649b3 into b1780623ffb2d4c719c2a62878930d317522290d --- .../eventhub/armeventhub/CHANGELOG.md | 11 + ...p_client.go => applicationgroup_client.go} | 18 +- .../eventhub/armeventhub/autorest.md | 6 +- ..._clusters_client.go => clusters_client.go} | 41 +- ...tion_client.go => configuration_client.go} | 9 +- ...zz_generated_constants.go => constants.go} | 19 +- ...ups_client.go => consumergroups_client.go} | 18 +- ...t.go => disasterrecoveryconfigs_client.go} | 43 +- .../disasterrecoveryconfigs_live_test.go | 158 - .../armeventhub/eventhub_live_test.go | 481 --- ...venthubs_client.go => eventhubs_client.go} | 43 +- .../eventhub/armeventhub/go.mod | 18 +- .../eventhub/armeventhub/go.sum | 35 - .../{zz_generated_models.go => models.go} | 20 + .../eventhub/armeventhub/models_serde.go | 3056 +++++++++++++++++ ...espaces_client.go => namespaces_client.go} | 72 +- ...ksecurityperimeterconfiguration_client.go} | 5 +- ...securityperimeterconfigurations_client.go} | 7 +- ...rations_client.go => operations_client.go} | 6 +- ...phic_helpers.go => polymorphic_helpers.go} | 1 + ...o => privateendpointconnections_client.go} | 22 +- ...ient.go => privatelinkresources_client.go} | 5 +- ...ed_response_types.go => response_types.go} | 1 + ...try_client.go => schemaregistry_client.go} | 18 +- ...erated_time_rfc3339.go => time_rfc3339.go} | 1 + ...ed_example_applicationgroup_client_test.go | 136 - ..._generated_example_clusters_client_test.go | 225 -- ...rated_example_configuration_client_test.go | 68 - ...ated_example_consumergroups_client_test.go | 122 - ...ple_disasterrecoveryconfigs_client_test.go | 258 -- ...generated_example_eventhubs_client_test.go | 289 -- ...enerated_example_namespaces_client_test.go | 477 --- ...urityperimeterconfiguration_client_test.go | 39 - ...rityperimeterconfigurations_client_test.go | 42 - ...enerated_example_operations_client_test.go | 41 - ..._privateendpointconnections_client_test.go | 127 - ...xample_privatelinkresources_client_test.go | 39 - ...ated_example_schemaregistry_client_test.go | 120 - .../armeventhub/zz_generated_models_serde.go | 508 --- 39 files changed, 3265 insertions(+), 3340 deletions(-) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_applicationgroup_client.go => applicationgroup_client.go} (97%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_clusters_client.go => clusters_client.go} (95%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_configuration_client.go => configuration_client.go} (97%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_constants.go => constants.go} (96%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_consumergroups_client.go => consumergroups_client.go} (97%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_disasterrecoveryconfigs_client.go => disasterrecoveryconfigs_client.go} (96%) delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/disasterrecoveryconfigs_live_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/eventhub_live_test.go rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_eventhubs_client.go => eventhubs_client.go} (97%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_models.go => models.go} (98%) create mode 100644 sdk/resourcemanager/eventhub/armeventhub/models_serde.go rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_namespaces_client.go => namespaces_client.go} (96%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_networksecurityperimeterconfiguration_client.go => networksecurityperimeterconfiguration_client.go} (97%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_networksecurityperimeterconfigurations_client.go => networksecurityperimeterconfigurations_client.go} (97%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_operations_client.go => operations_client.go} (95%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_polymorphic_helpers.go => polymorphic_helpers.go} (98%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_privateendpointconnections_client.go => privateendpointconnections_client.go} (96%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_privatelinkresources_client.go => privatelinkresources_client.go} (97%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_response_types.go => response_types.go} (99%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_schemaregistry_client.go => schemaregistry_client.go} (96%) rename sdk/resourcemanager/eventhub/armeventhub/{zz_generated_time_rfc3339.go => time_rfc3339.go} (99%) delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_applicationgroup_client_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_clusters_client_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_configuration_client_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_consumergroups_client_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_disasterrecoveryconfigs_client_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_eventhubs_client_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_namespaces_client_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfiguration_client_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfigurations_client_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privateendpointconnections_client_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privatelinkresources_client_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_schemaregistry_client_test.go delete mode 100644 sdk/resourcemanager/eventhub/armeventhub/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/eventhub/armeventhub/CHANGELOG.md b/sdk/resourcemanager/eventhub/armeventhub/CHANGELOG.md index 64630abd5551..44793df27597 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/CHANGELOG.md +++ b/sdk/resourcemanager/eventhub/armeventhub/CHANGELOG.md @@ -1,5 +1,16 @@ # Release History +## 1.1.0-beta.2 (2022-11-16) +### Features Added + +- New const `CleanupPolicyRetentionDescriptionCompaction` +- New const `CleanupPolicyRetentionDescriptionDelete` +- New type alias `CleanupPolicyRetentionDescription` +- New function `PossibleCleanupPolicyRetentionDescriptionValues() []CleanupPolicyRetentionDescription` +- New struct `RetentionDescription` +- New field `RetentionDescription` in struct `Properties` + + ## 1.1.0-beta.1 (2022-05-19) ### Features Added diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_applicationgroup_client.go b/sdk/resourcemanager/eventhub/armeventhub/applicationgroup_client.go similarity index 97% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_applicationgroup_client.go rename to sdk/resourcemanager/eventhub/armeventhub/applicationgroup_client.go index 051216016155..c24dcea12760 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_applicationgroup_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/applicationgroup_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -57,7 +58,7 @@ func NewApplicationGroupClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdateApplicationGroup - Creates or updates an ApplicationGroup for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // applicationGroupName - The Application Group name @@ -103,7 +104,7 @@ func (client *ApplicationGroupClient) createOrUpdateApplicationGroupCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +121,7 @@ func (client *ApplicationGroupClient) createOrUpdateApplicationGroupHandleRespon // Delete - Deletes an ApplicationGroup for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // applicationGroupName - The Application Group name @@ -164,7 +165,7 @@ func (client *ApplicationGroupClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +173,7 @@ func (client *ApplicationGroupClient) deleteCreateRequest(ctx context.Context, r // Get - Gets an ApplicationGroup for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // applicationGroupName - The Application Group name @@ -216,7 +217,7 @@ func (client *ApplicationGroupClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,8 +233,7 @@ func (client *ApplicationGroupClient) getHandleResponse(resp *http.Response) (Ap } // NewListByNamespacePager - Gets a list of application groups for a Namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - ApplicationGroupClientListByNamespaceOptions contains the optional parameters for the ApplicationGroupClient.ListByNamespace @@ -286,7 +286,7 @@ func (client *ApplicationGroupClient) listByNamespaceCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventhub/armeventhub/autorest.md b/sdk/resourcemanager/eventhub/armeventhub/autorest.md index a73f0437e485..8a65789bf459 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/autorest.md +++ b/sdk/resourcemanager/eventhub/armeventhub/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/eventhub/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/eventhub/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/eventhub/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/eventhub/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.1.0-beta.1 +module-version: 1.1.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_clusters_client.go b/sdk/resourcemanager/eventhub/armeventhub/clusters_client.go similarity index 95% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_clusters_client.go rename to sdk/resourcemanager/eventhub/armeventhub/clusters_client.go index 12163e3b558b..ec6972f7bd87 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_clusters_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/clusters_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -57,7 +58,7 @@ func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates or updates an instance of an Event Hubs Cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // parameters - Parameters for creating a eventhub cluster resource. @@ -77,7 +78,7 @@ func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Creates or updates an instance of an Event Hubs Cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview func (client *ClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { @@ -113,7 +114,7 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +122,7 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes an existing Event Hubs Cluster. This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. @@ -139,7 +140,7 @@ func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes an existing Event Hubs Cluster. This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -175,7 +176,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,7 +184,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets the resource description of the specified Event Hubs Cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. @@ -222,7 +223,7 @@ func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,7 +240,7 @@ func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersCl // ListAvailableClusterRegion - List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // options - ClustersClientListAvailableClusterRegionOptions contains the optional parameters for the ClustersClient.ListAvailableClusterRegion // method. func (client *ClustersClient) ListAvailableClusterRegion(ctx context.Context, options *ClustersClientListAvailableClusterRegionOptions) (ClustersClientListAvailableClusterRegionResponse, error) { @@ -269,7 +270,7 @@ func (client *ClustersClient) listAvailableClusterRegionCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,8 +286,7 @@ func (client *ClustersClient) listAvailableClusterRegionHandleResponse(resp *htt } // NewListByResourceGroupPager - Lists the available Event Hubs Clusters within an ARM resource group -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.ListByResourceGroup // method. @@ -334,7 +334,7 @@ func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,8 +350,7 @@ func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Respo } // NewListBySubscriptionPager - Lists the available Event Hubs Clusters within an ARM resource group -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // options - ClustersClientListBySubscriptionOptions contains the optional parameters for the ClustersClient.ListBySubscription // method. func (client *ClustersClient) NewListBySubscriptionPager(options *ClustersClientListBySubscriptionOptions) *runtime.Pager[ClustersClientListBySubscriptionResponse] { @@ -394,7 +393,7 @@ func (client *ClustersClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -411,7 +410,7 @@ func (client *ClustersClient) listBySubscriptionHandleResponse(resp *http.Respon // ListNamespaces - List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // options - ClustersClientListNamespacesOptions contains the optional parameters for the ClustersClient.ListNamespaces method. @@ -450,7 +449,7 @@ func (client *ClustersClient) listNamespacesCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -467,7 +466,7 @@ func (client *ClustersClient) listNamespacesHandleResponse(resp *http.Response) // BeginUpdate - Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // parameters - The properties of the Event Hubs Cluster which should be updated. @@ -486,7 +485,7 @@ func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview func (client *ClustersClient) update(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClustersClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { @@ -522,7 +521,7 @@ func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_configuration_client.go b/sdk/resourcemanager/eventhub/armeventhub/configuration_client.go similarity index 97% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_configuration_client.go rename to sdk/resourcemanager/eventhub/armeventhub/configuration_client.go index b39285c96412..97709dd973dd 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_configuration_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/configuration_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -58,7 +59,7 @@ func NewConfigurationClient(subscriptionID string, credential azcore.TokenCreden // Get - Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings imposed // on the cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // options - ConfigurationClientGetOptions contains the optional parameters for the ConfigurationClient.Get method. @@ -97,7 +98,7 @@ func (client *ConfigurationClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +116,7 @@ func (client *ConfigurationClient) getHandleResponse(resp *http.Response) (Confi // Patch - Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings // not specified in the request body unmodified. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // parameters - Parameters for creating an Event Hubs Cluster resource. @@ -155,7 +156,7 @@ func (client *ConfigurationClient) patchCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_constants.go b/sdk/resourcemanager/eventhub/armeventhub/constants.go similarity index 96% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_constants.go rename to sdk/resourcemanager/eventhub/armeventhub/constants.go index 460e9b20c186..a096e6aa7b30 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_constants.go +++ b/sdk/resourcemanager/eventhub/armeventhub/constants.go @@ -5,12 +5,13 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub const ( moduleName = "armeventhub" - moduleVersion = "v1.1.0-beta.1" + moduleVersion = "v1.1.0-beta.2" ) type AccessRights string @@ -44,6 +45,22 @@ func PossibleApplicationGroupPolicyTypeValues() []ApplicationGroupPolicyType { } } +// CleanupPolicyRetentionDescription - Enumerates the possible values for cleanup policy +type CleanupPolicyRetentionDescription string + +const ( + CleanupPolicyRetentionDescriptionCompaction CleanupPolicyRetentionDescription = "Compaction" + CleanupPolicyRetentionDescriptionDelete CleanupPolicyRetentionDescription = "Delete" +) + +// PossibleCleanupPolicyRetentionDescriptionValues returns the possible values for the CleanupPolicyRetentionDescription const type. +func PossibleCleanupPolicyRetentionDescriptionValues() []CleanupPolicyRetentionDescription { + return []CleanupPolicyRetentionDescription{ + CleanupPolicyRetentionDescriptionCompaction, + CleanupPolicyRetentionDescriptionDelete, + } +} + // ClusterSKUName - Name of this SKU. type ClusterSKUName string diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_consumergroups_client.go b/sdk/resourcemanager/eventhub/armeventhub/consumergroups_client.go similarity index 97% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_consumergroups_client.go rename to sdk/resourcemanager/eventhub/armeventhub/consumergroups_client.go index d9de3ccb9441..8c53219f9c12 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_consumergroups_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/consumergroups_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -58,7 +59,7 @@ func NewConsumerGroupsClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -109,7 +110,7 @@ func (client *ConsumerGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,7 +127,7 @@ func (client *ConsumerGroupsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Deletes a consumer group from the specified Event Hub and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -175,7 +176,7 @@ func (client *ConsumerGroupsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,7 +184,7 @@ func (client *ConsumerGroupsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets a description for the specified consumer group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -232,7 +233,7 @@ func (client *ConsumerGroupsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,8 +250,7 @@ func (client *ConsumerGroupsClient) getHandleResponse(resp *http.Response) (Cons // NewListByEventHubPager - Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists // in the Namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -308,7 +308,7 @@ func (client *ConsumerGroupsClient) listByEventHubCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_disasterrecoveryconfigs_client.go b/sdk/resourcemanager/eventhub/armeventhub/disasterrecoveryconfigs_client.go similarity index 96% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_disasterrecoveryconfigs_client.go rename to sdk/resourcemanager/eventhub/armeventhub/disasterrecoveryconfigs_client.go index df4fa7dee341..68a9c2d398fa 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_disasterrecoveryconfigs_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/disasterrecoveryconfigs_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -57,7 +58,7 @@ func NewDisasterRecoveryConfigsClient(subscriptionID string, credential azcore.T // BreakPairing - This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -102,7 +103,7 @@ func (client *DisasterRecoveryConfigsClient) breakPairingCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +111,7 @@ func (client *DisasterRecoveryConfigsClient) breakPairingCreateRequest(ctx conte // CheckNameAvailability - Check the give Namespace name availability. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // parameters - Parameters to check availability of the given Alias name @@ -151,7 +152,7 @@ func (client *DisasterRecoveryConfigsClient) checkNameAvailabilityCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -168,7 +169,7 @@ func (client *DisasterRecoveryConfigsClient) checkNameAvailabilityHandleResponse // CreateOrUpdate - Creates or updates a new Alias(Disaster Recovery configuration) // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -214,7 +215,7 @@ func (client *DisasterRecoveryConfigsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -231,7 +232,7 @@ func (client *DisasterRecoveryConfigsClient) createOrUpdateHandleResponse(resp * // Delete - Deletes an Alias(Disaster Recovery configuration) // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -276,7 +277,7 @@ func (client *DisasterRecoveryConfigsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +285,7 @@ func (client *DisasterRecoveryConfigsClient) deleteCreateRequest(ctx context.Con // FailOver - Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -329,7 +330,7 @@ func (client *DisasterRecoveryConfigsClient) failOverCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -337,7 +338,7 @@ func (client *DisasterRecoveryConfigsClient) failOverCreateRequest(ctx context.C // Get - Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -382,7 +383,7 @@ func (client *DisasterRecoveryConfigsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -399,7 +400,7 @@ func (client *DisasterRecoveryConfigsClient) getHandleResponse(resp *http.Respon // GetAuthorizationRule - Gets an AuthorizationRule for a Namespace by rule name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -449,7 +450,7 @@ func (client *DisasterRecoveryConfigsClient) getAuthorizationRuleCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -465,8 +466,7 @@ func (client *DisasterRecoveryConfigsClient) getAuthorizationRuleHandleResponse( } // NewListPager - Gets all Alias(Disaster Recovery configurations) -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - DisasterRecoveryConfigsClientListOptions contains the optional parameters for the DisasterRecoveryConfigsClient.List @@ -519,7 +519,7 @@ func (client *DisasterRecoveryConfigsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -535,8 +535,7 @@ func (client *DisasterRecoveryConfigsClient) listHandleResponse(resp *http.Respo } // NewListAuthorizationRulesPager - Gets a list of authorization rules for a Namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -594,7 +593,7 @@ func (client *DisasterRecoveryConfigsClient) listAuthorizationRulesCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -611,7 +610,7 @@ func (client *DisasterRecoveryConfigsClient) listAuthorizationRulesHandleRespons // ListKeys - Gets the primary and secondary connection strings for the Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -661,7 +660,7 @@ func (client *DisasterRecoveryConfigsClient) listKeysCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventhub/armeventhub/disasterrecoveryconfigs_live_test.go b/sdk/resourcemanager/eventhub/armeventhub/disasterrecoveryconfigs_live_test.go deleted file mode 100644 index b17f306c8d7b..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/disasterrecoveryconfigs_live_test.go +++ /dev/null @@ -1,158 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type DisasterrecoveryconfigsTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - alias string - authorizationRuleName string - namespaceName string - namespaceNameSecond string - secondNamespaceId string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *DisasterrecoveryconfigsTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/eventhub/armeventhub/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.alias = testutil.GenerateAlphaNumericID(testsuite.T(), "alias2", 6) - testsuite.authorizationRuleName = testutil.GenerateAlphaNumericID(testsuite.T(), "authorizat2", 6) - testsuite.namespaceName = testutil.GenerateAlphaNumericID(testsuite.T(), "namespacen2", 6) - testsuite.namespaceNameSecond = testutil.GenerateAlphaNumericID(testsuite.T(), "namespacensecond", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *DisasterrecoveryconfigsTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestDisasterrecoveryconfigsTestSuite(t *testing.T) { - suite.Run(t, new(DisasterrecoveryconfigsTestSuite)) -} - -func (testsuite *DisasterrecoveryconfigsTestSuite) Prepare() { - var err error - // From step Namespaces_CreateOrUpdate - namespacesClient, err := armeventhub.NewNamespacesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - namespacesClientCreateOrUpdateResponsePoller, err := namespacesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armeventhub.EHNamespace{ - Location: to.Ptr(testsuite.location), - SKU: &armeventhub.SKU{ - Name: to.Ptr(armeventhub.SKUNameStandard), - Tier: to.Ptr(armeventhub.SKUTierStandard), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, namespacesClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step Namespaces_CreateOrUpdate_Second - namespacesClientCreateOrUpdateResponsePoller, err = namespacesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceNameSecond, armeventhub.EHNamespace{ - Location: to.Ptr("westus2"), - SKU: &armeventhub.SKU{ - Name: to.Ptr(armeventhub.SKUNameStandard), - Tier: to.Ptr(armeventhub.SKUTierStandard), - }, - }, nil) - testsuite.Require().NoError(err) - var namespacesClientCreateOrUpdateResponse *armeventhub.NamespacesClientCreateOrUpdateResponse - namespacesClientCreateOrUpdateResponse, err = testutil.PollForTest(testsuite.ctx, namespacesClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - testsuite.secondNamespaceId = *namespacesClientCreateOrUpdateResponse.ID - - // From step Namespaces_CreateOrUpdateAuthorizationRule - _, err = namespacesClient.CreateOrUpdateAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.authorizationRuleName, armeventhub.AuthorizationRule{ - Properties: &armeventhub.AuthorizationRuleProperties{ - Rights: []*armeventhub.AccessRights{ - to.Ptr(armeventhub.AccessRightsListen), - to.Ptr(armeventhub.AccessRightsSend)}, - }, - }, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.EventHub/namespaces/disasterRecoveryConfigs -func (testsuite *DisasterrecoveryconfigsTestSuite) TestDisasterrecoveryconfig() { - var err error - // From step DisasterRecoveryConfigs_CheckNameAvailability - disasterRecoveryConfigsClient, err := armeventhub.NewDisasterRecoveryConfigsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = disasterRecoveryConfigsClient.CheckNameAvailability(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armeventhub.CheckNameAvailabilityParameter{ - Name: to.Ptr("sdk-DisasterRecovery-9474"), - }, nil) - testsuite.Require().NoError(err) - - // From step DisasterRecoveryConfigs_CreateOrUpdate - _, err = disasterRecoveryConfigsClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.alias, armeventhub.ArmDisasterRecovery{ - Properties: &armeventhub.ArmDisasterRecoveryProperties{ - PartnerNamespace: to.Ptr(testsuite.secondNamespaceId), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step DisasterRecoveryConfigs_List - disasterRecoveryConfigsClientNewListPager := disasterRecoveryConfigsClient.NewListPager(testsuite.resourceGroupName, testsuite.namespaceName, nil) - for disasterRecoveryConfigsClientNewListPager.More() { - _, err := disasterRecoveryConfigsClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step DisasterRecoveryConfigs_GetAuthorizationRule - _, err = disasterRecoveryConfigsClient.GetAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.alias, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step DisasterRecoveryConfigs_Get - _, err = disasterRecoveryConfigsClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.alias, nil) - testsuite.Require().NoError(err) - - // From step DisasterRecoveryConfigs_ListAuthorizationRules - disasterRecoveryConfigsClientNewListAuthorizationRulesPager := disasterRecoveryConfigsClient.NewListAuthorizationRulesPager(testsuite.resourceGroupName, testsuite.namespaceName, testsuite.alias, nil) - for disasterRecoveryConfigsClientNewListAuthorizationRulesPager.More() { - _, err := disasterRecoveryConfigsClientNewListAuthorizationRulesPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step DisasterRecoveryConfigs_ListKeys - _, err = disasterRecoveryConfigsClient.ListKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.alias, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step DisasterRecoveryConfigs_FailOver - _, err = disasterRecoveryConfigsClient.FailOver(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceNameSecond, testsuite.alias, nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/eventhub_live_test.go b/sdk/resourcemanager/eventhub/armeventhub/eventhub_live_test.go deleted file mode 100644 index 8da4a2905f37..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/eventhub_live_test.go +++ /dev/null @@ -1,481 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" - "github.com/stretchr/testify/suite" -) - -type EventhubTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - applicationGroupName string - authorizationRuleName string - consumerGroupName string - eventHubName string - namespaceName string - schemaGroupName string - storageAccountId string - storageAccountName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *EventhubTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/eventhub/armeventhub/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.applicationGroupName = testutil.GenerateAlphaNumericID(testsuite.T(), "applicatio", 6) - testsuite.authorizationRuleName = testutil.GenerateAlphaNumericID(testsuite.T(), "authorizat", 6) - testsuite.consumerGroupName = testutil.GenerateAlphaNumericID(testsuite.T(), "consumergr", 6) - testsuite.eventHubName = testutil.GenerateAlphaNumericID(testsuite.T(), "eventhubna", 6) - testsuite.namespaceName = testutil.GenerateAlphaNumericID(testsuite.T(), "namespacen", 6) - testsuite.schemaGroupName = testutil.GenerateAlphaNumericID(testsuite.T(), "schemagrou", 6) - testsuite.storageAccountName = "storageeventhub2" - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *EventhubTestSuite) TearDownSuite() { - testsuite.Cleanup() - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestEventhubTestSuite(t *testing.T) { - suite.Run(t, new(EventhubTestSuite)) -} - -func (testsuite *EventhubTestSuite) Prepare() { - var err error - // From step Namespaces_CreateOrUpdate - namespacesClient, err := armeventhub.NewNamespacesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - namespacesClientCreateOrUpdateResponsePoller, err := namespacesClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armeventhub.EHNamespace{ - Location: to.Ptr(testsuite.location), - SKU: &armeventhub.SKU{ - Name: to.Ptr(armeventhub.SKUNamePremium), - Tier: to.Ptr(armeventhub.SKUTierPremium), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, namespacesClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step StorageAccount_Create - template := map[string]interface{}{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "outputs": map[string]interface{}{ - "storageAccountId": map[string]interface{}{ - "type": "string", - "value": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]", - }, - }, - "parameters": map[string]interface{}{ - "storageAccountName": map[string]interface{}{ - "type": "string", - "defaultValue": "$(storageAccountName)", - }, - }, - "resources": []interface{}{ - map[string]interface{}{ - "name": "[parameters('storageAccountName')]", - "type": "Microsoft.Storage/storageAccounts", - "apiVersion": "2022-05-01", - "kind": "StorageV2", - "location": "eastus", - "properties": map[string]interface{}{ - "accessTier": "Hot", - "allowBlobPublicAccess": true, - "allowCrossTenantReplication": true, - "allowSharedKeyAccess": true, - "defaultToOAuthAuthentication": false, - "dnsEndpointType": "Standard", - "encryption": map[string]interface{}{ - "keySource": "Microsoft.Storage", - "requireInfrastructureEncryption": false, - "services": map[string]interface{}{ - "blob": map[string]interface{}{ - "enabled": true, - "keyType": "Account", - }, - "file": map[string]interface{}{ - "enabled": true, - "keyType": "Account", - }, - }, - }, - "minimumTlsVersion": "TLS1_2", - "networkAcls": map[string]interface{}{ - "bypass": "AzureServices", - "defaultAction": "Allow", - "ipRules": []interface{}{}, - "virtualNetworkRules": []interface{}{}, - }, - "publicNetworkAccess": "Enabled", - "supportsHttpsTrafficOnly": true, - }, - "sku": map[string]interface{}{ - "name": "Standard_RAGRS", - "tier": "Standard", - }, - }, - }, - "variables": map[string]interface{}{}, - } - params := map[string]interface{}{ - "storageAccountName": map[string]interface{}{"value": testsuite.storageAccountName}, - } - deployment := armresources.Deployment{ - Properties: &armresources.DeploymentProperties{ - Template: template, - Parameters: params, - Mode: to.Ptr(armresources.DeploymentModeIncremental), - }, - } - deploymentExtend, err := testutil.CreateDeployment(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName, "StorageAccount_Create", &deployment) - testsuite.Require().NoError(err) - testsuite.storageAccountId = deploymentExtend.Properties.Outputs.(map[string]interface{})["storageAccountId"].(map[string]interface{})["value"].(string) - - // From step EventHubs_CreateOrUpdate - eventHubsClient, err := armeventhub.NewEventHubsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = eventHubsClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.eventHubName, armeventhub.Eventhub{ - Properties: &armeventhub.Properties{ - CaptureDescription: &armeventhub.CaptureDescription{ - Destination: &armeventhub.Destination{ - Name: to.Ptr("EventHubArchive.AzureBlockBlob"), - Properties: &armeventhub.DestinationProperties{ - ArchiveNameFormat: to.Ptr("{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"), - BlobContainer: to.Ptr("container"), - StorageAccountResourceID: to.Ptr(testsuite.storageAccountId), - }, - }, - Enabled: to.Ptr(true), - Encoding: to.Ptr(armeventhub.EncodingCaptureDescriptionAvro), - IntervalInSeconds: to.Ptr[int32](120), - SizeLimitInBytes: to.Ptr[int32](10485763), - }, - MessageRetentionInDays: to.Ptr[int64](4), - PartitionCount: to.Ptr[int64](4), - Status: to.Ptr(armeventhub.EntityStatusActive), - }, - }, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.EventHub/namespaces -func (testsuite *EventhubTestSuite) TestNamespace() { - var err error - // From step Namespaces_CheckNameAvailability - namespacesClient, err := armeventhub.NewNamespacesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = namespacesClient.CheckNameAvailability(testsuite.ctx, armeventhub.CheckNameAvailabilityParameter{ - Name: to.Ptr("sdk-Namespace-8458"), - }, nil) - testsuite.Require().NoError(err) - - // From step Namespaces_List - namespacesClientNewListPager := namespacesClient.NewListPager(nil) - for namespacesClientNewListPager.More() { - _, err := namespacesClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Namespaces_ListAuthorizationRules - namespacesClientNewListAuthorizationRulesPager := namespacesClient.NewListAuthorizationRulesPager(testsuite.resourceGroupName, testsuite.namespaceName, nil) - for namespacesClientNewListAuthorizationRulesPager.More() { - _, err := namespacesClientNewListAuthorizationRulesPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Namespaces_ListNetworkRuleSet - _, err = namespacesClient.ListNetworkRuleSet(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, nil) - testsuite.Require().NoError(err) - - // From step Namespaces_GetNetworkRuleSet - _, err = namespacesClient.GetNetworkRuleSet(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, nil) - testsuite.Require().NoError(err) - - // From step Namespaces_ListByResourceGroup - namespacesClientNewListByResourceGroupPager := namespacesClient.NewListByResourceGroupPager(testsuite.resourceGroupName, nil) - for namespacesClientNewListByResourceGroupPager.More() { - _, err := namespacesClientNewListByResourceGroupPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Namespaces_Get - _, err = namespacesClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, nil) - testsuite.Require().NoError(err) - - // From step Namespaces_Update - _, err = namespacesClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, armeventhub.EHNamespace{ - Location: to.Ptr(testsuite.location), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Namespaces_CreateOrUpdateAuthorizationRule - _, err = namespacesClient.CreateOrUpdateAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.authorizationRuleName, armeventhub.AuthorizationRule{ - Properties: &armeventhub.AuthorizationRuleProperties{ - Rights: []*armeventhub.AccessRights{ - to.Ptr(armeventhub.AccessRightsListen), - to.Ptr(armeventhub.AccessRightsSend)}, - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Namespaces_GetAuthorizationRule - _, err = namespacesClient.GetAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step Namespaces_ListKeys - _, err = namespacesClient.ListKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step Namespaces_RegenerateKeys - _, err = namespacesClient.RegenerateKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.authorizationRuleName, armeventhub.RegenerateAccessKeyParameters{ - KeyType: to.Ptr(armeventhub.KeyTypePrimaryKey), - }, nil) - testsuite.Require().NoError(err) - - // From step Namespaces_DeleteAuthorizationRule - _, err = namespacesClient.DeleteAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.EventHub/namespaces/eventhubs -func (testsuite *EventhubTestSuite) TestEventhubs() { - var err error - // From step EventHubs_ListByNamespace - eventHubsClient, err := armeventhub.NewEventHubsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - eventHubsClientNewListByNamespacePager := eventHubsClient.NewListByNamespacePager(testsuite.resourceGroupName, testsuite.namespaceName, &armeventhub.EventHubsClientListByNamespaceOptions{Skip: nil, - Top: nil, - }) - for eventHubsClientNewListByNamespacePager.More() { - _, err := eventHubsClientNewListByNamespacePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step EventHubs_ListAuthorizationRules - eventHubsClientNewListAuthorizationRulesPager := eventHubsClient.NewListAuthorizationRulesPager(testsuite.resourceGroupName, testsuite.namespaceName, testsuite.eventHubName, nil) - for eventHubsClientNewListAuthorizationRulesPager.More() { - _, err := eventHubsClientNewListAuthorizationRulesPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step EventHubs_Get - _, err = eventHubsClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.eventHubName, nil) - testsuite.Require().NoError(err) - - // From step EventHubs_CreateOrUpdateAuthorizationRule - _, err = eventHubsClient.CreateOrUpdateAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.eventHubName, testsuite.authorizationRuleName, armeventhub.AuthorizationRule{ - Properties: &armeventhub.AuthorizationRuleProperties{ - Rights: []*armeventhub.AccessRights{ - to.Ptr(armeventhub.AccessRightsListen), - to.Ptr(armeventhub.AccessRightsSend)}, - }, - }, nil) - testsuite.Require().NoError(err) - - // From step EventHubs_GetAuthorizationRule - _, err = eventHubsClient.GetAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.eventHubName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step EventHubs_ListKeys - _, err = eventHubsClient.ListKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.eventHubName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) - - // From step EventHubs_RegenerateKeys - _, err = eventHubsClient.RegenerateKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.eventHubName, testsuite.authorizationRuleName, armeventhub.RegenerateAccessKeyParameters{ - KeyType: to.Ptr(armeventhub.KeyTypePrimaryKey), - }, nil) - testsuite.Require().NoError(err) - - // From step EventHubs_DeleteAuthorizationRule - _, err = eventHubsClient.DeleteAuthorizationRule(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.eventHubName, testsuite.authorizationRuleName, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.EventHub/namespaces/eventhubs/consumergroups -func (testsuite *EventhubTestSuite) TestConsumergroups() { - var err error - // From step ConsumerGroups_CreateOrUpdate - consumerGroupsClient, err := armeventhub.NewConsumerGroupsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = consumerGroupsClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.eventHubName, testsuite.consumerGroupName, armeventhub.ConsumerGroup{ - Properties: &armeventhub.ConsumerGroupProperties{ - UserMetadata: to.Ptr("New consumergroup"), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step ConsumerGroups_ListByEventHub - consumerGroupsClientNewListByEventHubPager := consumerGroupsClient.NewListByEventHubPager(testsuite.resourceGroupName, testsuite.namespaceName, testsuite.eventHubName, &armeventhub.ConsumerGroupsClientListByEventHubOptions{Skip: nil, - Top: nil, - }) - for consumerGroupsClientNewListByEventHubPager.More() { - _, err := consumerGroupsClientNewListByEventHubPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step ConsumerGroups_Get - _, err = consumerGroupsClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.eventHubName, testsuite.consumerGroupName, nil) - testsuite.Require().NoError(err) - - // From step ConsumerGroups_Delete - _, err = consumerGroupsClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.eventHubName, testsuite.consumerGroupName, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.EventHub/namespaces/applicationGroups -func (testsuite *EventhubTestSuite) TestApplicationgroup() { - var err error - // From step ApplicationGroup_CreateOrUpdateApplicationGroup - applicationGroupClient, err := armeventhub.NewApplicationGroupClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = applicationGroupClient.CreateOrUpdateApplicationGroup(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.applicationGroupName, armeventhub.ApplicationGroup{ - Properties: &armeventhub.ApplicationGroupProperties{ - ClientAppGroupIdentifier: to.Ptr("SASKeyName=KeyName"), - IsEnabled: to.Ptr(true), - Policies: []armeventhub.ApplicationGroupPolicyClassification{ - &armeventhub.ThrottlingPolicy{ - Name: to.Ptr("ThrottlingPolicy1"), - Type: to.Ptr(armeventhub.ApplicationGroupPolicyTypeThrottlingPolicy), - MetricID: to.Ptr(armeventhub.MetricIDIncomingMessages), - RateLimitThreshold: to.Ptr[int64](7912), - }, - &armeventhub.ThrottlingPolicy{ - Name: to.Ptr("ThrottlingPolicy2"), - Type: to.Ptr(armeventhub.ApplicationGroupPolicyTypeThrottlingPolicy), - MetricID: to.Ptr(armeventhub.MetricIDIncomingBytes), - RateLimitThreshold: to.Ptr[int64](3951729), - }, - &armeventhub.ThrottlingPolicy{ - Name: to.Ptr("ThrottlingPolicy3"), - Type: to.Ptr(armeventhub.ApplicationGroupPolicyTypeThrottlingPolicy), - MetricID: to.Ptr(armeventhub.MetricIDOutgoingBytes), - RateLimitThreshold: to.Ptr[int64](245175), - }}, - }, - }, nil) - testsuite.Require().NoError(err) - - // From step ApplicationGroup_ListByNamespace - applicationGroupClientNewListByNamespacePager := applicationGroupClient.NewListByNamespacePager(testsuite.resourceGroupName, testsuite.namespaceName, nil) - for applicationGroupClientNewListByNamespacePager.More() { - _, err := applicationGroupClientNewListByNamespacePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step ApplicationGroup_Get - _, err = applicationGroupClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.applicationGroupName, nil) - testsuite.Require().NoError(err) - - // From step ApplicationGroup_Delete - _, err = applicationGroupClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.applicationGroupName, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.EventHub/namespaces/schemagroups -func (testsuite *EventhubTestSuite) TestSchemaregistry() { - var err error - // From step SchemaRegistry_CreateOrUpdate - schemaRegistryClient, err := armeventhub.NewSchemaRegistryClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = schemaRegistryClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.schemaGroupName, armeventhub.SchemaGroup{ - Properties: &armeventhub.SchemaGroupProperties{ - GroupProperties: map[string]*string{}, - SchemaCompatibility: to.Ptr(armeventhub.SchemaCompatibilityForward), - SchemaType: to.Ptr(armeventhub.SchemaTypeAvro), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step SchemaRegistry_ListByNamespace - schemaRegistryClientNewListByNamespacePager := schemaRegistryClient.NewListByNamespacePager(testsuite.resourceGroupName, testsuite.namespaceName, &armeventhub.SchemaRegistryClientListByNamespaceOptions{Skip: nil, - Top: nil, - }) - for schemaRegistryClientNewListByNamespacePager.More() { - _, err := schemaRegistryClientNewListByNamespacePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step SchemaRegistry_Get - _, err = schemaRegistryClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.schemaGroupName, nil) - testsuite.Require().NoError(err) - - // From step SchemaRegistry_Delete - _, err = schemaRegistryClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.schemaGroupName, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.EventHub/operations -func (testsuite *EventhubTestSuite) TestOperations() { - var err error - // From step Operations_List - operationsClient, err := armeventhub.NewOperationsClient(testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - operationsClientNewListPager := operationsClient.NewListPager(nil) - for operationsClientNewListPager.More() { - _, err := operationsClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } -} - -func (testsuite *EventhubTestSuite) Cleanup() { - var err error - // From step EventHubs_Delete - eventHubsClient, err := armeventhub.NewEventHubsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = eventHubsClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, testsuite.eventHubName, nil) - testsuite.Require().NoError(err) - - // From step Namespaces_Delete - namespacesClient, err := armeventhub.NewNamespacesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - namespacesClientDeleteResponsePoller, err := namespacesClient.BeginDelete(testsuite.ctx, testsuite.resourceGroupName, testsuite.namespaceName, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, namespacesClientDeleteResponsePoller) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_eventhubs_client.go b/sdk/resourcemanager/eventhub/armeventhub/eventhubs_client.go similarity index 97% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_eventhubs_client.go rename to sdk/resourcemanager/eventhub/armeventhub/eventhubs_client.go index 2a346ef646af..75103e1271ef 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_eventhubs_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/eventhubs_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -58,7 +59,7 @@ func NewEventHubsClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Creates or updates a new Event Hub as a nested resource within a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -104,7 +105,7 @@ func (client *EventHubsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,7 +123,7 @@ func (client *EventHubsClient) createOrUpdateHandleResponse(resp *http.Response) // CreateOrUpdateAuthorizationRule - Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update // of the AuthorizationRule will take a few seconds to take effect. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -173,7 +174,7 @@ func (client *EventHubsClient) createOrUpdateAuthorizationRuleCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -190,7 +191,7 @@ func (client *EventHubsClient) createOrUpdateAuthorizationRuleHandleResponse(res // Delete - Deletes an Event Hub from the specified Namespace and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -234,7 +235,7 @@ func (client *EventHubsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +243,7 @@ func (client *EventHubsClient) deleteCreateRequest(ctx context.Context, resource // DeleteAuthorizationRule - Deletes an Event Hub AuthorizationRule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -292,7 +293,7 @@ func (client *EventHubsClient) deleteAuthorizationRuleCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,7 +301,7 @@ func (client *EventHubsClient) deleteAuthorizationRuleCreateRequest(ctx context. // Get - Gets an Event Hubs description for the specified Event Hub. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -344,7 +345,7 @@ func (client *EventHubsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -361,7 +362,7 @@ func (client *EventHubsClient) getHandleResponse(resp *http.Response) (EventHubs // GetAuthorizationRule - Gets an AuthorizationRule for an Event Hub by rule name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -411,7 +412,7 @@ func (client *EventHubsClient) getAuthorizationRuleCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -427,8 +428,7 @@ func (client *EventHubsClient) getAuthorizationRuleHandleResponse(resp *http.Res } // NewListAuthorizationRulesPager - Gets the authorization rules for an Event Hub. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -486,7 +486,7 @@ func (client *EventHubsClient) listAuthorizationRulesCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -502,8 +502,7 @@ func (client *EventHubsClient) listAuthorizationRulesHandleResponse(resp *http.R } // NewListByNamespacePager - Gets all the Event Hubs in a Namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - EventHubsClientListByNamespaceOptions contains the optional parameters for the EventHubsClient.ListByNamespace @@ -556,7 +555,7 @@ func (client *EventHubsClient) listByNamespaceCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -579,7 +578,7 @@ func (client *EventHubsClient) listByNamespaceHandleResponse(resp *http.Response // ListKeys - Gets the ACS and SAS connection strings for the Event Hub. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -628,7 +627,7 @@ func (client *EventHubsClient) listKeysCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -645,7 +644,7 @@ func (client *EventHubsClient) listKeysHandleResponse(resp *http.Response) (Even // RegenerateKeys - Regenerates the ACS and SAS connection strings for the Event Hub. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -696,7 +695,7 @@ func (client *EventHubsClient) regenerateKeysCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/eventhub/armeventhub/go.mod b/sdk/resourcemanager/eventhub/armeventhub/go.mod index f2b8f3a64300..45a2d1851f19 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/go.mod +++ b/sdk/resourcemanager/eventhub/armeventhub/go.mod @@ -2,28 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhu go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.1 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 - github.com/stretchr/testify v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dnaeon/go-vcr v1.1.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/eventhub/armeventhub/go.sum b/sdk/resourcemanager/eventhub/armeventhub/go.sum index 07096d31831b..fcd024b572be 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/go.sum +++ b/sdk/resourcemanager/eventhub/armeventhub/go.sum @@ -1,50 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 h1:Ut0ZGdOwJDw0npYEg+TLlPls3Pq6JiZaP2/aGKir7Zw= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.1 h1:BZOe7ExNYNGmapT91ZUrxtMYsqVljMxTHEnwjOdG7pk= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.1/go.mod h1:TSPEzbGHEgqFa3kUn09SpCrfKNbj7+mMulU/72Vg84E= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0/go.mod h1:s1tW/At+xHqjNFvWU4G0c0Qv33KOhvbGNj0RCTQDV8s= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_models.go b/sdk/resourcemanager/eventhub/armeventhub/models.go similarity index 98% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_models.go rename to sdk/resourcemanager/eventhub/armeventhub/models.go index c083af1b7d73..e7d01523bf4b 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_models.go +++ b/sdk/resourcemanager/eventhub/armeventhub/models.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -1285,6 +1286,9 @@ type Properties struct { // Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. PartitionCount *int64 `json:"partitionCount,omitempty"` + // Event Hub retention settings + RetentionDescription *RetentionDescription `json:"retentionDescription,omitempty"` + // Enumerates the possible values for the status of the Event Hub. Status *EntityStatus `json:"status,omitempty"` @@ -1353,6 +1357,22 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// RetentionDescription - Properties to configure retention settings for the eventhub +type RetentionDescription struct { + // Enumerates the possible values for cleanup policy + CleanupPolicy *CleanupPolicyRetentionDescription `json:"cleanupPolicy,omitempty"` + + // Number of hours to retain the events for this Event Hub. This value is only used when cleanupPolicy is Delete. If cleanupPolicy + // is Compaction the returned value of this property is Long.MaxValue + RetentionTimeInHours *int64 `json:"retentionTimeInHours,omitempty"` + + // Number of hours to retain the tombstone markers of a compacted Event Hub. This value is only used when cleanupPolicy is + // Compaction. Consumer must complete reading the tombstone marker within this + // specified amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key + // described by the tombstone marker within the compacted Event Hub + TombstoneRetentionTimeInHours *int32 `json:"tombstoneRetentionTimeInHours,omitempty"` +} + // SKU parameters supplied to the create namespace operation type SKU struct { // REQUIRED; Name of this SKU. diff --git a/sdk/resourcemanager/eventhub/armeventhub/models_serde.go b/sdk/resourcemanager/eventhub/armeventhub/models_serde.go new file mode 100644 index 000000000000..3145e1d582ec --- /dev/null +++ b/sdk/resourcemanager/eventhub/armeventhub/models_serde.go @@ -0,0 +1,3056 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armeventhub + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AccessKeys. +func (a AccessKeys) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aliasPrimaryConnectionString", a.AliasPrimaryConnectionString) + populate(objectMap, "aliasSecondaryConnectionString", a.AliasSecondaryConnectionString) + populate(objectMap, "keyName", a.KeyName) + populate(objectMap, "primaryConnectionString", a.PrimaryConnectionString) + populate(objectMap, "primaryKey", a.PrimaryKey) + populate(objectMap, "secondaryConnectionString", a.SecondaryConnectionString) + populate(objectMap, "secondaryKey", a.SecondaryKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessKeys. +func (a *AccessKeys) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "aliasPrimaryConnectionString": + err = unpopulate(val, "AliasPrimaryConnectionString", &a.AliasPrimaryConnectionString) + delete(rawMsg, key) + case "aliasSecondaryConnectionString": + err = unpopulate(val, "AliasSecondaryConnectionString", &a.AliasSecondaryConnectionString) + delete(rawMsg, key) + case "keyName": + err = unpopulate(val, "KeyName", &a.KeyName) + delete(rawMsg, key) + case "primaryConnectionString": + err = unpopulate(val, "PrimaryConnectionString", &a.PrimaryConnectionString) + delete(rawMsg, key) + case "primaryKey": + err = unpopulate(val, "PrimaryKey", &a.PrimaryKey) + delete(rawMsg, key) + case "secondaryConnectionString": + err = unpopulate(val, "SecondaryConnectionString", &a.SecondaryConnectionString) + delete(rawMsg, key) + case "secondaryKey": + err = unpopulate(val, "SecondaryKey", &a.SecondaryKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroup. +func (a ApplicationGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroup. +func (a *ApplicationGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupListResult. +func (a ApplicationGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupListResult. +func (a *ApplicationGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupPolicy. +func (a ApplicationGroupPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", a.Name) + objectMap["type"] = a.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupPolicy. +func (a *ApplicationGroupPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupProperties. +func (a ApplicationGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientAppGroupIdentifier", a.ClientAppGroupIdentifier) + populate(objectMap, "isEnabled", a.IsEnabled) + populate(objectMap, "policies", a.Policies) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupProperties. +func (a *ApplicationGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientAppGroupIdentifier": + err = unpopulate(val, "ClientAppGroupIdentifier", &a.ClientAppGroupIdentifier) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &a.IsEnabled) + delete(rawMsg, key) + case "policies": + a.Policies, err = unmarshalApplicationGroupPolicyClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArmDisasterRecovery. +func (a ArmDisasterRecovery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmDisasterRecovery. +func (a *ArmDisasterRecovery) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArmDisasterRecoveryListResult. +func (a ArmDisasterRecoveryListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmDisasterRecoveryListResult. +func (a *ArmDisasterRecoveryListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArmDisasterRecoveryProperties. +func (a ArmDisasterRecoveryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alternateName", a.AlternateName) + populate(objectMap, "partnerNamespace", a.PartnerNamespace) + populate(objectMap, "pendingReplicationOperationsCount", a.PendingReplicationOperationsCount) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "role", a.Role) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmDisasterRecoveryProperties. +func (a *ArmDisasterRecoveryProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alternateName": + err = unpopulate(val, "AlternateName", &a.AlternateName) + delete(rawMsg, key) + case "partnerNamespace": + err = unpopulate(val, "PartnerNamespace", &a.PartnerNamespace) + delete(rawMsg, key) + case "pendingReplicationOperationsCount": + err = unpopulate(val, "PendingReplicationOperationsCount", &a.PendingReplicationOperationsCount) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &a.Role) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationRule. +func (a AuthorizationRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationRule. +func (a *AuthorizationRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationRuleListResult. +func (a AuthorizationRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationRuleListResult. +func (a *AuthorizationRuleListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationRuleProperties. +func (a AuthorizationRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "rights", a.Rights) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationRuleProperties. +func (a *AuthorizationRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "rights": + err = unpopulate(val, "Rights", &a.Rights) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AvailableCluster. +func (a AvailableCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "location", a.Location) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableCluster. +func (a *AvailableCluster) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AvailableClustersList. +func (a AvailableClustersList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AvailableClustersList. +func (a *AvailableClustersList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CaptureDescription. +func (c CaptureDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "destination", c.Destination) + populate(objectMap, "enabled", c.Enabled) + populate(objectMap, "encoding", c.Encoding) + populate(objectMap, "intervalInSeconds", c.IntervalInSeconds) + populate(objectMap, "sizeLimitInBytes", c.SizeLimitInBytes) + populate(objectMap, "skipEmptyArchives", c.SkipEmptyArchives) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CaptureDescription. +func (c *CaptureDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destination": + err = unpopulate(val, "Destination", &c.Destination) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &c.Enabled) + delete(rawMsg, key) + case "encoding": + err = unpopulate(val, "Encoding", &c.Encoding) + delete(rawMsg, key) + case "intervalInSeconds": + err = unpopulate(val, "IntervalInSeconds", &c.IntervalInSeconds) + delete(rawMsg, key) + case "sizeLimitInBytes": + err = unpopulate(val, "SizeLimitInBytes", &c.SizeLimitInBytes) + delete(rawMsg, key) + case "skipEmptyArchives": + err = unpopulate(val, "SkipEmptyArchives", &c.SkipEmptyArchives) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityParameter. +func (c CheckNameAvailabilityParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", c.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityParameter. +func (c *CheckNameAvailabilityParameter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityResult. +func (c CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "message", c.Message) + populate(objectMap, "nameAvailable", c.NameAvailable) + populate(objectMap, "reason", c.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResult. +func (c *CheckNameAvailabilityResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &c.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &c.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Cluster. +func (c Cluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "sku", c.SKU) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Cluster. +func (c *Cluster) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &c.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterListResult. +func (c ClusterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterListResult. +func (c *ClusterListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterProperties. +func (c ClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "createdAt", c.CreatedAt) + populate(objectMap, "metricId", c.MetricID) + populate(objectMap, "status", c.Status) + populate(objectMap, "supportsScaling", c.SupportsScaling) + populate(objectMap, "updatedAt", c.UpdatedAt) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterProperties. +func (c *ClusterProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulate(val, "CreatedAt", &c.CreatedAt) + delete(rawMsg, key) + case "metricId": + err = unpopulate(val, "MetricID", &c.MetricID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) + delete(rawMsg, key) + case "supportsScaling": + err = unpopulate(val, "SupportsScaling", &c.SupportsScaling) + delete(rawMsg, key) + case "updatedAt": + err = unpopulate(val, "UpdatedAt", &c.UpdatedAt) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterQuotaConfigurationProperties. +func (c ClusterQuotaConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "settings", c.Settings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterQuotaConfigurationProperties. +func (c *ClusterQuotaConfigurationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "settings": + err = unpopulate(val, "Settings", &c.Settings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClusterSKU. +func (c ClusterSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacity", c.Capacity) + populate(objectMap, "name", c.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterSKU. +func (c *ClusterSKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &c.Capacity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectionState. +func (c ConnectionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", c.Description) + populate(objectMap, "status", c.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionState. +func (c *ConnectionState) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConsumerGroup. +func (c ConsumerGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConsumerGroup. +func (c *ConsumerGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConsumerGroupListResult. +func (c ConsumerGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConsumerGroupListResult. +func (c *ConsumerGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConsumerGroupProperties. +func (c ConsumerGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", c.CreatedAt) + populateTimeRFC3339(objectMap, "updatedAt", c.UpdatedAt) + populate(objectMap, "userMetadata", c.UserMetadata) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConsumerGroupProperties. +func (c *ConsumerGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &c.CreatedAt) + delete(rawMsg, key) + case "updatedAt": + err = unpopulateTimeRFC3339(val, "UpdatedAt", &c.UpdatedAt) + delete(rawMsg, key) + case "userMetadata": + err = unpopulate(val, "UserMetadata", &c.UserMetadata) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Destination. +func (d Destination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Destination. +func (d *Destination) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DestinationProperties. +func (d DestinationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "archiveNameFormat", d.ArchiveNameFormat) + populate(objectMap, "blobContainer", d.BlobContainer) + populate(objectMap, "dataLakeAccountName", d.DataLakeAccountName) + populate(objectMap, "dataLakeFolderPath", d.DataLakeFolderPath) + populate(objectMap, "dataLakeSubscriptionId", d.DataLakeSubscriptionID) + populate(objectMap, "storageAccountResourceId", d.StorageAccountResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DestinationProperties. +func (d *DestinationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "archiveNameFormat": + err = unpopulate(val, "ArchiveNameFormat", &d.ArchiveNameFormat) + delete(rawMsg, key) + case "blobContainer": + err = unpopulate(val, "BlobContainer", &d.BlobContainer) + delete(rawMsg, key) + case "dataLakeAccountName": + err = unpopulate(val, "DataLakeAccountName", &d.DataLakeAccountName) + delete(rawMsg, key) + case "dataLakeFolderPath": + err = unpopulate(val, "DataLakeFolderPath", &d.DataLakeFolderPath) + delete(rawMsg, key) + case "dataLakeSubscriptionId": + err = unpopulate(val, "DataLakeSubscriptionID", &d.DataLakeSubscriptionID) + delete(rawMsg, key) + case "storageAccountResourceId": + err = unpopulate(val, "StorageAccountResourceID", &d.StorageAccountResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EHNamespace. +func (e EHNamespace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "identity", e.Identity) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "sku", e.SKU) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EHNamespace. +func (e *EHNamespace) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &e.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &e.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EHNamespaceIDContainer. +func (e EHNamespaceIDContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EHNamespaceIDContainer. +func (e *EHNamespaceIDContainer) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EHNamespaceIDListResult. +func (e EHNamespaceIDListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EHNamespaceIDListResult. +func (e *EHNamespaceIDListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EHNamespaceListResult. +func (e EHNamespaceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EHNamespaceListResult. +func (e *EHNamespaceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EHNamespaceProperties. +func (e EHNamespaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alternateName", e.AlternateName) + populate(objectMap, "clusterArmId", e.ClusterArmID) + populateTimeRFC3339(objectMap, "createdAt", e.CreatedAt) + populate(objectMap, "disableLocalAuth", e.DisableLocalAuth) + populate(objectMap, "encryption", e.Encryption) + populate(objectMap, "isAutoInflateEnabled", e.IsAutoInflateEnabled) + populate(objectMap, "kafkaEnabled", e.KafkaEnabled) + populate(objectMap, "maximumThroughputUnits", e.MaximumThroughputUnits) + populate(objectMap, "metricId", e.MetricID) + populate(objectMap, "minimumTlsVersion", e.MinimumTLSVersion) + populate(objectMap, "privateEndpointConnections", e.PrivateEndpointConnections) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "publicNetworkAccess", e.PublicNetworkAccess) + populate(objectMap, "serviceBusEndpoint", e.ServiceBusEndpoint) + populate(objectMap, "status", e.Status) + populateTimeRFC3339(objectMap, "updatedAt", e.UpdatedAt) + populate(objectMap, "zoneRedundant", e.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EHNamespaceProperties. +func (e *EHNamespaceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alternateName": + err = unpopulate(val, "AlternateName", &e.AlternateName) + delete(rawMsg, key) + case "clusterArmId": + err = unpopulate(val, "ClusterArmID", &e.ClusterArmID) + delete(rawMsg, key) + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &e.CreatedAt) + delete(rawMsg, key) + case "disableLocalAuth": + err = unpopulate(val, "DisableLocalAuth", &e.DisableLocalAuth) + delete(rawMsg, key) + case "encryption": + err = unpopulate(val, "Encryption", &e.Encryption) + delete(rawMsg, key) + case "isAutoInflateEnabled": + err = unpopulate(val, "IsAutoInflateEnabled", &e.IsAutoInflateEnabled) + delete(rawMsg, key) + case "kafkaEnabled": + err = unpopulate(val, "KafkaEnabled", &e.KafkaEnabled) + delete(rawMsg, key) + case "maximumThroughputUnits": + err = unpopulate(val, "MaximumThroughputUnits", &e.MaximumThroughputUnits) + delete(rawMsg, key) + case "metricId": + err = unpopulate(val, "MetricID", &e.MetricID) + delete(rawMsg, key) + case "minimumTlsVersion": + err = unpopulate(val, "MinimumTLSVersion", &e.MinimumTLSVersion) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &e.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &e.PublicNetworkAccess) + delete(rawMsg, key) + case "serviceBusEndpoint": + err = unpopulate(val, "ServiceBusEndpoint", &e.ServiceBusEndpoint) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "updatedAt": + err = unpopulateTimeRFC3339(val, "UpdatedAt", &e.UpdatedAt) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Encryption. +func (e Encryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["keySource"] = "Microsoft.KeyVault" + populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) + populate(objectMap, "requireInfrastructureEncryption", e.RequireInfrastructureEncryption) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Encryption. +func (e *Encryption) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keySource": + err = unpopulate(val, "KeySource", &e.KeySource) + delete(rawMsg, key) + case "keyVaultProperties": + err = unpopulate(val, "KeyVaultProperties", &e.KeyVaultProperties) + delete(rawMsg, key) + case "requireInfrastructureEncryption": + err = unpopulate(val, "RequireInfrastructureEncryption", &e.RequireInfrastructureEncryption) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "info", &e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Eventhub. +func (e Eventhub) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", e.ID) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Eventhub. +func (e *Eventhub) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + populate(objectMap, "type", i.Type) + populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Identity. +func (i *Identity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyVaultProperties. +func (k KeyVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", k.Identity) + populate(objectMap, "keyName", k.KeyName) + populate(objectMap, "keyVaultUri", k.KeyVaultURI) + populate(objectMap, "keyVersion", k.KeyVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultProperties. +func (k *KeyVaultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &k.Identity) + delete(rawMsg, key) + case "keyName": + err = unpopulate(val, "KeyName", &k.KeyName) + delete(rawMsg, key) + case "keyVaultUri": + err = unpopulate(val, "KeyVaultURI", &k.KeyVaultURI) + delete(rawMsg, key) + case "keyVersion": + err = unpopulate(val, "KeyVersion", &k.KeyVersion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListResult. +func (l ListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListResult. +func (l *ListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NWRuleSetIPRules. +func (n NWRuleSetIPRules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "action", n.Action) + populate(objectMap, "ipMask", n.IPMask) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NWRuleSetIPRules. +func (n *NWRuleSetIPRules) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &n.Action) + delete(rawMsg, key) + case "ipMask": + err = unpopulate(val, "IPMask", &n.IPMask) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NWRuleSetVirtualNetworkRules. +func (n NWRuleSetVirtualNetworkRules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ignoreMissingVnetServiceEndpoint", n.IgnoreMissingVnetServiceEndpoint) + populate(objectMap, "subnet", n.Subnet) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NWRuleSetVirtualNetworkRules. +func (n *NWRuleSetVirtualNetworkRules) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ignoreMissingVnetServiceEndpoint": + err = unpopulate(val, "IgnoreMissingVnetServiceEndpoint", &n.IgnoreMissingVnetServiceEndpoint) + delete(rawMsg, key) + case "subnet": + err = unpopulate(val, "Subnet", &n.Subnet) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet. +func (n NetworkRuleSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet. +func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSetListResult. +func (n NetworkRuleSetListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSetListResult. +func (n *NetworkRuleSetListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSetProperties. +func (n NetworkRuleSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "defaultAction", n.DefaultAction) + populate(objectMap, "ipRules", n.IPRules) + populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) + populate(objectMap, "trustedServiceAccessEnabled", n.TrustedServiceAccessEnabled) + populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSetProperties. +func (n *NetworkRuleSetProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "defaultAction": + err = unpopulate(val, "DefaultAction", &n.DefaultAction) + delete(rawMsg, key) + case "ipRules": + err = unpopulate(val, "IPRules", &n.IPRules) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &n.PublicNetworkAccess) + delete(rawMsg, key) + case "trustedServiceAccessEnabled": + err = unpopulate(val, "TrustedServiceAccessEnabled", &n.TrustedServiceAccessEnabled) + delete(rawMsg, key) + case "virtualNetworkRules": + err = unpopulate(val, "VirtualNetworkRules", &n.VirtualNetworkRules) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeter. +func (n NetworkSecurityPerimeter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "perimeterGuid", n.PerimeterGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeter. +func (n *NetworkSecurityPerimeter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "perimeterGuid": + err = unpopulate(val, "PerimeterGUID", &n.PerimeterGUID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n *NetworkSecurityPerimeterConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationList. +func (n NetworkSecurityPerimeterConfigurationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationList. +func (n *NetworkSecurityPerimeterConfigurationList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "networkSecurityPerimeter", n.NetworkSecurityPerimeter) + populate(objectMap, "profile", n.Profile) + populate(objectMap, "provisioningIssues", n.ProvisioningIssues) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "resourceAssociation", n.ResourceAssociation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n *NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkSecurityPerimeter": + err = unpopulate(val, "NetworkSecurityPerimeter", &n.NetworkSecurityPerimeter) + delete(rawMsg, key) + case "profile": + err = unpopulate(val, "Profile", &n.Profile) + delete(rawMsg, key) + case "provisioningIssues": + err = unpopulate(val, "ProvisioningIssues", &n.ProvisioningIssues) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "resourceAssociation": + err = unpopulate(val, "ResourceAssociation", &n.ResourceAssociation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesProfile. +func (n NetworkSecurityPerimeterConfigurationPropertiesProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accessRules", n.AccessRules) + populate(objectMap, "accessRulesVersion", n.AccessRulesVersion) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesProfile. +func (n *NetworkSecurityPerimeterConfigurationPropertiesProfile) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessRules": + err = unpopulate(val, "AccessRules", &n.AccessRules) + delete(rawMsg, key) + case "accessRulesVersion": + err = unpopulate(val, "AccessRulesVersion", &n.AccessRulesVersion) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation. +func (n NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accessMode", n.AccessMode) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation. +func (n *NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessMode": + err = unpopulate(val, "AccessMode", &n.AccessMode) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspAccessRule. +func (n NspAccessRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRule. +func (n *NspAccessRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspAccessRuleProperties. +func (n NspAccessRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "addressPrefixes", n.AddressPrefixes) + populate(objectMap, "direction", n.Direction) + populate(objectMap, "fullyQualifiedDomainNames", n.FullyQualifiedDomainNames) + populate(objectMap, "networkSecurityPerimeters", n.NetworkSecurityPerimeters) + populate(objectMap, "subscriptions", n.Subscriptions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRuleProperties. +func (n *NspAccessRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &n.AddressPrefixes) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &n.Direction) + delete(rawMsg, key) + case "fullyQualifiedDomainNames": + err = unpopulate(val, "FullyQualifiedDomainNames", &n.FullyQualifiedDomainNames) + delete(rawMsg, key) + case "networkSecurityPerimeters": + err = unpopulate(val, "NetworkSecurityPerimeters", &n.NetworkSecurityPerimeters) + delete(rawMsg, key) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &n.Subscriptions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NspAccessRulePropertiesSubscriptionsItem. +func (n NspAccessRulePropertiesSubscriptionsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", n.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NspAccessRulePropertiesSubscriptionsItem. +func (n *NspAccessRulePropertiesSubscriptionsItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", &o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpoint. +func (p PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpoint. +func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourcesListResult. +func (p PrivateLinkResourcesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourcesListResult. +func (p *PrivateLinkResourcesListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Properties. +func (p Properties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "captureDescription", p.CaptureDescription) + populateTimeRFC3339(objectMap, "createdAt", p.CreatedAt) + populate(objectMap, "messageRetentionInDays", p.MessageRetentionInDays) + populate(objectMap, "partitionCount", p.PartitionCount) + populate(objectMap, "partitionIds", p.PartitionIDs) + populate(objectMap, "retentionDescription", p.RetentionDescription) + populate(objectMap, "status", p.Status) + populateTimeRFC3339(objectMap, "updatedAt", p.UpdatedAt) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Properties. +func (p *Properties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "captureDescription": + err = unpopulate(val, "CaptureDescription", &p.CaptureDescription) + delete(rawMsg, key) + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &p.CreatedAt) + delete(rawMsg, key) + case "messageRetentionInDays": + err = unpopulate(val, "MessageRetentionInDays", &p.MessageRetentionInDays) + delete(rawMsg, key) + case "partitionCount": + err = unpopulate(val, "PartitionCount", &p.PartitionCount) + delete(rawMsg, key) + case "partitionIds": + err = unpopulate(val, "PartitionIDs", &p.PartitionIDs) + delete(rawMsg, key) + case "retentionDescription": + err = unpopulate(val, "RetentionDescription", &p.RetentionDescription) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + case "updatedAt": + err = unpopulateTimeRFC3339(val, "UpdatedAt", &p.UpdatedAt) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssue. +func (p ProvisioningIssue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssue. +func (p *ProvisioningIssue) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProvisioningIssueProperties. +func (p ProvisioningIssueProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", p.Description) + populate(objectMap, "issueType", p.IssueType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProvisioningIssueProperties. +func (p *ProvisioningIssueProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "issueType": + err = unpopulate(val, "IssueType", &p.IssueType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegenerateAccessKeyParameters. +func (r RegenerateAccessKeyParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "key", r.Key) + populate(objectMap, "keyType", r.KeyType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegenerateAccessKeyParameters. +func (r *RegenerateAccessKeyParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "key": + err = unpopulate(val, "Key", &r.Key) + delete(rawMsg, key) + case "keyType": + err = unpopulate(val, "KeyType", &r.KeyType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RetentionDescription. +func (r RetentionDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cleanupPolicy", r.CleanupPolicy) + populate(objectMap, "retentionTimeInHours", r.RetentionTimeInHours) + populate(objectMap, "tombstoneRetentionTimeInHours", r.TombstoneRetentionTimeInHours) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RetentionDescription. +func (r *RetentionDescription) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cleanupPolicy": + err = unpopulate(val, "CleanupPolicy", &r.CleanupPolicy) + delete(rawMsg, key) + case "retentionTimeInHours": + err = unpopulate(val, "RetentionTimeInHours", &r.RetentionTimeInHours) + delete(rawMsg, key) + case "tombstoneRetentionTimeInHours": + err = unpopulate(val, "TombstoneRetentionTimeInHours", &r.TombstoneRetentionTimeInHours) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "name", s.Name) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SchemaGroup. +func (s SchemaGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SchemaGroup. +func (s *SchemaGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SchemaGroupListResult. +func (s SchemaGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SchemaGroupListResult. +func (s *SchemaGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SchemaGroupProperties. +func (s SchemaGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAtUtc", s.CreatedAtUTC) + populate(objectMap, "eTag", s.ETag) + populate(objectMap, "groupProperties", s.GroupProperties) + populate(objectMap, "schemaCompatibility", s.SchemaCompatibility) + populate(objectMap, "schemaType", s.SchemaType) + populateTimeRFC3339(objectMap, "updatedAtUtc", s.UpdatedAtUTC) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SchemaGroupProperties. +func (s *SchemaGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAtUtc": + err = unpopulateTimeRFC3339(val, "CreatedAtUTC", &s.CreatedAtUTC) + delete(rawMsg, key) + case "eTag": + err = unpopulate(val, "ETag", &s.ETag) + delete(rawMsg, key) + case "groupProperties": + err = unpopulate(val, "GroupProperties", &s.GroupProperties) + delete(rawMsg, key) + case "schemaCompatibility": + err = unpopulate(val, "SchemaCompatibility", &s.SchemaCompatibility) + delete(rawMsg, key) + case "schemaType": + err = unpopulate(val, "SchemaType", &s.SchemaType) + delete(rawMsg, key) + case "updatedAtUtc": + err = unpopulateTimeRFC3339(val, "UpdatedAtUTC", &s.UpdatedAtUTC) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Subnet. +func (s Subnet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Subnet. +func (s *Subnet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ThrottlingPolicy. +func (t ThrottlingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metricId", t.MetricID) + populate(objectMap, "name", t.Name) + populate(objectMap, "rateLimitThreshold", t.RateLimitThreshold) + objectMap["type"] = ApplicationGroupPolicyTypeThrottlingPolicy + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ThrottlingPolicy. +func (t *ThrottlingPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metricId": + err = unpopulate(val, "MetricID", &t.MetricID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "rateLimitThreshold": + err = unpopulate(val, "RateLimitThreshold", &t.RateLimitThreshold) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. +func (t *TrackedResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &t.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &t.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentityProperties. +func (u UserAssignedIdentityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "userAssignedIdentity", u.UserAssignedIdentity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentityProperties. +func (u *UserAssignedIdentityProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "userAssignedIdentity": + err = unpopulate(val, "UserAssignedIdentity", &u.UserAssignedIdentity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_namespaces_client.go b/sdk/resourcemanager/eventhub/armeventhub/namespaces_client.go similarity index 96% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_namespaces_client.go rename to sdk/resourcemanager/eventhub/armeventhub/namespaces_client.go index d5b46558c06d..124c15e485fb 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_namespaces_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/namespaces_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -57,7 +58,7 @@ func NewNamespacesClient(subscriptionID string, credential azcore.TokenCredentia // CheckNameAvailability - Check the give Namespace name availability. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // parameters - Parameters to check availability of the given Namespace name // options - NamespacesClientCheckNameAvailabilityOptions contains the optional parameters for the NamespacesClient.CheckNameAvailability // method. @@ -88,7 +89,7 @@ func (client *NamespacesClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -106,7 +107,7 @@ func (client *NamespacesClient) checkNameAvailabilityHandleResponse(resp *http.R // BeginCreateOrUpdate - Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This // operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // parameters - Parameters for creating a namespace resource. @@ -127,7 +128,7 @@ func (client *NamespacesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation // is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview func (client *NamespacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, parameters EHNamespace, options *NamespacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, parameters, options) if err != nil { @@ -163,7 +164,7 @@ func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -171,7 +172,7 @@ func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, // CreateOrUpdateAuthorizationRule - Creates or updates an AuthorizationRule for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -217,7 +218,7 @@ func (client *NamespacesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -234,7 +235,7 @@ func (client *NamespacesClient) createOrUpdateAuthorizationRuleHandleResponse(re // CreateOrUpdateNetworkRuleSet - Create or update NetworkRuleSet for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // parameters - The Namespace IpFilterRule. @@ -275,7 +276,7 @@ func (client *NamespacesClient) createOrUpdateNetworkRuleSetCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -292,7 +293,7 @@ func (client *NamespacesClient) createOrUpdateNetworkRuleSetHandleResponse(resp // BeginDelete - Deletes an existing namespace. This operation also removes all associated resources under the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - NamespacesClientBeginDeleteOptions contains the optional parameters for the NamespacesClient.BeginDelete method. @@ -310,7 +311,7 @@ func (client *NamespacesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes an existing namespace. This operation also removes all associated resources under the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview func (client *NamespacesClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, options) if err != nil { @@ -346,7 +347,7 @@ func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,7 +355,7 @@ func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourc // DeleteAuthorizationRule - Deletes an AuthorizationRule for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -399,7 +400,7 @@ func (client *NamespacesClient) deleteAuthorizationRuleCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -407,7 +408,7 @@ func (client *NamespacesClient) deleteAuthorizationRuleCreateRequest(ctx context // Get - Gets the description of the specified namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - NamespacesClientGetOptions contains the optional parameters for the NamespacesClient.Get method. @@ -446,7 +447,7 @@ func (client *NamespacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -463,7 +464,7 @@ func (client *NamespacesClient) getHandleResponse(resp *http.Response) (Namespac // GetAuthorizationRule - Gets an AuthorizationRule for a Namespace by rule name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -508,7 +509,7 @@ func (client *NamespacesClient) getAuthorizationRuleCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -525,7 +526,7 @@ func (client *NamespacesClient) getAuthorizationRuleHandleResponse(resp *http.Re // GetNetworkRuleSet - Gets NetworkRuleSet for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - NamespacesClientGetNetworkRuleSetOptions contains the optional parameters for the NamespacesClient.GetNetworkRuleSet @@ -565,7 +566,7 @@ func (client *NamespacesClient) getNetworkRuleSetCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -581,8 +582,7 @@ func (client *NamespacesClient) getNetworkRuleSetHandleResponse(resp *http.Respo } // NewListPager - Lists all the available Namespaces within a subscription, irrespective of the resource groups. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // options - NamespacesClientListOptions contains the optional parameters for the NamespacesClient.List method. func (client *NamespacesClient) NewListPager(options *NamespacesClientListOptions) *runtime.Pager[NamespacesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[NamespacesClientListResponse]{ @@ -624,7 +624,7 @@ func (client *NamespacesClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -640,8 +640,7 @@ func (client *NamespacesClient) listHandleResponse(resp *http.Response) (Namespa } // NewListAuthorizationRulesPager - Gets a list of authorization rules for a Namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - NamespacesClientListAuthorizationRulesOptions contains the optional parameters for the NamespacesClient.ListAuthorizationRules @@ -694,7 +693,7 @@ func (client *NamespacesClient) listAuthorizationRulesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -710,8 +709,7 @@ func (client *NamespacesClient) listAuthorizationRulesHandleResponse(resp *http. } // NewListByResourceGroupPager - Lists the available Namespaces within a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // options - NamespacesClientListByResourceGroupOptions contains the optional parameters for the NamespacesClient.ListByResourceGroup // method. @@ -759,7 +757,7 @@ func (client *NamespacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -776,7 +774,7 @@ func (client *NamespacesClient) listByResourceGroupHandleResponse(resp *http.Res // ListKeys - Gets the primary and secondary connection strings for the Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -820,7 +818,7 @@ func (client *NamespacesClient) listKeysCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -837,7 +835,7 @@ func (client *NamespacesClient) listKeysHandleResponse(resp *http.Response) (Nam // ListNetworkRuleSet - Gets NetworkRuleSet for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - NamespacesClientListNetworkRuleSetOptions contains the optional parameters for the NamespacesClient.ListNetworkRuleSet @@ -877,7 +875,7 @@ func (client *NamespacesClient) listNetworkRuleSetCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -894,7 +892,7 @@ func (client *NamespacesClient) listNetworkRuleSetHandleResponse(resp *http.Resp // RegenerateKeys - Regenerates the primary or secondary connection strings for the specified Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -940,7 +938,7 @@ func (client *NamespacesClient) regenerateKeysCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -958,7 +956,7 @@ func (client *NamespacesClient) regenerateKeysHandleResponse(resp *http.Response // Update - Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation // is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // parameters - Parameters for updating a namespace resource. @@ -998,7 +996,7 @@ func (client *NamespacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_networksecurityperimeterconfiguration_client.go b/sdk/resourcemanager/eventhub/armeventhub/networksecurityperimeterconfiguration_client.go similarity index 97% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_networksecurityperimeterconfiguration_client.go rename to sdk/resourcemanager/eventhub/armeventhub/networksecurityperimeterconfiguration_client.go index 94b210998642..094de24ec14e 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_networksecurityperimeterconfiguration_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/networksecurityperimeterconfiguration_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -57,7 +58,7 @@ func NewNetworkSecurityPerimeterConfigurationClient(subscriptionID string, crede // List - Gets list of current NetworkSecurityPerimeterConfiguration for Namespace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - NetworkSecurityPerimeterConfigurationClientListOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationClient.List @@ -97,7 +98,7 @@ func (client *NetworkSecurityPerimeterConfigurationClient) listCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_networksecurityperimeterconfigurations_client.go b/sdk/resourcemanager/eventhub/armeventhub/networksecurityperimeterconfigurations_client.go similarity index 97% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_networksecurityperimeterconfigurations_client.go rename to sdk/resourcemanager/eventhub/armeventhub/networksecurityperimeterconfigurations_client.go index 7f08e9db0b97..e1058aa83323 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_networksecurityperimeterconfigurations_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/networksecurityperimeterconfigurations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -57,7 +58,7 @@ func NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, cred // BeginCreateOrUpdate - Refreshes any information about the association. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // resourceAssociationName - The ResourceAssociation Name @@ -77,7 +78,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) BeginCreateOrUpdate( // CreateOrUpdate - Refreshes any information about the association. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview func (client *NetworkSecurityPerimeterConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, resourceAssociationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, resourceAssociationName, options) if err != nil { @@ -117,7 +118,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) createOrUpdateCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_operations_client.go b/sdk/resourcemanager/eventhub/armeventhub/operations_client.go similarity index 95% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_operations_client.go rename to sdk/resourcemanager/eventhub/armeventhub/operations_client.go index 340692126fe0..7ecc3421e80c 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_operations_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/operations_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -49,8 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all of the available Event Hub REST API operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/eventhub/armeventhub/polymorphic_helpers.go similarity index 98% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_polymorphic_helpers.go rename to sdk/resourcemanager/eventhub/armeventhub/polymorphic_helpers.go index 685728d00e21..7f0138471437 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/eventhub/armeventhub/polymorphic_helpers.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/eventhub/armeventhub/privateendpointconnections_client.go similarity index 96% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_privateendpointconnections_client.go rename to sdk/resourcemanager/eventhub/armeventhub/privateendpointconnections_client.go index caaf1ea1d962..7cb846138391 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/privateendpointconnections_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -57,7 +58,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // CreateOrUpdate - Creates or updates PrivateEndpointConnections of service namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -73,7 +74,7 @@ func (client *PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Conte if err != nil { return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) } return client.createOrUpdateHandleResponse(resp) @@ -103,7 +104,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +121,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateHandleResponse(res // BeginDelete - Deletes an existing namespace. This operation also removes all associated resources under the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -140,7 +141,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes an existing namespace. This operation also removes all associated resources under the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName, options) if err != nil { @@ -180,7 +181,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +189,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets a description for the specified Private Endpoint Connection name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -233,7 +234,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,8 +250,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res } // NewListPager - Gets the available PrivateEndpointConnections within a namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List @@ -303,7 +303,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/eventhub/armeventhub/privatelinkresources_client.go similarity index 97% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_privatelinkresources_client.go rename to sdk/resourcemanager/eventhub/armeventhub/privatelinkresources_client.go index 76bc28bc79ff..1f7952e924fe 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/privatelinkresources_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -57,7 +58,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets lists of resources that supports Privatelinks. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get @@ -97,7 +98,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_response_types.go b/sdk/resourcemanager/eventhub/armeventhub/response_types.go similarity index 99% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_response_types.go rename to sdk/resourcemanager/eventhub/armeventhub/response_types.go index 93a45fd591f9..87f5be78ecf1 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_response_types.go +++ b/sdk/resourcemanager/eventhub/armeventhub/response_types.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_schemaregistry_client.go b/sdk/resourcemanager/eventhub/armeventhub/schemaregistry_client.go similarity index 96% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_schemaregistry_client.go rename to sdk/resourcemanager/eventhub/armeventhub/schemaregistry_client.go index bc4e7d1e1931..28cddaaf07a1 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_schemaregistry_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/schemaregistry_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub @@ -58,7 +59,7 @@ func NewSchemaRegistryClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // schemaGroupName - The Schema Group name @@ -104,7 +105,7 @@ func (client *SchemaRegistryClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +122,7 @@ func (client *SchemaRegistryClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // schemaGroupName - The Schema Group name @@ -165,7 +166,7 @@ func (client *SchemaRegistryClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,7 +174,7 @@ func (client *SchemaRegistryClient) deleteCreateRequest(ctx context.Context, res // Get - // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // schemaGroupName - The Schema Group name @@ -217,7 +218,7 @@ func (client *SchemaRegistryClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -233,8 +234,7 @@ func (client *SchemaRegistryClient) getHandleResponse(resp *http.Response) (Sche } // NewListByNamespacePager - Gets all the Schema Groups in a Namespace. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2022-10-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - SchemaRegistryClientListByNamespaceOptions contains the optional parameters for the SchemaRegistryClient.ListByNamespace @@ -287,7 +287,7 @@ func (client *SchemaRegistryClient) listByNamespaceCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") + reqQP.Set("api-version", "2022-10-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_time_rfc3339.go b/sdk/resourcemanager/eventhub/armeventhub/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/eventhub/armeventhub/time_rfc3339.go index 374c352402ae..d669d9e96059 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/eventhub/armeventhub/time_rfc3339.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armeventhub diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_applicationgroup_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_applicationgroup_client_test.go deleted file mode 100644 index 823fff537561..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_applicationgroup_client_test.go +++ /dev/null @@ -1,136 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ApplicationGroup/ApplicationGroupListByNamespace.json -func ExampleApplicationGroupClient_NewListByNamespacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewApplicationGroupClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByNamespacePager("contosotest", - "contoso-ua-test-eh-system-1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ApplicationGroup/ApplicationGroupCreate.json -func ExampleApplicationGroupClient_CreateOrUpdateApplicationGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewApplicationGroupClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdateApplicationGroup(ctx, - "contosotest", - "contoso-ua-test-eh-system-1", - "appGroup1", - armeventhub.ApplicationGroup{ - Properties: &armeventhub.ApplicationGroupProperties{ - ClientAppGroupIdentifier: to.Ptr("SASKeyName=KeyName"), - IsEnabled: to.Ptr(true), - Policies: []armeventhub.ApplicationGroupPolicyClassification{ - &armeventhub.ThrottlingPolicy{ - Name: to.Ptr("ThrottlingPolicy1"), - Type: to.Ptr(armeventhub.ApplicationGroupPolicyTypeThrottlingPolicy), - MetricID: to.Ptr(armeventhub.MetricIDIncomingMessages), - RateLimitThreshold: to.Ptr[int64](7912), - }, - &armeventhub.ThrottlingPolicy{ - Name: to.Ptr("ThrottlingPolicy2"), - Type: to.Ptr(armeventhub.ApplicationGroupPolicyTypeThrottlingPolicy), - MetricID: to.Ptr(armeventhub.MetricIDIncomingBytes), - RateLimitThreshold: to.Ptr[int64](3951729), - }, - &armeventhub.ThrottlingPolicy{ - Name: to.Ptr("ThrottlingPolicy3"), - Type: to.Ptr(armeventhub.ApplicationGroupPolicyTypeThrottlingPolicy), - MetricID: to.Ptr(armeventhub.MetricIDOutgoingBytes), - RateLimitThreshold: to.Ptr[int64](245175), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ApplicationGroup/ApplicationGroupDelete.json -func ExampleApplicationGroupClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewApplicationGroupClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "contosotest", - "contoso-ua-test-eh-system-1", - "appGroup1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ApplicationGroup/ApplicationGroupGet.json -func ExampleApplicationGroupClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewApplicationGroupClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "contosotest", - "contoso-ua-test-eh-system-1", - "appGroup1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_clusters_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_clusters_client_test.go deleted file mode 100644 index e5d326140cc9..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_clusters_client_test.go +++ /dev/null @@ -1,225 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ListAvailableClustersGet.json -func ExampleClustersClient_ListAvailableClusterRegion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewClustersClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListAvailableClusterRegion(ctx, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClustersListBySubscription.json -func ExampleClustersClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewClustersClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClustersListByResourceGroup.json -func ExampleClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewClustersClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClusterGet.json -func ExampleClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewClustersClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "testCluster", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClusterPut.json -func ExampleClustersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewClustersClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "testCluster", - armeventhub.Cluster{ - Location: to.Ptr("South Central US"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - }, - SKU: &armeventhub.ClusterSKU{ - Name: to.Ptr(armeventhub.ClusterSKUNameDedicated), - Capacity: to.Ptr[int32](1), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClusterPatch.json -func ExampleClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewClustersClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "testCluster", - armeventhub.Cluster{ - Location: to.Ptr("South Central US"), - Tags: map[string]*string{ - "tag3": to.Ptr("value3"), - "tag4": to.Ptr("value4"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClusterDelete.json -func ExampleClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewClustersClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "testCluster", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ListNamespacesInClusterGet.json -func ExampleClustersClient_ListNamespaces() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewClustersClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListNamespaces(ctx, - "myResourceGroup", - "testCluster", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_configuration_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_configuration_client_test.go deleted file mode 100644 index 2c0b527eff7f..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_configuration_client_test.go +++ /dev/null @@ -1,68 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClusterQuotaConfigurationPatch.json -func ExampleConfigurationClient_Patch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewConfigurationClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Patch(ctx, - "ArunMonocle", - "testCluster", - armeventhub.ClusterQuotaConfigurationProperties{ - Settings: map[string]*string{ - "eventhub-per-namespace-quota": to.Ptr("20"), - "namespaces-per-cluster-quota": to.Ptr("200"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClusterQuotaConfigurationGet.json -func ExampleConfigurationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewConfigurationClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "testCluster", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_consumergroups_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_consumergroups_client_test.go deleted file mode 100644 index f4b3da324337..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_consumergroups_client_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ConsumerGroup/EHConsumerGroupCreate.json -func ExampleConsumerGroupsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewConsumerGroupsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "ArunMonocle", - "sdk-Namespace-2661", - "sdk-EventHub-6681", - "sdk-ConsumerGroup-5563", - armeventhub.ConsumerGroup{ - Properties: &armeventhub.ConsumerGroupProperties{ - UserMetadata: to.Ptr("New consumergroup"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ConsumerGroup/EHConsumerGroupDelete.json -func ExampleConsumerGroupsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewConsumerGroupsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "ArunMonocle", - "sdk-Namespace-2661", - "sdk-EventHub-6681", - "sdk-ConsumerGroup-5563", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ConsumerGroup/EHConsumerGroupGet.json -func ExampleConsumerGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewConsumerGroupsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ArunMonocle", - "sdk-Namespace-2661", - "sdk-EventHub-6681", - "sdk-ConsumerGroup-5563", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ConsumerGroup/EHConsumerGroupListByEventHub.json -func ExampleConsumerGroupsClient_NewListByEventHubPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewConsumerGroupsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByEventHubPager("ArunMonocle", - "sdk-Namespace-2661", - "sdk-EventHub-6681", - &armeventhub.ConsumerGroupsClientListByEventHubOptions{Skip: nil, - Top: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_disasterrecoveryconfigs_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_disasterrecoveryconfigs_client_test.go deleted file mode 100644 index 966dbed6ad54..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_disasterrecoveryconfigs_client_test.go +++ /dev/null @@ -1,258 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleListAll.json -func ExampleDisasterRecoveryConfigsClient_NewListAuthorizationRulesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAuthorizationRulesPager("exampleResourceGroup", - "sdk-Namespace-9080", - "sdk-DisasterRecovery-4047", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleGet.json -func ExampleDisasterRecoveryConfigsClient_GetAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAuthorizationRule(ctx, - "exampleResourceGroup", - "sdk-Namespace-9080", - "sdk-DisasterRecovery-4879", - "sdk-Authrules-4879", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleListKey.json -func ExampleDisasterRecoveryConfigsClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeys(ctx, - "exampleResourceGroup", - "sdk-Namespace-2702", - "sdk-DisasterRecovery-4047", - "sdk-Authrules-1746", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasCheckNameAvailability.json -func ExampleDisasterRecoveryConfigsClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - "exampleResourceGroup", - "sdk-Namespace-9080", - armeventhub.CheckNameAvailabilityParameter{ - Name: to.Ptr("sdk-DisasterRecovery-9474"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasList.json -func ExampleDisasterRecoveryConfigsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("exampleResourceGroup", - "sdk-Namespace-8859", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasCreate.json -func ExampleDisasterRecoveryConfigsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "exampleResourceGroup", - "sdk-Namespace-8859", - "sdk-DisasterRecovery-3814", - armeventhub.ArmDisasterRecovery{ - Properties: &armeventhub.ArmDisasterRecoveryProperties{ - PartnerNamespace: to.Ptr("sdk-Namespace-37"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasDelete.json -func ExampleDisasterRecoveryConfigsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "exampleResourceGroup", - "sdk-Namespace-5849", - "sdk-DisasterRecovery-3814", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasGet.json -func ExampleDisasterRecoveryConfigsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "exampleResourceGroup", - "sdk-Namespace-8859", - "sdk-DisasterRecovery-3814", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasBreakPairing.json -func ExampleDisasterRecoveryConfigsClient_BreakPairing() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.BreakPairing(ctx, - "exampleResourceGroup", - "sdk-Namespace-8859", - "sdk-DisasterRecovery-3814", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasFailOver.json -func ExampleDisasterRecoveryConfigsClient_FailOver() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.FailOver(ctx, - "exampleResourceGroup", - "sdk-Namespace-8859", - "sdk-DisasterRecovery-3814", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_eventhubs_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_eventhubs_client_test.go deleted file mode 100644 index ef6adfef497c..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_eventhubs_client_test.go +++ /dev/null @@ -1,289 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubAuthorizationRuleListAll.json -func ExampleEventHubsClient_NewListAuthorizationRulesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAuthorizationRulesPager("ArunMonocle", - "sdk-Namespace-960", - "sdk-EventHub-532", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubAuthorizationRuleCreate.json -func ExampleEventHubsClient_CreateOrUpdateAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdateAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-960", - "sdk-EventHub-532", - "sdk-Authrules-2513", - armeventhub.AuthorizationRule{ - Properties: &armeventhub.AuthorizationRuleProperties{ - Rights: []*armeventhub.AccessRights{ - to.Ptr(armeventhub.AccessRightsListen), - to.Ptr(armeventhub.AccessRightsSend)}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubAuthorizationRuleGet.json -func ExampleEventHubsClient_GetAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-960", - "sdk-EventHub-532", - "sdk-Authrules-2513", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubAuthorizationRuleDelete.json -func ExampleEventHubsClient_DeleteAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DeleteAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-960", - "sdk-EventHub-532", - "sdk-Authrules-2513", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubAuthorizationRuleListKey.json -func ExampleEventHubsClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeys(ctx, - "ArunMonocle", - "sdk-namespace-960", - "sdk-EventHub-532", - "sdk-Authrules-2513", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubAuthorizationRuleRegenerateKey.json -func ExampleEventHubsClient_RegenerateKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RegenerateKeys(ctx, - "ArunMonocle", - "sdk-namespace-960", - "sdk-EventHub-532", - "sdk-Authrules-1534", - armeventhub.RegenerateAccessKeyParameters{ - KeyType: to.Ptr(armeventhub.KeyTypePrimaryKey), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubListByNameSpace.json -func ExampleEventHubsClient_NewListByNamespacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("e2f361f0-3b27-4503-a9cc-21cfba380093", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByNamespacePager("Default-NotificationHubs-AustraliaEast", - "sdk-Namespace-5357", - &armeventhub.EventHubsClientListByNamespaceOptions{Skip: nil, - Top: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubCreate.json -func ExampleEventHubsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "Default-NotificationHubs-AustraliaEast", - "sdk-Namespace-5357", - "sdk-EventHub-6547", - armeventhub.Eventhub{ - Properties: &armeventhub.Properties{ - CaptureDescription: &armeventhub.CaptureDescription{ - Destination: &armeventhub.Destination{ - Name: to.Ptr("EventHubArchive.AzureBlockBlob"), - Properties: &armeventhub.DestinationProperties{ - ArchiveNameFormat: to.Ptr("{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"), - BlobContainer: to.Ptr("container"), - StorageAccountResourceID: to.Ptr("/subscriptions/e2f361f0-3b27-4503-a9cc-21cfba380093/resourceGroups/Default-Storage-SouthCentralUS/providers/Microsoft.ClassicStorage/storageAccounts/arjunteststorage"), - }, - }, - Enabled: to.Ptr(true), - Encoding: to.Ptr(armeventhub.EncodingCaptureDescriptionAvro), - IntervalInSeconds: to.Ptr[int32](120), - SizeLimitInBytes: to.Ptr[int32](10485763), - }, - MessageRetentionInDays: to.Ptr[int64](4), - PartitionCount: to.Ptr[int64](4), - Status: to.Ptr(armeventhub.EntityStatusActive), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubDelete.json -func ExampleEventHubsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "ArunMonocle", - "sdk-Namespace-5357", - "sdk-EventHub-6547", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubGet.json -func ExampleEventHubsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("e2f361f0-3b27-4503-a9cc-21cfba380093", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-NotificationHubs-AustraliaEast", - "sdk-Namespace-716", - "sdk-EventHub-10", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_namespaces_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_namespaces_client_test.go deleted file mode 100644 index de50310deb14..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_namespaces_client_test.go +++ /dev/null @@ -1,477 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceList.json -func ExampleNamespacesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("SampleSubscription", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceListByResourceGroup.json -func ExampleNamespacesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("SampleSubscription", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("ResurceGroupSample", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceCreate.json -func ExampleNamespacesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("SampleSubscription", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "ResurceGroupSample", - "NamespaceSample", - armeventhub.EHNamespace{ - Location: to.Ptr("East US"), - Identity: &armeventhub.Identity{ - Type: to.Ptr(armeventhub.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armeventhub.UserAssignedIdentity{ - "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud1": {}, - "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud2": {}, - }, - }, - Properties: &armeventhub.EHNamespaceProperties{ - ClusterArmID: to.Ptr("/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.EventHub/clusters/enc-test"), - Encryption: &armeventhub.Encryption{ - KeySource: to.Ptr("Microsoft.KeyVault"), - KeyVaultProperties: []*armeventhub.KeyVaultProperties{ - { - Identity: &armeventhub.UserAssignedIdentityProperties{ - UserAssignedIdentity: to.Ptr("/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud1"), - }, - KeyName: to.Ptr("Samplekey"), - KeyVaultURI: to.Ptr("https://aprao-keyvault-user.vault-int.azure-int.net/"), - }}, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceDelete.json -func ExampleNamespacesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("SampleSubscription", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "ResurceGroupSample", - "NamespaceSample", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceGet.json -func ExampleNamespacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("SampleSubscription", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ResurceGroupSample", - "NamespaceSample", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceUpdate.json -func ExampleNamespacesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("SampleSubscription", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "ResurceGroupSample", - "NamespaceSample", - armeventhub.EHNamespace{ - Location: to.Ptr("East US"), - Identity: &armeventhub.Identity{ - Type: to.Ptr(armeventhub.ManagedServiceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armeventhub.UserAssignedIdentity{ - "/subscriptions/SampleSubscription/resourceGroups/ResurceGroupSample/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ud2": nil, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetCreate.json -func ExampleNamespacesClient_CreateOrUpdateNetworkRuleSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("Subscription", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdateNetworkRuleSet(ctx, - "ResourceGroup", - "sdk-Namespace-6019", - armeventhub.NetworkRuleSet{ - Properties: &armeventhub.NetworkRuleSetProperties{ - DefaultAction: to.Ptr(armeventhub.DefaultActionDeny), - IPRules: []*armeventhub.NWRuleSetIPRules{ - { - Action: to.Ptr(armeventhub.NetworkRuleIPActionAllow), - IPMask: to.Ptr("1.1.1.1"), - }, - { - Action: to.Ptr(armeventhub.NetworkRuleIPActionAllow), - IPMask: to.Ptr("1.1.1.2"), - }, - { - Action: to.Ptr(armeventhub.NetworkRuleIPActionAllow), - IPMask: to.Ptr("1.1.1.3"), - }, - { - Action: to.Ptr(armeventhub.NetworkRuleIPActionAllow), - IPMask: to.Ptr("1.1.1.4"), - }, - { - Action: to.Ptr(armeventhub.NetworkRuleIPActionAllow), - IPMask: to.Ptr("1.1.1.5"), - }}, - VirtualNetworkRules: []*armeventhub.NWRuleSetVirtualNetworkRules{ - { - IgnoreMissingVnetServiceEndpoint: to.Ptr(true), - Subnet: &armeventhub.Subnet{ - ID: to.Ptr("/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet2"), - }, - }, - { - IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - Subnet: &armeventhub.Subnet{ - ID: to.Ptr("/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet3"), - }, - }, - { - IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - Subnet: &armeventhub.Subnet{ - ID: to.Ptr("/subscriptions/subscriptionid/resourcegroups/resourcegroupid/providers/Microsoft.Network/virtualNetworks/myvn/subnets/subnet6"), - }, - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetGet.json -func ExampleNamespacesClient_GetNetworkRuleSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("Subscription", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetNetworkRuleSet(ctx, - "ResourceGroup", - "sdk-Namespace-6019", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetList.json -func ExampleNamespacesClient_ListNetworkRuleSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("Subscription", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListNetworkRuleSet(ctx, - "ResourceGroup", - "sdk-Namespace-6019", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceAuthorizationRuleListAll.json -func ExampleNamespacesClient_NewListAuthorizationRulesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAuthorizationRulesPager("ArunMonocle", - "sdk-Namespace-2702", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceAuthorizationRuleCreate.json -func ExampleNamespacesClient_CreateOrUpdateAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdateAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-2702", - "sdk-Authrules-1746", - armeventhub.AuthorizationRule{ - Properties: &armeventhub.AuthorizationRuleProperties{ - Rights: []*armeventhub.AccessRights{ - to.Ptr(armeventhub.AccessRightsListen), - to.Ptr(armeventhub.AccessRightsSend)}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceAuthorizationRuleDelete.json -func ExampleNamespacesClient_DeleteAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DeleteAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-8980", - "sdk-Authrules-8929", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceAuthorizationRuleGet.json -func ExampleNamespacesClient_GetAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-2702", - "sdk-Authrules-1746", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceAuthorizationRuleListKey.json -func ExampleNamespacesClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeys(ctx, - "ArunMonocle", - "sdk-Namespace-2702", - "sdk-Authrules-1746", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceAuthorizationRuleRegenerateKey.json -func ExampleNamespacesClient_RegenerateKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RegenerateKeys(ctx, - "ArunMonocle", - "sdk-Namespace-8980", - "sdk-Authrules-8929", - armeventhub.RegenerateAccessKeyParameters{ - KeyType: to.Ptr(armeventhub.KeyTypePrimaryKey), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceCheckNameAvailability.json -func ExampleNamespacesClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNamespacesClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - armeventhub.CheckNameAvailabilityParameter{ - Name: to.Ptr("sdk-Namespace-8458"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfiguration_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfiguration_client_test.go deleted file mode 100644 index 2c092514b9a1..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfiguration_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/NetworkSecurityPerimeterConfigurationList.json -func ExampleNetworkSecurityPerimeterConfigurationClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNetworkSecurityPerimeterConfigurationClient("subID", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "SDK-EventHub-4794", - "sdk-Namespace-5828", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfigurations_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfigurations_client_test.go deleted file mode 100644 index cf74c62c0e0e..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfigurations_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/NetworkSecurityPerimeterConfigurationReconcile.json -func ExampleNetworkSecurityPerimeterConfigurationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewNetworkSecurityPerimeterConfigurationsClient("subID", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "SDK-EventHub-4794", - "sdk-Namespace-5828", - "resourceAssociation1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_operations_client_test.go deleted file mode 100644 index ad199ca761c1..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EHOperations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privateendpointconnections_client_test.go deleted file mode 100644 index 1acf5905e225..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privateendpointconnections_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionList.json -func ExamplePrivateEndpointConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewPrivateEndpointConnectionsClient("subID", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("SDK-EventHub-4794", - "sdk-Namespace-5828", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionCreate.json -func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewPrivateEndpointConnectionsClient("subID", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "ArunMonocle", - "sdk-Namespace-2924", - "privateEndpointConnectionName", - armeventhub.PrivateEndpointConnection{ - Properties: &armeventhub.PrivateEndpointConnectionProperties{ - PrivateEndpoint: &armeventhub.PrivateEndpoint{ - ID: to.Ptr("/subscriptions/dbedb4e0-40e6-4145-81f3-f1314c150774/resourceGroups/SDK-EventHub-8396/providers/Microsoft.Network/privateEndpoints/sdk-Namespace-2847"), - }, - PrivateLinkServiceConnectionState: &armeventhub.ConnectionState{ - Description: to.Ptr("testing"), - Status: to.Ptr(armeventhub.PrivateLinkConnectionStatusRejected), - }, - ProvisioningState: to.Ptr(armeventhub.EndPointProvisioningStateSucceeded), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewPrivateEndpointConnectionsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "ArunMonocle", - "sdk-Namespace-3285", - "928c44d5-b7c6-423b-b6fa-811e0c27b3e0", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewPrivateEndpointConnectionsClient("subID", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "SDK-EventHub-4794", - "sdk-Namespace-5828", - "privateEndpointConnectionName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privatelinkresources_client_test.go deleted file mode 100644 index e2982659c80d..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privatelinkresources_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/PrivateLinkResourcesGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewPrivateLinkResourcesClient("subID", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ArunMonocle", - "sdk-Namespace-2924", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_schemaregistry_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_schemaregistry_client_test.go deleted file mode 100644 index f628d69c18d1..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_schemaregistry_client_test.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/SchemaRegistry/SchemaRegistryListByNamespace.json -func ExampleSchemaRegistryClient_NewListByNamespacePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewSchemaRegistryClient("e8baea74-64ce-459b-bee3-5aa4c47b3ae3", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByNamespacePager("alitest", - "ali-ua-test-eh-system-1", - &armeventhub.SchemaRegistryClientListByNamespaceOptions{Skip: nil, - Top: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/SchemaRegistry/SchemaRegistryCreate.json -func ExampleSchemaRegistryClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewSchemaRegistryClient("e8baea74-64ce-459b-bee3-5aa4c47b3ae3", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "alitest", - "ali-ua-test-eh-system-1", - "testSchemaGroup1", - armeventhub.SchemaGroup{ - Properties: &armeventhub.SchemaGroupProperties{ - GroupProperties: map[string]*string{}, - SchemaCompatibility: to.Ptr(armeventhub.SchemaCompatibilityForward), - SchemaType: to.Ptr(armeventhub.SchemaTypeAvro), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/SchemaRegistry/SchemaRegistryDelete.json -func ExampleSchemaRegistryClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewSchemaRegistryClient("e8baea74-64ce-459b-bee3-5aa4c47b3ae3", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "alitest", - "ali-ua-test-eh-system-1", - "testSchemaGroup1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/SchemaRegistry/SchemaRegistryGet.json -func ExampleSchemaRegistryClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewSchemaRegistryClient("e8baea74-64ce-459b-bee3-5aa4c47b3ae3", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "alitest", - "ali-ua-test-eh-system-1", - "testSchemaGroup1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_models_serde.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_models_serde.go deleted file mode 100644 index ef09a0cf8653..000000000000 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_models_serde.go +++ /dev/null @@ -1,508 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armeventhub - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupProperties. -func (a ApplicationGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientAppGroupIdentifier", a.ClientAppGroupIdentifier) - populate(objectMap, "isEnabled", a.IsEnabled) - populate(objectMap, "policies", a.Policies) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupProperties. -func (a *ApplicationGroupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "clientAppGroupIdentifier": - err = unpopulate(val, "ClientAppGroupIdentifier", &a.ClientAppGroupIdentifier) - delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &a.IsEnabled) - delete(rawMsg, key) - case "policies": - a.Policies, err = unmarshalApplicationGroupPolicyClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AuthorizationRuleProperties. -func (a AuthorizationRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "rights", a.Rights) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Cluster. -func (c Cluster) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "sku", c.SKU) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ClusterQuotaConfigurationProperties. -func (c ClusterQuotaConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "settings", c.Settings) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ConsumerGroupProperties. -func (c ConsumerGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", c.CreatedAt) - populateTimeRFC3339(objectMap, "updatedAt", c.UpdatedAt) - populate(objectMap, "userMetadata", c.UserMetadata) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConsumerGroupProperties. -func (c *ConsumerGroupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &c.CreatedAt) - delete(rawMsg, key) - case "updatedAt": - err = unpopulateTimeRFC3339(val, "UpdatedAt", &c.UpdatedAt) - delete(rawMsg, key) - case "userMetadata": - err = unpopulate(val, "UserMetadata", &c.UserMetadata) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type EHNamespace. -func (e EHNamespace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - populate(objectMap, "identity", e.Identity) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "sku", e.SKU) - populate(objectMap, "systemData", e.SystemData) - populate(objectMap, "tags", e.Tags) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EHNamespaceProperties. -func (e EHNamespaceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alternateName", e.AlternateName) - populate(objectMap, "clusterArmId", e.ClusterArmID) - populateTimeRFC3339(objectMap, "createdAt", e.CreatedAt) - populate(objectMap, "disableLocalAuth", e.DisableLocalAuth) - populate(objectMap, "encryption", e.Encryption) - populate(objectMap, "isAutoInflateEnabled", e.IsAutoInflateEnabled) - populate(objectMap, "kafkaEnabled", e.KafkaEnabled) - populate(objectMap, "maximumThroughputUnits", e.MaximumThroughputUnits) - populate(objectMap, "metricId", e.MetricID) - populate(objectMap, "minimumTlsVersion", e.MinimumTLSVersion) - populate(objectMap, "privateEndpointConnections", e.PrivateEndpointConnections) - populate(objectMap, "provisioningState", e.ProvisioningState) - populate(objectMap, "publicNetworkAccess", e.PublicNetworkAccess) - populate(objectMap, "serviceBusEndpoint", e.ServiceBusEndpoint) - populate(objectMap, "status", e.Status) - populateTimeRFC3339(objectMap, "updatedAt", e.UpdatedAt) - populate(objectMap, "zoneRedundant", e.ZoneRedundant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EHNamespaceProperties. -func (e *EHNamespaceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "alternateName": - err = unpopulate(val, "AlternateName", &e.AlternateName) - delete(rawMsg, key) - case "clusterArmId": - err = unpopulate(val, "ClusterArmID", &e.ClusterArmID) - delete(rawMsg, key) - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &e.CreatedAt) - delete(rawMsg, key) - case "disableLocalAuth": - err = unpopulate(val, "DisableLocalAuth", &e.DisableLocalAuth) - delete(rawMsg, key) - case "encryption": - err = unpopulate(val, "Encryption", &e.Encryption) - delete(rawMsg, key) - case "isAutoInflateEnabled": - err = unpopulate(val, "IsAutoInflateEnabled", &e.IsAutoInflateEnabled) - delete(rawMsg, key) - case "kafkaEnabled": - err = unpopulate(val, "KafkaEnabled", &e.KafkaEnabled) - delete(rawMsg, key) - case "maximumThroughputUnits": - err = unpopulate(val, "MaximumThroughputUnits", &e.MaximumThroughputUnits) - delete(rawMsg, key) - case "metricId": - err = unpopulate(val, "MetricID", &e.MetricID) - delete(rawMsg, key) - case "minimumTlsVersion": - err = unpopulate(val, "MinimumTLSVersion", &e.MinimumTLSVersion) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &e.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &e.PublicNetworkAccess) - delete(rawMsg, key) - case "serviceBusEndpoint": - err = unpopulate(val, "ServiceBusEndpoint", &e.ServiceBusEndpoint) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &e.Status) - delete(rawMsg, key) - case "updatedAt": - err = unpopulateTimeRFC3339(val, "UpdatedAt", &e.UpdatedAt) - delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Encryption. -func (e Encryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "keySource", e.KeySource) - populate(objectMap, "keyVaultProperties", e.KeyVaultProperties) - populate(objectMap, "requireInfrastructureEncryption", e.RequireInfrastructureEncryption) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Identity. -func (i Identity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", i.PrincipalID) - populate(objectMap, "tenantId", i.TenantID) - populate(objectMap, "type", i.Type) - populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSetProperties. -func (n NetworkRuleSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultAction", n.DefaultAction) - populate(objectMap, "ipRules", n.IPRules) - populate(objectMap, "publicNetworkAccess", n.PublicNetworkAccess) - populate(objectMap, "trustedServiceAccessEnabled", n.TrustedServiceAccessEnabled) - populate(objectMap, "virtualNetworkRules", n.VirtualNetworkRules) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration. -func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", n.ID) - populate(objectMap, "location", n.Location) - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "type", n.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProperties. -func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "networkSecurityPerimeter", n.NetworkSecurityPerimeter) - populate(objectMap, "profile", n.Profile) - populate(objectMap, "provisioningIssues", n.ProvisioningIssues) - populate(objectMap, "provisioningState", n.ProvisioningState) - populate(objectMap, "resourceAssociation", n.ResourceAssociation) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesProfile. -func (n NetworkSecurityPerimeterConfigurationPropertiesProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accessRules", n.AccessRules) - populate(objectMap, "accessRulesVersion", n.AccessRulesVersion) - populate(objectMap, "name", n.Name) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NspAccessRuleProperties. -func (n NspAccessRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addressPrefixes", n.AddressPrefixes) - populate(objectMap, "direction", n.Direction) - populate(objectMap, "fullyQualifiedDomainNames", n.FullyQualifiedDomainNames) - populate(objectMap, "networkSecurityPerimeters", n.NetworkSecurityPerimeters) - populate(objectMap, "subscriptions", n.Subscriptions) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Properties. -func (p Properties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "captureDescription", p.CaptureDescription) - populateTimeRFC3339(objectMap, "createdAt", p.CreatedAt) - populate(objectMap, "messageRetentionInDays", p.MessageRetentionInDays) - populate(objectMap, "partitionCount", p.PartitionCount) - populate(objectMap, "partitionIds", p.PartitionIDs) - populate(objectMap, "status", p.Status) - populateTimeRFC3339(objectMap, "updatedAt", p.UpdatedAt) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Properties. -func (p *Properties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "captureDescription": - err = unpopulate(val, "CaptureDescription", &p.CaptureDescription) - delete(rawMsg, key) - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &p.CreatedAt) - delete(rawMsg, key) - case "messageRetentionInDays": - err = unpopulate(val, "MessageRetentionInDays", &p.MessageRetentionInDays) - delete(rawMsg, key) - case "partitionCount": - err = unpopulate(val, "PartitionCount", &p.PartitionCount) - delete(rawMsg, key) - case "partitionIds": - err = unpopulate(val, "PartitionIDs", &p.PartitionIDs) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) - delete(rawMsg, key) - case "updatedAt": - err = unpopulateTimeRFC3339(val, "UpdatedAt", &p.UpdatedAt) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SchemaGroupProperties. -func (s SchemaGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAtUtc", s.CreatedAtUTC) - populate(objectMap, "eTag", s.ETag) - populate(objectMap, "groupProperties", s.GroupProperties) - populate(objectMap, "schemaCompatibility", s.SchemaCompatibility) - populate(objectMap, "schemaType", s.SchemaType) - populateTimeRFC3339(objectMap, "updatedAtUtc", s.UpdatedAtUTC) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SchemaGroupProperties. -func (s *SchemaGroupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAtUtc": - err = unpopulateTimeRFC3339(val, "CreatedAtUTC", &s.CreatedAtUTC) - delete(rawMsg, key) - case "eTag": - err = unpopulate(val, "ETag", &s.ETag) - delete(rawMsg, key) - case "groupProperties": - err = unpopulate(val, "GroupProperties", &s.GroupProperties) - delete(rawMsg, key) - case "schemaCompatibility": - err = unpopulate(val, "SchemaCompatibility", &s.SchemaCompatibility) - delete(rawMsg, key) - case "schemaType": - err = unpopulate(val, "SchemaType", &s.SchemaType) - delete(rawMsg, key) - case "updatedAtUtc": - err = unpopulateTimeRFC3339(val, "UpdatedAtUTC", &s.UpdatedAtUTC) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ThrottlingPolicy. -func (t ThrottlingPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "metricId", t.MetricID) - populate(objectMap, "name", t.Name) - populate(objectMap, "rateLimitThreshold", t.RateLimitThreshold) - objectMap["type"] = ApplicationGroupPolicyTypeThrottlingPolicy - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ThrottlingPolicy. -func (t *ThrottlingPolicy) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "metricId": - err = unpopulate(val, "MetricID", &t.MetricID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "rateLimitThreshold": - err = unpopulate(val, "RateLimitThreshold", &t.RateLimitThreshold) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}