diff --git a/eng/swagger_to_sdk_config.json b/eng/swagger_to_sdk_config.json index e47880efcbad..74ad2c044667 100644 --- a/eng/swagger_to_sdk_config.json +++ b/eng/swagger_to_sdk_config.json @@ -23,6 +23,8 @@ } }, "packageOptions": { - "breakingChangeLabel": "CI-BreakingChange-Go" + "breakingChangeLabel": "CI-BreakingChange-Go", + "breakingChangesLabel": "BreakingChange-Go-Sdk", + "breakingChangeSuppressionLabel": "BreakingChange-Go-Suppression" } } diff --git a/sdk/resourcemanager/eventhub/armeventhub/CHANGELOG.md b/sdk/resourcemanager/eventhub/armeventhub/CHANGELOG.md index 64630abd5551..58e997cd738f 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/CHANGELOG.md +++ b/sdk/resourcemanager/eventhub/armeventhub/CHANGELOG.md @@ -1,5 +1,64 @@ # Release History +## 1.3.0-beta.2 (2024-04-22) +### Breaking Changes + +- Type of `ErrorAdditionalInfo.Info` has been changed from `any` to `interface{}` +- Type of `Operation.Properties` has been changed from `any` to `interface{}` +- Const `CleanupPolicyRetentionDescriptionCompaction` from type alias `CleanupPolicyRetentionDescription` has been removed +- Function `NewClientFactory` has been removed +- Function `*ClientFactory.NewApplicationGroupClient` has been removed +- Function `*ClientFactory.NewClustersClient` has been removed +- Function `*ClientFactory.NewConfigurationClient` has been removed +- Function `*ClientFactory.NewConsumerGroupsClient` has been removed +- Function `*ClientFactory.NewDisasterRecoveryConfigsClient` has been removed +- Function `*ClientFactory.NewEventHubsClient` has been removed +- Function `*ClientFactory.NewNamespacesClient` has been removed +- Function `*ClientFactory.NewNetworkSecurityPerimeterConfigurationClient` has been removed +- Function `*ClientFactory.NewNetworkSecurityPerimeterConfigurationsClient` has been removed +- Function `*ClientFactory.NewOperationsClient` has been removed +- Function `*ClientFactory.NewPrivateEndpointConnectionsClient` has been removed +- Function `*ClientFactory.NewPrivateLinkResourcesClient` has been removed +- Function `*ClientFactory.NewSchemaRegistryClient` has been removed +- Function `dateTimeRFC3339.MarshalText` has been removed +- Function `*dateTimeRFC3339.Parse` has been removed +- Function `*dateTimeRFC3339.UnmarshalText` has been removed +- Struct `ClientFactory` has been removed + +### Features Added + +- New value `CleanupPolicyRetentionDescriptionCompact`, `CleanupPolicyRetentionDescriptionDeleteCompact` added to type alias `CleanupPolicyRetentionDescription` +- New value `SchemaTypeJSON`, `SchemaTypeProtoBuf` added to type alias `SchemaType` +- New type alias `CaptureIdentityType` with values `CaptureIdentityTypeSystemAssigned`, `CaptureIdentityTypeUserAssigned` +- New type alias `GeoDRRoleType` with values `GeoDRRoleTypePrimary`, `GeoDRRoleTypeSecondary` +- New type alias `ProvisioningState` with values `ProvisioningStateActive`, `ProvisioningStateCanceled`, `ProvisioningStateCreating`, `ProvisioningStateDeleting`, `ProvisioningStateFailed`, `ProvisioningStateScaling`, `ProvisioningStateSucceeded`, `ProvisioningStateUnknown` +- New type alias `TimestampType` with values `TimestampTypeAppendTime`, `TimestampTypeCreateTime` +- New function `*NamespacesClient.BeginFailover(context.Context, string, string, FailOver, *NamespacesClientBeginFailoverOptions) (*runtime.Poller[NamespacesClientFailoverResponse], error)` +- New function `timeRFC3339.MarshalText() ([]byte, error)` +- New function `*timeRFC3339.Parse(string) error` +- New function `*timeRFC3339.UnmarshalText([]byte) error` +- New struct `CaptureIdentity` +- New struct `ErrorDetailAutoGenerated` +- New struct `ErrorResponseAutoGenerated` +- New struct `FailOver` +- New struct `FailOverProperties` +- New struct `GeoDataReplicationProperties` +- New struct `NamespaceReplicaLocation` +- New struct `NamespacesClientFailoverResponse` +- New field `ProvisioningState` in struct `ClusterProperties` +- New field `Identity` in struct `Destination` +- New field `GeoDataReplication` in struct `EHNamespaceProperties` +- New field `Location` in struct `NetworkSecurityPerimeterConfiguration` +- New field `ApplicableFeatures` in struct `NetworkSecurityPerimeterConfigurationProperties` +- New field `IsBackingResource` in struct `NetworkSecurityPerimeterConfigurationProperties` +- New field `ParentAssociationName` in struct `NetworkSecurityPerimeterConfigurationProperties` +- New field `SourceResourceID` in struct `NetworkSecurityPerimeterConfigurationProperties` +- New field `Identifier` in struct `Properties` +- New field `MessageTimestampType` in struct `Properties` +- New field `UserMetadata` in struct `Properties` +- New field `MinCompactionLagInMins` in struct `RetentionDescription` + + ## 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..66db81ed6c8a 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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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..422829e734df 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.3.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..8814099f4525 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 2024-05-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 2024-05-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", "2024-05-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 2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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 2024-05-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", "2024-05-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..c7e83ce7fb95 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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 83% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_constants.go rename to sdk/resourcemanager/eventhub/armeventhub/constants.go index 460e9b20c186..6b56845c2ded 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.3.0-beta.2" ) type AccessRights string @@ -44,6 +45,40 @@ func PossibleApplicationGroupPolicyTypeValues() []ApplicationGroupPolicyType { } } +// CaptureIdentityType - Type of Azure Active Directory Managed Identity. +type CaptureIdentityType string + +const ( + CaptureIdentityTypeSystemAssigned CaptureIdentityType = "SystemAssigned" + CaptureIdentityTypeUserAssigned CaptureIdentityType = "UserAssigned" +) + +// PossibleCaptureIdentityTypeValues returns the possible values for the CaptureIdentityType const type. +func PossibleCaptureIdentityTypeValues() []CaptureIdentityType { + return []CaptureIdentityType{ + CaptureIdentityTypeSystemAssigned, + CaptureIdentityTypeUserAssigned, + } +} + +// CleanupPolicyRetentionDescription - Enumerates the possible values for cleanup policy +type CleanupPolicyRetentionDescription string + +const ( + CleanupPolicyRetentionDescriptionCompact CleanupPolicyRetentionDescription = "Compact" + CleanupPolicyRetentionDescriptionDelete CleanupPolicyRetentionDescription = "Delete" + CleanupPolicyRetentionDescriptionDeleteCompact CleanupPolicyRetentionDescription = "Delete,Compact" +) + +// PossibleCleanupPolicyRetentionDescriptionValues returns the possible values for the CleanupPolicyRetentionDescription const type. +func PossibleCleanupPolicyRetentionDescriptionValues() []CleanupPolicyRetentionDescription { + return []CleanupPolicyRetentionDescription{ + CleanupPolicyRetentionDescriptionCompact, + CleanupPolicyRetentionDescriptionDelete, + CleanupPolicyRetentionDescriptionDeleteCompact, + } +} + // ClusterSKUName - Name of this SKU. type ClusterSKUName string @@ -165,6 +200,22 @@ func PossibleEntityStatusValues() []EntityStatus { } } +// GeoDRRoleType - GeoDR Role Types +type GeoDRRoleType string + +const ( + GeoDRRoleTypePrimary GeoDRRoleType = "Primary" + GeoDRRoleTypeSecondary GeoDRRoleType = "Secondary" +) + +// PossibleGeoDRRoleTypeValues returns the possible values for the GeoDRRoleType const type. +func PossibleGeoDRRoleTypeValues() []GeoDRRoleType { + return []GeoDRRoleType{ + GeoDRRoleTypePrimary, + GeoDRRoleTypeSecondary, + } +} + // KeyType - The access key to regenerate. type KeyType string @@ -306,6 +357,34 @@ func PossiblePrivateLinkConnectionStatusValues() []PrivateLinkConnectionStatus { } } +// ProvisioningState - Provisioning state of the Cluster. +type ProvisioningState string + +const ( + ProvisioningStateActive ProvisioningState = "Active" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateScaling ProvisioningState = "Scaling" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUnknown ProvisioningState = "Unknown" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateActive, + ProvisioningStateCanceled, + ProvisioningStateCreating, + ProvisioningStateDeleting, + ProvisioningStateFailed, + ProvisioningStateScaling, + ProvisioningStateSucceeded, + ProvisioningStateUnknown, + } +} + // ProvisioningStateDR - Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or // 'Succeeded' or 'Failed' type ProvisioningStateDR string @@ -459,14 +538,18 @@ func PossibleSchemaCompatibilityValues() []SchemaCompatibility { type SchemaType string const ( - SchemaTypeAvro SchemaType = "Avro" - SchemaTypeUnknown SchemaType = "Unknown" + SchemaTypeAvro SchemaType = "Avro" + SchemaTypeJSON SchemaType = "Json" + SchemaTypeProtoBuf SchemaType = "ProtoBuf" + SchemaTypeUnknown SchemaType = "Unknown" ) // PossibleSchemaTypeValues returns the possible values for the SchemaType const type. func PossibleSchemaTypeValues() []SchemaType { return []SchemaType{ SchemaTypeAvro, + SchemaTypeJSON, + SchemaTypeProtoBuf, SchemaTypeUnknown, } } @@ -489,6 +572,26 @@ func PossibleTLSVersionValues() []TLSVersion { } } +// TimestampType - Denotes the type of timestamp the message will hold. Two types of timestamp types AppendTime, CreateTime. +// AppendTime refers the time in which message got appended inside broker log. CreateTime refers +// to the time in which the message was generated on source side and producers can set this timestamp while sending the message. +// Default value is AppendTime. If you are using AMQP protocol, CreateTime +// equals AppendTime for now and will full have runtime support later. +type TimestampType string + +const ( + TimestampTypeAppendTime TimestampType = "AppendTime" + TimestampTypeCreateTime TimestampType = "CreateTime" +) + +// PossibleTimestampTypeValues returns the possible values for the TimestampType const type. +func PossibleTimestampTypeValues() []TimestampType { + return []TimestampType{ + TimestampTypeAppendTime, + TimestampTypeCreateTime, + } +} + // UnavailableReason - Specifies the reason for the unavailability of the service. type UnavailableReason 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..a0c94895595a 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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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..dbe9ce110f74 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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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..23e9d4e47061 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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 89% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_models.go rename to sdk/resourcemanager/eventhub/armeventhub/models.go index c083af1b7d73..918e1afde1b1 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 @@ -241,6 +242,16 @@ type CaptureDescription struct { SkipEmptyArchives *bool `json:"skipEmptyArchives,omitempty"` } +// CaptureIdentity - A value that indicates whether capture description is enabled. +type CaptureIdentity struct { + // Type of Azure Active Directory Managed Identity. + Type *CaptureIdentityType `json:"type,omitempty"` + + // ARM ID of Managed User Identity. This property is required is the type is UserAssignedIdentity. If type is SystemAssigned, + // then the System Assigned Identity Associated with the namespace will be used. + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + // CheckNameAvailabilityParameter - Parameter supplied to check Namespace name availability operation type CheckNameAvailabilityParameter struct { // REQUIRED; Name to check the namespace name availability @@ -306,6 +317,9 @@ type ClusterProperties struct { // READ-ONLY; The metric ID of the cluster resource. Provided by the service and not modifiable by the user. MetricID *string `json:"metricId,omitempty" azure:"ro"` + // READ-ONLY; Provisioning state of the Cluster. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + // READ-ONLY; Status of the Cluster resource Status *string `json:"status,omitempty" azure:"ro"` @@ -465,6 +479,9 @@ type ConsumerGroupsClientListByEventHubOptions struct { // Destination - Capture storage details for capture description type Destination struct { + // A value that indicates whether capture description is enabled. + Identity *CaptureIdentity `json:"identity,omitempty"` + // Name for capture destination Name *string `json:"name,omitempty"` @@ -618,6 +635,9 @@ type EHNamespaceProperties struct { // Properties of BYOK Encryption description Encryption *Encryption `json:"encryption,omitempty"` + // Geo Data Replication settings for the namespace + GeoDataReplication *GeoDataReplicationProperties `json:"geoDataReplication,omitempty"` + // Value that indicates whether AutoInflate is enabled for eventhub namespace. IsAutoInflateEnabled *bool `json:"isAutoInflateEnabled,omitempty"` @@ -698,6 +718,24 @@ type ErrorDetail struct { Target *string `json:"target,omitempty" azure:"ro"` } +// ErrorDetailAutoGenerated - The error detail. +type ErrorDetailAutoGenerated struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` + + // READ-ONLY; The error code. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; The error details. + Details []*ErrorDetailAutoGenerated `json:"details,omitempty" azure:"ro"` + + // READ-ONLY; The error message. + Message *string `json:"message,omitempty" azure:"ro"` + + // READ-ONLY; The error target. + Target *string `json:"target,omitempty" azure:"ro"` +} + // ErrorResponse - Error response indicates Event Hub service is not able to process the incoming request. The reason is provided // in the error message. type ErrorResponse struct { @@ -705,6 +743,13 @@ type ErrorResponse struct { Error *ErrorDetail `json:"error,omitempty"` } +// ErrorResponseAutoGenerated - Common error response for all Azure Resource Manager APIs to return error details for failed +// operations. (This also follows the OData error response format.). +type ErrorResponseAutoGenerated struct { + // The error object. + Error *ErrorDetailAutoGenerated `json:"error,omitempty"` +} + // EventHubsClientCreateOrUpdateAuthorizationRuleOptions contains the optional parameters for the EventHubsClient.CreateOrUpdateAuthorizationRule // method. type EventHubsClientCreateOrUpdateAuthorizationRuleOptions struct { @@ -785,6 +830,34 @@ type Eventhub struct { Type *string `json:"type,omitempty" azure:"ro"` } +type FailOver struct { + Properties *FailOverProperties `json:"properties,omitempty"` +} + +type FailOverProperties struct { + // Maximum time duration allowed complete data replication from primary to secondary. Use maximumGracePeriodInMins = 0: For + // Unplanned Geo-Failover, which switches the role between primary and secondary + // immediately. The data that is not being replicated yet will be discarded. Use maximumGracePeriodInMins > 0: For Planned + // Geo-Failover/DR Drill, continue replicating data until grace period expires. Any + // data that is not replicated during the grace period will be discarded. During the replication the namespace stops accepting + // any new publishing requests + MaximumGracePeriodInMins *int32 `json:"maximumGracePeriodInMins,omitempty"` + + // Query parameter for the new primary location after failover. + PrimaryLocation *string `json:"primaryLocation,omitempty"` +} + +// GeoDataReplicationProperties - GeoDR Replication properties +type GeoDataReplicationProperties struct { + // A list of regions where replicas of the namespace are maintained. + Locations []*NamespaceReplicaLocation `json:"locations,omitempty"` + + // The maximum acceptable lag for data replication operations from the primary replica to a quorum of secondary replicas. + // When the lag exceeds the configured amount, operations on the primary replica + // will be failed. The allowed values are 0 and 5 minutes to 1 day. + MaxReplicationLagDurationInSeconds *int32 `json:"maxReplicationLagDurationInSeconds,omitempty"` +} + // Identity - Properties to configure Identity for Bring your Own Keys type Identity struct { // Type of managed service identity. @@ -841,6 +914,22 @@ type NWRuleSetVirtualNetworkRules struct { Subnet *Subnet `json:"subnet,omitempty"` } +// NamespaceReplicaLocation - Namespace replication properties +type NamespaceReplicaLocation struct { + // Optional property that denotes the ARM ID of the Cluster. This is required, if a namespace replica should be placed in + // a Dedicated Event Hub Cluster + ClusterArmID *string `json:"clusterArmId,omitempty"` + + // Azure regions where a replica of the namespace is maintained + LocationName *string `json:"locationName,omitempty"` + + // GeoDR Role Types + RoleType *GeoDRRoleType `json:"roleType,omitempty"` + + // READ-ONLY; state of Namespace replica. + ReplicaState *string `json:"replicaState,omitempty" azure:"ro"` +} + // NamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the NamespacesClient.BeginCreateOrUpdate // method. type NamespacesClientBeginCreateOrUpdateOptions struct { @@ -854,6 +943,12 @@ type NamespacesClientBeginDeleteOptions struct { ResumeToken string } +// NamespacesClientBeginFailoverOptions contains the optional parameters for the NamespacesClient.BeginFailover method. +type NamespacesClientBeginFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // NamespacesClientCheckNameAvailabilityOptions contains the optional parameters for the NamespacesClient.CheckNameAvailability // method. type NamespacesClientCheckNameAvailabilityOptions struct { @@ -996,22 +1091,19 @@ type NetworkSecurityPerimeter struct { // NetworkSecurityPerimeterConfiguration - Network Security Perimeter related configurations of a given namespace type NetworkSecurityPerimeterConfiguration struct { - // Resource location. - Location *string `json:"location,omitempty"` - - // Resource tags. - Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` + // READ-ONLY; The geo-location where the resource lives + Location *string `json:"location,omitempty" azure:"ro"` + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` // READ-ONLY; Properties of the Network Security Perimeter Configuration Properties *NetworkSecurityPerimeterConfigurationProperties `json:"properties,omitempty" azure:"ro"` - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + // READ-ONLY; The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" Type *string `json:"type,omitempty" azure:"ro"` } @@ -1035,14 +1127,27 @@ type NetworkSecurityPerimeterConfigurationProperties struct { // Provisioning state of NetworkSecurityPerimeter configuration propagation ProvisioningState *NetworkSecurityPerimeterConfigurationProvisioningState `json:"provisioningState,omitempty"` + // READ-ONLY; Indicates that the NSP controls related to backing association are only applicable to a specific feature in + // backing resource's data plane. + ApplicableFeatures []*string `json:"applicableFeatures,omitempty" azure:"ro"` + + // READ-ONLY; True if the EventHub namespace is backed by another Azure resource and not visible to end users. + IsBackingResource *bool `json:"isBackingResource,omitempty" azure:"ro"` + // READ-ONLY; NetworkSecurityPerimeter related information NetworkSecurityPerimeter *NetworkSecurityPerimeter `json:"networkSecurityPerimeter,omitempty" azure:"ro"` + // READ-ONLY; Source Resource Association name + ParentAssociationName *string `json:"parentAssociationName,omitempty" azure:"ro"` + // READ-ONLY; Information about current network profile Profile *NetworkSecurityPerimeterConfigurationPropertiesProfile `json:"profile,omitempty" azure:"ro"` // READ-ONLY; Information about resource association ResourceAssociation *NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation `json:"resourceAssociation,omitempty" azure:"ro"` + + // READ-ONLY; ARM Id of source resource + SourceResourceID *string `json:"sourceResourceId,omitempty" azure:"ro"` } // NetworkSecurityPerimeterConfigurationPropertiesProfile - Information about current network profile @@ -1282,15 +1387,33 @@ type Properties struct { // Number of days to retain the events for this Event Hub, value should be 1 to 7 days MessageRetentionInDays *int64 `json:"messageRetentionInDays,omitempty"` + // Denotes the type of timestamp the message will hold. Two types of timestamp types AppendTime, CreateTime. AppendTime refers + // the time in which message got appended inside broker log. CreateTime refers + // to the time in which the message was generated on source side and producers can set this timestamp while sending the message. + // Default value is AppendTime. If you are using AMQP protocol, CreateTime + // equals AppendTime for now and will full have runtime support later. + MessageTimestampType *TimestampType `json:"messageTimestampType,omitempty"` + // 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"` + // Gets and Sets Metadata of User. + UserMetadata *string `json:"userMetadata,omitempty"` + // READ-ONLY; Exact time the Event Hub was created. CreatedAt *time.Time `json:"createdAt,omitempty" azure:"ro"` + // READ-ONLY; Denotes the unique identifier for event hub and is generated by service while creating topic. This identifier + // can be used in kafka runtime apis wherever a UUID is required e.g Fetch & Delete Topic. + // This identifier is not supported in AMQP runtime operations yet. + Identifier *string `json:"identifier,omitempty" azure:"ro"` + // READ-ONLY; Current number of shards on the Event Hub. PartitionIDs []*string `json:"partitionIds,omitempty" azure:"ro"` @@ -1353,6 +1476,25 @@ 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"` + + // The minimum time a message will remain ineligible for compaction in the log. Only applicable for logs that are being compacted. + MinCompactionLagInMins *int64 `json:"minCompactionLagInMins,omitempty"` + + // Number of hours to retain the events for this Event Hub. If cleanupPolicy is Compact 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 + // Compact. Consumer must complete reading the tombstone marker within this + // specified amount of time if consumer begins from starting offset to ensure they get a valid snapshot for the specific key + // described by the tombstone marker within the compacted Event Hub + TombstoneRetentionTimeInHours *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..3f45f627c887 --- /dev/null +++ b/sdk/resourcemanager/eventhub/armeventhub/models_serde.go @@ -0,0 +1,3325 @@ +//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 CaptureIdentity. +func (c CaptureIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "type", c.Type) + populate(objectMap, "userAssignedIdentity", c.UserAssignedIdentity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CaptureIdentity. +func (c *CaptureIdentity) 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 "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "userAssignedIdentity": + err = unpopulate(val, "UserAssignedIdentity", &c.UserAssignedIdentity) + 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, "provisioningState", c.ProvisioningState) + 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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + 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, "identity", d.Identity) + 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 "identity": + err = unpopulate(val, "Identity", &d.Identity) + delete(rawMsg, 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, "geoDataReplication", e.GeoDataReplication) + 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 "geoDataReplication": + err = unpopulate(val, "GeoDataReplication", &e.GeoDataReplication) + 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 ErrorDetailAutoGenerated. +func (e ErrorDetailAutoGenerated) 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 ErrorDetailAutoGenerated. +func (e *ErrorDetailAutoGenerated) 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 ErrorResponseAutoGenerated. +func (e ErrorResponseAutoGenerated) 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 ErrorResponseAutoGenerated. +func (e *ErrorResponseAutoGenerated) 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 FailOver. +func (f FailOver) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", f.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailOver. +func (f *FailOver) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailOverProperties. +func (f FailOverProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "maximumGracePeriodInMins", f.MaximumGracePeriodInMins) + populate(objectMap, "primaryLocation", f.PrimaryLocation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailOverProperties. +func (f *FailOverProperties) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maximumGracePeriodInMins": + err = unpopulate(val, "MaximumGracePeriodInMins", &f.MaximumGracePeriodInMins) + delete(rawMsg, key) + case "primaryLocation": + err = unpopulate(val, "PrimaryLocation", &f.PrimaryLocation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GeoDataReplicationProperties. +func (g GeoDataReplicationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "locations", g.Locations) + populate(objectMap, "maxReplicationLagDurationInSeconds", g.MaxReplicationLagDurationInSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GeoDataReplicationProperties. +func (g *GeoDataReplicationProperties) 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", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "locations": + err = unpopulate(val, "Locations", &g.Locations) + delete(rawMsg, key) + case "maxReplicationLagDurationInSeconds": + err = unpopulate(val, "MaxReplicationLagDurationInSeconds", &g.MaxReplicationLagDurationInSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, 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 NamespaceReplicaLocation. +func (n NamespaceReplicaLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clusterArmId", n.ClusterArmID) + populate(objectMap, "locationName", n.LocationName) + populate(objectMap, "replicaState", n.ReplicaState) + populate(objectMap, "roleType", n.RoleType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamespaceReplicaLocation. +func (n *NamespaceReplicaLocation) 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 "clusterArmId": + err = unpopulate(val, "ClusterArmID", &n.ClusterArmID) + delete(rawMsg, key) + case "locationName": + err = unpopulate(val, "LocationName", &n.LocationName) + delete(rawMsg, key) + case "replicaState": + err = unpopulate(val, "ReplicaState", &n.ReplicaState) + delete(rawMsg, key) + case "roleType": + err = unpopulate(val, "RoleType", &n.RoleType) + 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, "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 "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, "applicableFeatures", n.ApplicableFeatures) + populate(objectMap, "isBackingResource", n.IsBackingResource) + populate(objectMap, "networkSecurityPerimeter", n.NetworkSecurityPerimeter) + populate(objectMap, "parentAssociationName", n.ParentAssociationName) + populate(objectMap, "profile", n.Profile) + populate(objectMap, "provisioningIssues", n.ProvisioningIssues) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "resourceAssociation", n.ResourceAssociation) + populate(objectMap, "sourceResourceId", n.SourceResourceID) + 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 "applicableFeatures": + err = unpopulate(val, "ApplicableFeatures", &n.ApplicableFeatures) + delete(rawMsg, key) + case "isBackingResource": + err = unpopulate(val, "IsBackingResource", &n.IsBackingResource) + delete(rawMsg, key) + case "networkSecurityPerimeter": + err = unpopulate(val, "NetworkSecurityPerimeter", &n.NetworkSecurityPerimeter) + delete(rawMsg, key) + case "parentAssociationName": + err = unpopulate(val, "ParentAssociationName", &n.ParentAssociationName) + 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) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &n.SourceResourceID) + 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, "identifier", p.Identifier) + populate(objectMap, "messageRetentionInDays", p.MessageRetentionInDays) + populate(objectMap, "messageTimestampType", p.MessageTimestampType) + 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) + populate(objectMap, "userMetadata", p.UserMetadata) + 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 "identifier": + err = unpopulate(val, "Identifier", &p.Identifier) + delete(rawMsg, key) + case "messageRetentionInDays": + err = unpopulate(val, "MessageRetentionInDays", &p.MessageRetentionInDays) + delete(rawMsg, key) + case "messageTimestampType": + err = unpopulate(val, "MessageTimestampType", &p.MessageTimestampType) + 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) + case "userMetadata": + err = unpopulate(val, "UserMetadata", &p.UserMetadata) + 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, "minCompactionLagInMins", r.MinCompactionLagInMins) + 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 "minCompactionLagInMins": + err = unpopulate(val, "MinCompactionLagInMins", &r.MinCompactionLagInMins) + 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 90% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_namespaces_client.go rename to sdk/resourcemanager/eventhub/armeventhub/namespaces_client.go index d5b46558c06d..2367e083c6b5 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 2024-05-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", "2024-05-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 2024-05-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // parameters - Parameters for creating a namespace resource. @@ -118,7 +119,9 @@ func (client *NamespacesClient) BeginCreateOrUpdate(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[NamespacesClientCreateOrUpdateResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[NamespacesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[NamespacesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -127,7 +130,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 2024-05-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 +166,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -171,7 +174,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 2024-05-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -217,7 +220,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -234,7 +237,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 2024-05-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // parameters - The Namespace IpFilterRule. @@ -275,7 +278,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -292,7 +295,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 2024-05-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. @@ -302,7 +305,9 @@ func (client *NamespacesClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller[NamespacesClientDeleteResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[NamespacesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[NamespacesClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -310,7 +315,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 2024-05-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 +351,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,7 +359,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 2024-05-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -399,15 +404,81 @@ 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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// BeginFailover - GeoDR Failover +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2024-05-01-preview +// resourceGroupName - Name of the resource group within the azure subscription. +// namespaceName - The Namespace name +// parameters - Parameters for updating a namespace resource. +// options - NamespacesClientBeginFailoverOptions contains the optional parameters for the NamespacesClient.BeginFailover +// method. +func (client *NamespacesClient) BeginFailover(ctx context.Context, resourceGroupName string, namespaceName string, parameters FailOver, options *NamespacesClientBeginFailoverOptions) (*runtime.Poller[NamespacesClientFailoverResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.failover(ctx, resourceGroupName, namespaceName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[NamespacesClientFailoverResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[NamespacesClientFailoverResponse](options.ResumeToken, client.pl, nil) + } +} + +// Failover - GeoDR Failover +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2024-05-01-preview +func (client *NamespacesClient) failover(ctx context.Context, resourceGroupName string, namespaceName string, parameters FailOver, options *NamespacesClientBeginFailoverOptions) (*http.Response, error) { + req, err := client.failoverCreateRequest(ctx, resourceGroupName, namespaceName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// failoverCreateRequest creates the Failover request. +func (client *NamespacesClient) failoverCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, parameters FailOver, options *NamespacesClientBeginFailoverOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/failover" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + // 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 2024-05-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 +517,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -463,7 +534,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 2024-05-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -508,7 +579,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -525,7 +596,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 2024-05-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 +636,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -581,8 +652,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 2024-05-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 +694,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -640,8 +710,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 2024-05-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 +763,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -710,8 +779,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 2024-05-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 +827,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -776,7 +844,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 2024-05-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -820,7 +888,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -837,7 +905,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 2024-05-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 +945,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -894,7 +962,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 2024-05-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -940,7 +1008,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -958,7 +1026,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 2024-05-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 +1066,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", "2024-05-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..50bc4f1a289b 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 2024-05-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", "2024-05-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 94% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_networksecurityperimeterconfigurations_client.go rename to sdk/resourcemanager/eventhub/armeventhub/networksecurityperimeterconfigurations_client.go index 7f08e9db0b97..9e1758b20bbc 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 2024-05-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // resourceAssociationName - The ResourceAssociation Name @@ -69,7 +70,9 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) BeginCreateOrUpdate( if err != nil { return nil, err } - return runtime.NewPoller[NetworkSecurityPerimeterConfigurationsClientCreateOrUpdateResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[NetworkSecurityPerimeterConfigurationsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[NetworkSecurityPerimeterConfigurationsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -77,7 +80,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 2024-05-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 +120,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", "2024-05-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..40c4b24cef52 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 2024-05-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", "2024-05-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..2d73cd6baf1d 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 2024-05-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", "2024-05-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 2024-05-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -132,7 +133,9 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[PrivateEndpointConnectionsClientDeleteResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PrivateEndpointConnectionsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -140,7 +143,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 2024-05-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 +183,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +191,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 2024-05-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -233,7 +236,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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,8 +252,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 2024-05-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 +305,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", "2024-05-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..2b7067cb1a50 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 2024-05-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", "2024-05-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 98% rename from sdk/resourcemanager/eventhub/armeventhub/zz_generated_response_types.go rename to sdk/resourcemanager/eventhub/armeventhub/response_types.go index 93a45fd591f9..e84e60874b5e 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 @@ -228,6 +229,11 @@ type NamespacesClientDeleteResponse struct { // placeholder for future response values } +// NamespacesClientFailoverResponse contains the response from method NamespacesClient.Failover. +type NamespacesClientFailoverResponse struct { + // placeholder for future response values +} + // NamespacesClientGetAuthorizationRuleResponse contains the response from method NamespacesClient.GetAuthorizationRule. type NamespacesClientGetAuthorizationRuleResponse struct { AuthorizationRule 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..1ae540b8f4b3 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 @@ -56,9 +57,9 @@ func NewSchemaRegistryClient(subscriptionID string, credential azcore.TokenCrede return client, nil } -// CreateOrUpdate - +// CreateOrUpdate - Creates or Updates an EventHub schema group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2024-05-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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -119,9 +120,9 @@ func (client *SchemaRegistryClient) createOrUpdateHandleResponse(resp *http.Resp return result, nil } -// Delete - +// Delete - Deletes an EventHub schema group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2024-05-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // schemaGroupName - The Schema Group name @@ -165,15 +166,15 @@ 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", "2024-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - +// Get - Gets the details of an EventHub schema group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview +// Generated from API version 2024-05-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", "2024-05-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 2024-05-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", "2024-05-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 -} diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/CHANGELOG.md b/sdk/resourcemanager/servicelinker/armservicelinker/CHANGELOG.md index cac270158d1a..795fe48eb453 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/CHANGELOG.md +++ b/sdk/resourcemanager/servicelinker/armservicelinker/CHANGELOG.md @@ -1,5 +1,27 @@ # Release History +## 2.0.0 (2024-04-22) +### Breaking Changes + +- Type of `ErrorAdditionalInfo.Info` has been changed from `any` to `interface{}` +- Function `NewClientFactory` has been removed +- Function `*ClientFactory.NewLinkerClient` has been removed +- Function `*ClientFactory.NewOperationsClient` has been removed +- Function `*LinkerClient.BeginDelete` has been removed +- Function `dateTimeRFC3339.MarshalText` has been removed +- Function `*dateTimeRFC3339.Parse` has been removed +- Function `*dateTimeRFC3339.UnmarshalText` has been removed +- Struct `ClientFactory` has been removed +- Struct `LinkerClientDeleteResponse` has been removed + +### Features Added + +- New value `ClientTypeKafkaSpringBoot` added to type alias `ClientType` +- New function `timeRFC3339.MarshalText() ([]byte, error)` +- New function `*timeRFC3339.Parse(string) error` +- New function `*timeRFC3339.UnmarshalText([]byte) error` + + ## 1.0.0 (2022-05-18) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicelinker/armservicelinker` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/autorest.md b/sdk/resourcemanager/servicelinker/armservicelinker/autorest.md index 7c484bb849fd..3736e38460d9 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/autorest.md +++ b/sdk/resourcemanager/servicelinker/armservicelinker/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicelinker/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/servicelinker/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicelinker/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/servicelinker/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_constants.go b/sdk/resourcemanager/servicelinker/armservicelinker/constants.go similarity index 90% rename from sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_constants.go rename to sdk/resourcemanager/servicelinker/armservicelinker/constants.go index bb82b66c87fa..94f670ea1c57 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_constants.go +++ b/sdk/resourcemanager/servicelinker/armservicelinker/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 armservicelinker const ( moduleName = "armservicelinker" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -67,16 +68,17 @@ func PossibleAzureResourceTypeValues() []AzureResourceType { type ClientType string const ( - ClientTypeDjango ClientType = "django" - ClientTypeDotnet ClientType = "dotnet" - ClientTypeGo ClientType = "go" - ClientTypeJava ClientType = "java" - ClientTypeNodejs ClientType = "nodejs" - ClientTypeNone ClientType = "none" - ClientTypePhp ClientType = "php" - ClientTypePython ClientType = "python" - ClientTypeRuby ClientType = "ruby" - ClientTypeSpringBoot ClientType = "springBoot" + ClientTypeDjango ClientType = "django" + ClientTypeDotnet ClientType = "dotnet" + ClientTypeGo ClientType = "go" + ClientTypeJava ClientType = "java" + ClientTypeKafkaSpringBoot ClientType = "kafka-springBoot" + ClientTypeNodejs ClientType = "nodejs" + ClientTypeNone ClientType = "none" + ClientTypePhp ClientType = "php" + ClientTypePython ClientType = "python" + ClientTypeRuby ClientType = "ruby" + ClientTypeSpringBoot ClientType = "springBoot" ) // PossibleClientTypeValues returns the possible values for the ClientType const type. @@ -86,6 +88,7 @@ func PossibleClientTypeValues() []ClientType { ClientTypeDotnet, ClientTypeGo, ClientTypeJava, + ClientTypeKafkaSpringBoot, ClientTypeNodejs, ClientTypeNone, ClientTypePhp, diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/go.mod b/sdk/resourcemanager/servicelinker/armservicelinker/go.mod index 9350335fc702..002b32a98f95 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/go.mod +++ b/sdk/resourcemanager/servicelinker/armservicelinker/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicelinker/armservicelinker +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicelinker/armservicelinker/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.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/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 - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // 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.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/go.sum b/sdk/resourcemanager/servicelinker/armservicelinker/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/go.sum +++ b/sdk/resourcemanager/servicelinker/armservicelinker/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.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/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.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -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/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/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 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/servicelinker/armservicelinker/zz_generated_linker_client.go b/sdk/resourcemanager/servicelinker/armservicelinker/linker_client.go similarity index 86% rename from sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_linker_client.go rename to sdk/resourcemanager/servicelinker/armservicelinker/linker_client.go index 713c83a0d710..012bdbce2f37 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_linker_client.go +++ b/sdk/resourcemanager/servicelinker/armservicelinker/linker_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 armservicelinker @@ -110,63 +111,6 @@ func (client *LinkerClient) createOrUpdateCreateRequest(ctx context.Context, res return req, runtime.MarshalAsJSON(req, parameters) } -// BeginDelete - Delete a link. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -// resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. -// linkerName - The name Linker resource. -// options - LinkerClientBeginDeleteOptions contains the optional parameters for the LinkerClient.BeginDelete method. -func (client *LinkerClient) BeginDelete(ctx context.Context, resourceURI string, linkerName string, options *LinkerClientBeginDeleteOptions) (*runtime.Poller[LinkerClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceURI, linkerName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[LinkerClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) - } else { - return runtime.NewPollerFromResumeToken[LinkerClientDeleteResponse](options.ResumeToken, client.pl, nil) - } -} - -// Delete - Delete a link. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-05-01 -func (client *LinkerClient) deleteOperation(ctx context.Context, resourceURI string, linkerName string, options *LinkerClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceURI, linkerName, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *LinkerClient) deleteCreateRequest(ctx context.Context, resourceURI string, linkerName string, options *LinkerClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/{resourceUri}/providers/Microsoft.ServiceLinker/linkers/{linkerName}" - urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) - if linkerName == "" { - return nil, errors.New("parameter linkerName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{linkerName}", url.PathEscape(linkerName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - // Get - Returns Linker resource for a given name. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-05-01 @@ -217,7 +161,6 @@ func (client *LinkerClient) getHandleResponse(resp *http.Response) (LinkerClient } // NewListPager - Returns list of Linkers which connects to the resource. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-05-01 // resourceURI - The fully qualified Azure Resource manager identifier of the resource to be connected. // options - LinkerClientListOptions contains the optional parameters for the LinkerClient.List method. diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_models.go b/sdk/resourcemanager/servicelinker/armservicelinker/models.go similarity index 99% rename from sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_models.go rename to sdk/resourcemanager/servicelinker/armservicelinker/models.go index 8c974a4187dc..b5883dd0ab9a 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_models.go +++ b/sdk/resourcemanager/servicelinker/armservicelinker/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 armservicelinker @@ -194,12 +195,6 @@ type LinkerClientBeginCreateOrUpdateOptions struct { ResumeToken string } -// LinkerClientBeginDeleteOptions contains the optional parameters for the LinkerClient.BeginDelete method. -type LinkerClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // LinkerClientBeginUpdateOptions contains the optional parameters for the LinkerClient.BeginUpdate method. type LinkerClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/models_serde.go b/sdk/resourcemanager/servicelinker/armservicelinker/models_serde.go new file mode 100644 index 000000000000..dbeb1bcbf553 --- /dev/null +++ b/sdk/resourcemanager/servicelinker/armservicelinker/models_serde.go @@ -0,0 +1,1273 @@ +//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 armservicelinker + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AuthInfoBase. +func (a AuthInfoBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authType"] = a.AuthType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthInfoBase. +func (a *AuthInfoBase) 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 "authType": + err = unpopulate(val, "AuthType", &a.AuthType) + 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 AzureKeyVaultProperties. +func (a AzureKeyVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "connectAsKubernetesCsiDriver", a.ConnectAsKubernetesCsiDriver) + objectMap["type"] = AzureResourceTypeKeyVault + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureKeyVaultProperties. +func (a *AzureKeyVaultProperties) 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 "connectAsKubernetesCsiDriver": + err = unpopulate(val, "ConnectAsKubernetesCsiDriver", &a.ConnectAsKubernetesCsiDriver) + 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 AzureResource. +func (a AzureResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "resourceProperties", a.ResourceProperties) + objectMap["type"] = TargetServiceTypeAzureResource + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResource. +func (a *AzureResource) 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 "resourceProperties": + a.ResourceProperties, err = unmarshalAzureResourcePropertiesBaseClassification(val) + 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 AzureResourcePropertiesBase. +func (a AzureResourcePropertiesBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["type"] = a.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourcePropertiesBase. +func (a *AzureResourcePropertiesBase) 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 "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 ConfluentBootstrapServer. +func (c ConfluentBootstrapServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endpoint", c.Endpoint) + objectMap["type"] = TargetServiceTypeConfluentBootstrapServer + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfluentBootstrapServer. +func (c *ConfluentBootstrapServer) 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 "endpoint": + err = unpopulate(val, "Endpoint", &c.Endpoint) + 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 ConfluentSchemaRegistry. +func (c ConfluentSchemaRegistry) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "endpoint", c.Endpoint) + objectMap["type"] = TargetServiceTypeConfluentSchemaRegistry + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConfluentSchemaRegistry. +func (c *ConfluentSchemaRegistry) 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 "endpoint": + err = unpopulate(val, "Endpoint", &c.Endpoint) + 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 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 KeyVaultSecretReferenceSecretInfo. +func (k KeyVaultSecretReferenceSecretInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", k.Name) + objectMap["secretType"] = SecretTypeKeyVaultSecretReference + populate(objectMap, "version", k.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultSecretReferenceSecretInfo. +func (k *KeyVaultSecretReferenceSecretInfo) 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 "name": + err = unpopulate(val, "Name", &k.Name) + delete(rawMsg, key) + case "secretType": + err = unpopulate(val, "SecretType", &k.SecretType) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &k.Version) + 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 KeyVaultSecretURISecretInfo. +func (k KeyVaultSecretURISecretInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["secretType"] = SecretTypeKeyVaultSecretURI + populate(objectMap, "value", k.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultSecretURISecretInfo. +func (k *KeyVaultSecretURISecretInfo) 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 "secretType": + err = unpopulate(val, "SecretType", &k.SecretType) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &k.Value) + 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 LinkerList. +func (l LinkerList) 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 LinkerList. +func (l *LinkerList) 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 LinkerPatch. +func (l LinkerPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", l.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkerPatch. +func (l *LinkerPatch) 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 "properties": + err = unpopulate(val, "Properties", &l.Properties) + 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 LinkerProperties. +func (l LinkerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authInfo", l.AuthInfo) + populate(objectMap, "clientType", l.ClientType) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "scope", l.Scope) + populate(objectMap, "secretStore", l.SecretStore) + populate(objectMap, "targetService", l.TargetService) + populate(objectMap, "vNetSolution", l.VNetSolution) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkerProperties. +func (l *LinkerProperties) 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 "authInfo": + l.AuthInfo, err = unmarshalAuthInfoBaseClassification(val) + delete(rawMsg, key) + case "clientType": + err = unpopulate(val, "ClientType", &l.ClientType) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &l.Scope) + delete(rawMsg, key) + case "secretStore": + err = unpopulate(val, "SecretStore", &l.SecretStore) + delete(rawMsg, key) + case "targetService": + l.TargetService, err = unmarshalTargetServiceBaseClassification(val) + delete(rawMsg, key) + case "vNetSolution": + err = unpopulate(val, "VNetSolution", &l.VNetSolution) + 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 LinkerResource. +func (l LinkerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkerResource. +func (l *LinkerResource) 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 "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &l.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + 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 Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionType", o.ActionType) + populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + 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 "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) + delete(rawMsg, 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) + } + 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 ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + 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 "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 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 SecretAuthInfo. +func (s SecretAuthInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authType"] = AuthTypeSecret + populate(objectMap, "name", s.Name) + populate(objectMap, "secretInfo", s.SecretInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretAuthInfo. +func (s *SecretAuthInfo) 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 "authType": + err = unpopulate(val, "AuthType", &s.AuthType) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "secretInfo": + s.SecretInfo, err = unmarshalSecretInfoBaseClassification(val) + 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 SecretInfoBase. +func (s SecretInfoBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["secretType"] = s.SecretType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretInfoBase. +func (s *SecretInfoBase) 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 "secretType": + err = unpopulate(val, "SecretType", &s.SecretType) + 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 SecretStore. +func (s SecretStore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "keyVaultId", s.KeyVaultID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecretStore. +func (s *SecretStore) 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 "keyVaultId": + err = unpopulate(val, "KeyVaultID", &s.KeyVaultID) + 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 ServicePrincipalCertificateAuthInfo. +func (s ServicePrincipalCertificateAuthInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authType"] = AuthTypeServicePrincipalCertificate + populate(objectMap, "certificate", s.Certificate) + populate(objectMap, "clientId", s.ClientID) + populate(objectMap, "principalId", s.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalCertificateAuthInfo. +func (s *ServicePrincipalCertificateAuthInfo) 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 "authType": + err = unpopulate(val, "AuthType", &s.AuthType) + delete(rawMsg, key) + case "certificate": + err = unpopulate(val, "Certificate", &s.Certificate) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &s.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &s.PrincipalID) + 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 ServicePrincipalSecretAuthInfo. +func (s ServicePrincipalSecretAuthInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authType"] = AuthTypeServicePrincipalSecret + populate(objectMap, "clientId", s.ClientID) + populate(objectMap, "principalId", s.PrincipalID) + populate(objectMap, "secret", s.Secret) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalSecretAuthInfo. +func (s *ServicePrincipalSecretAuthInfo) 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 "authType": + err = unpopulate(val, "AuthType", &s.AuthType) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &s.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &s.PrincipalID) + delete(rawMsg, key) + case "secret": + err = unpopulate(val, "Secret", &s.Secret) + 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 SourceConfiguration. +func (s SourceConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", s.Name) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SourceConfiguration. +func (s *SourceConfiguration) 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 "name": + err = unpopulate(val, "Name", &s.Name) + 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 SourceConfigurationResult. +func (s SourceConfigurationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "configurations", s.Configurations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SourceConfigurationResult. +func (s *SourceConfigurationResult) 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 "configurations": + err = unpopulate(val, "Configurations", &s.Configurations) + 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 SystemAssignedIdentityAuthInfo. +func (s SystemAssignedIdentityAuthInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authType"] = AuthTypeSystemAssignedIdentity + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemAssignedIdentityAuthInfo. +func (s *SystemAssignedIdentityAuthInfo) 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 "authType": + err = unpopulate(val, "AuthType", &s.AuthType) + 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 TargetServiceBase. +func (t TargetServiceBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["type"] = t.Type + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TargetServiceBase. +func (t *TargetServiceBase) 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 "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 UserAssignedIdentityAuthInfo. +func (u UserAssignedIdentityAuthInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["authType"] = AuthTypeUserAssignedIdentity + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "subscriptionId", u.SubscriptionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentityAuthInfo. +func (u *UserAssignedIdentityAuthInfo) 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 "authType": + err = unpopulate(val, "AuthType", &u.AuthType) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &u.SubscriptionID) + 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 VNetSolution. +func (v VNetSolution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VNetSolution. +func (v *VNetSolution) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateOperationResult. +func (v ValidateOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "resourceId", v.ResourceID) + populate(objectMap, "status", v.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateOperationResult. +func (v *ValidateOperationResult) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &v.ResourceID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &v.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateResult. +func (v ValidateResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authType", v.AuthType) + populate(objectMap, "isConnectionAvailable", v.IsConnectionAvailable) + populate(objectMap, "linkerName", v.LinkerName) + populateTimeRFC3339(objectMap, "reportEndTimeUtc", v.ReportEndTimeUTC) + populateTimeRFC3339(objectMap, "reportStartTimeUtc", v.ReportStartTimeUTC) + populate(objectMap, "sourceId", v.SourceID) + populate(objectMap, "targetId", v.TargetID) + populate(objectMap, "validationDetail", v.ValidationDetail) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateResult. +func (v *ValidateResult) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authType": + err = unpopulate(val, "AuthType", &v.AuthType) + delete(rawMsg, key) + case "isConnectionAvailable": + err = unpopulate(val, "IsConnectionAvailable", &v.IsConnectionAvailable) + delete(rawMsg, key) + case "linkerName": + err = unpopulate(val, "LinkerName", &v.LinkerName) + delete(rawMsg, key) + case "reportEndTimeUtc": + err = unpopulateTimeRFC3339(val, "ReportEndTimeUTC", &v.ReportEndTimeUTC) + delete(rawMsg, key) + case "reportStartTimeUtc": + err = unpopulateTimeRFC3339(val, "ReportStartTimeUTC", &v.ReportStartTimeUTC) + delete(rawMsg, key) + case "sourceId": + err = unpopulate(val, "SourceID", &v.SourceID) + delete(rawMsg, key) + case "targetId": + err = unpopulate(val, "TargetID", &v.TargetID) + delete(rawMsg, key) + case "validationDetail": + err = unpopulate(val, "ValidationDetail", &v.ValidationDetail) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidationResultItem. +func (v ValidationResultItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", v.Description) + populate(objectMap, "errorCode", v.ErrorCode) + populate(objectMap, "errorMessage", v.ErrorMessage) + populate(objectMap, "name", v.Name) + populate(objectMap, "result", v.Result) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidationResultItem. +func (v *ValidationResultItem) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &v.Description) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &v.ErrorCode) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &v.ErrorMessage) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "result": + err = unpopulate(val, "Result", &v.Result) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValueSecretInfo. +func (v ValueSecretInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["secretType"] = SecretTypeRawValue + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValueSecretInfo. +func (v *ValueSecretInfo) 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", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "secretType": + err = unpopulate(val, "SecretType", &v.SecretType) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, 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/servicelinker/armservicelinker/zz_generated_operations_client.go b/sdk/resourcemanager/servicelinker/armservicelinker/operations_client.go similarity index 98% rename from sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_operations_client.go rename to sdk/resourcemanager/servicelinker/armservicelinker/operations_client.go index fc3fda26c097..991afd9de620 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_operations_client.go +++ b/sdk/resourcemanager/servicelinker/armservicelinker/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 armservicelinker @@ -49,7 +50,6 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists the available ServiceLinker REST API operations. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2022-05-01 // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/servicelinker/armservicelinker/polymorphic_helpers.go similarity index 99% rename from sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_polymorphic_helpers.go rename to sdk/resourcemanager/servicelinker/armservicelinker/polymorphic_helpers.go index 94ea80336605..bdd497a1738b 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/servicelinker/armservicelinker/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 armservicelinker diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_response_types.go b/sdk/resourcemanager/servicelinker/armservicelinker/response_types.go similarity index 89% rename from sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_response_types.go rename to sdk/resourcemanager/servicelinker/armservicelinker/response_types.go index 4ebf1684f969..bbcaa1a40a01 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_response_types.go +++ b/sdk/resourcemanager/servicelinker/armservicelinker/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 armservicelinker @@ -13,11 +14,6 @@ type LinkerClientCreateOrUpdateResponse struct { LinkerResource } -// LinkerClientDeleteResponse contains the response from method LinkerClient.Delete. -type LinkerClientDeleteResponse struct { - // placeholder for future response values -} - // LinkerClientGetResponse contains the response from method LinkerClient.Get. type LinkerClientGetResponse struct { LinkerResource diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_time_rfc3339.go b/sdk/resourcemanager/servicelinker/armservicelinker/time_rfc3339.go similarity index 99% rename from sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/servicelinker/armservicelinker/time_rfc3339.go index edb565fe38d1..c7c0e007186f 100644 --- a/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/servicelinker/armservicelinker/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 armservicelinker diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/ze_generated_example_linker_client_test.go b/sdk/resourcemanager/servicelinker/armservicelinker/ze_generated_example_linker_client_test.go deleted file mode 100644 index 4330afd2d9e2..000000000000 --- a/sdk/resourcemanager/servicelinker/armservicelinker/ze_generated_example_linker_client_test.go +++ /dev/null @@ -1,219 +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 armservicelinker_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/servicelinker/armservicelinker" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/LinkList.json -func ExampleLinkerClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicelinker.NewLinkerClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", - 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/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/Link.json -func ExampleLinkerClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicelinker.NewLinkerClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", - "linkName", - 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/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PutLink.json -func ExampleLinkerClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicelinker.NewLinkerClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", - "linkName", - armservicelinker.LinkerResource{ - Properties: &armservicelinker.LinkerProperties{ - AuthInfo: &armservicelinker.SecretAuthInfo{ - AuthType: to.Ptr(armservicelinker.AuthTypeSecret), - Name: to.Ptr("name"), - SecretInfo: &armservicelinker.ValueSecretInfo{ - SecretType: to.Ptr(armservicelinker.SecretTypeRawValue), - Value: to.Ptr("secret"), - }, - }, - TargetService: &armservicelinker.AzureResource{ - Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DBforPostgreSQL/servers/test-pg/databases/test-db"), - }, - }, - }, - 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/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/DeleteLink.json -func ExampleLinkerClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicelinker.NewLinkerClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", - "linkName", - 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/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/PatchLink.json -func ExampleLinkerClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicelinker.NewLinkerClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", - "linkName", - armservicelinker.LinkerPatch{ - Properties: &armservicelinker.LinkerProperties{ - AuthInfo: &armservicelinker.ServicePrincipalSecretAuthInfo{ - AuthType: to.Ptr(armservicelinker.AuthTypeServicePrincipalSecret), - ClientID: to.Ptr("name"), - PrincipalID: to.Ptr("id"), - Secret: to.Ptr("secret"), - }, - TargetService: &armservicelinker.AzureResource{ - Type: to.Ptr(armservicelinker.TargetServiceTypeAzureResource), - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.DocumentDb/databaseAccounts/test-acc/mongodbDatabases/test-db"), - }, - }, - }, - 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/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/ValidateLinkSuccess.json -func ExampleLinkerClient_BeginValidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicelinker.NewLinkerClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginValidate(ctx, - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", - "linkName", - 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/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/GetConfigurations.json -func ExampleLinkerClient_ListConfigurations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armservicelinker.NewLinkerClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListConfigurations(ctx, - "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app", - "linkName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/servicelinker/armservicelinker/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/servicelinker/armservicelinker/ze_generated_example_operations_client_test.go deleted file mode 100644 index 0d17af596596..000000000000 --- a/sdk/resourcemanager/servicelinker/armservicelinker/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 armservicelinker_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicelinker/armservicelinker" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicelinker/resource-manager/Microsoft.ServiceLinker/stable/2022-05-01/examples/OperationsList.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 := armservicelinker.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/servicelinker/armservicelinker/zz_generated_models_serde.go b/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_models_serde.go deleted file mode 100644 index 3ca32fb05739..000000000000 --- a/sdk/resourcemanager/servicelinker/armservicelinker/zz_generated_models_serde.go +++ /dev/null @@ -1,582 +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 armservicelinker - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AzureKeyVaultProperties. -func (a AzureKeyVaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectAsKubernetesCsiDriver", a.ConnectAsKubernetesCsiDriver) - objectMap["type"] = AzureResourceTypeKeyVault - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureKeyVaultProperties. -func (a *AzureKeyVaultProperties) 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 "connectAsKubernetesCsiDriver": - err = unpopulate(val, "ConnectAsKubernetesCsiDriver", &a.ConnectAsKubernetesCsiDriver) - 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 AzureResource. -func (a AzureResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "resourceProperties", a.ResourceProperties) - objectMap["type"] = TargetServiceTypeAzureResource - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResource. -func (a *AzureResource) 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 "resourceProperties": - a.ResourceProperties, err = unmarshalAzureResourcePropertiesBaseClassification(val) - 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 ConfluentBootstrapServer. -func (c ConfluentBootstrapServer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "endpoint", c.Endpoint) - objectMap["type"] = TargetServiceTypeConfluentBootstrapServer - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfluentBootstrapServer. -func (c *ConfluentBootstrapServer) 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 "endpoint": - err = unpopulate(val, "Endpoint", &c.Endpoint) - 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 ConfluentSchemaRegistry. -func (c ConfluentSchemaRegistry) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "endpoint", c.Endpoint) - objectMap["type"] = TargetServiceTypeConfluentSchemaRegistry - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConfluentSchemaRegistry. -func (c *ConfluentSchemaRegistry) 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 "endpoint": - err = unpopulate(val, "Endpoint", &c.Endpoint) - 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 KeyVaultSecretReferenceSecretInfo. -func (k KeyVaultSecretReferenceSecretInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", k.Name) - objectMap["secretType"] = SecretTypeKeyVaultSecretReference - populate(objectMap, "version", k.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultSecretReferenceSecretInfo. -func (k *KeyVaultSecretReferenceSecretInfo) 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 "name": - err = unpopulate(val, "Name", &k.Name) - delete(rawMsg, key) - case "secretType": - err = unpopulate(val, "SecretType", &k.SecretType) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &k.Version) - 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 KeyVaultSecretURISecretInfo. -func (k KeyVaultSecretURISecretInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["secretType"] = SecretTypeKeyVaultSecretURI - populate(objectMap, "value", k.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultSecretURISecretInfo. -func (k *KeyVaultSecretURISecretInfo) 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 "secretType": - err = unpopulate(val, "SecretType", &k.SecretType) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &k.Value) - 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 LinkerPatch. -func (l LinkerPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", l.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LinkerProperties. -func (l LinkerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authInfo", l.AuthInfo) - populate(objectMap, "clientType", l.ClientType) - populate(objectMap, "provisioningState", l.ProvisioningState) - populate(objectMap, "scope", l.Scope) - populate(objectMap, "secretStore", l.SecretStore) - populate(objectMap, "targetService", l.TargetService) - populate(objectMap, "vNetSolution", l.VNetSolution) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LinkerProperties. -func (l *LinkerProperties) 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 "authInfo": - l.AuthInfo, err = unmarshalAuthInfoBaseClassification(val) - delete(rawMsg, key) - case "clientType": - err = unpopulate(val, "ClientType", &l.ClientType) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) - delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &l.Scope) - delete(rawMsg, key) - case "secretStore": - err = unpopulate(val, "SecretStore", &l.SecretStore) - delete(rawMsg, key) - case "targetService": - l.TargetService, err = unmarshalTargetServiceBaseClassification(val) - delete(rawMsg, key) - case "vNetSolution": - err = unpopulate(val, "VNetSolution", &l.VNetSolution) - 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 SecretAuthInfo. -func (s SecretAuthInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["authType"] = AuthTypeSecret - populate(objectMap, "name", s.Name) - populate(objectMap, "secretInfo", s.SecretInfo) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecretAuthInfo. -func (s *SecretAuthInfo) 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 "authType": - err = unpopulate(val, "AuthType", &s.AuthType) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "secretInfo": - s.SecretInfo, err = unmarshalSecretInfoBaseClassification(val) - 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 ServicePrincipalCertificateAuthInfo. -func (s ServicePrincipalCertificateAuthInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["authType"] = AuthTypeServicePrincipalCertificate - populate(objectMap, "certificate", s.Certificate) - populate(objectMap, "clientId", s.ClientID) - populate(objectMap, "principalId", s.PrincipalID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalCertificateAuthInfo. -func (s *ServicePrincipalCertificateAuthInfo) 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 "authType": - err = unpopulate(val, "AuthType", &s.AuthType) - delete(rawMsg, key) - case "certificate": - err = unpopulate(val, "Certificate", &s.Certificate) - delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &s.ClientID) - delete(rawMsg, key) - case "principalId": - err = unpopulate(val, "PrincipalID", &s.PrincipalID) - 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 ServicePrincipalSecretAuthInfo. -func (s ServicePrincipalSecretAuthInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["authType"] = AuthTypeServicePrincipalSecret - populate(objectMap, "clientId", s.ClientID) - populate(objectMap, "principalId", s.PrincipalID) - populate(objectMap, "secret", s.Secret) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipalSecretAuthInfo. -func (s *ServicePrincipalSecretAuthInfo) 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 "authType": - err = unpopulate(val, "AuthType", &s.AuthType) - delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &s.ClientID) - delete(rawMsg, key) - case "principalId": - err = unpopulate(val, "PrincipalID", &s.PrincipalID) - delete(rawMsg, key) - case "secret": - err = unpopulate(val, "Secret", &s.Secret) - 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 SystemAssignedIdentityAuthInfo. -func (s SystemAssignedIdentityAuthInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["authType"] = AuthTypeSystemAssignedIdentity - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemAssignedIdentityAuthInfo. -func (s *SystemAssignedIdentityAuthInfo) 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 "authType": - err = unpopulate(val, "AuthType", &s.AuthType) - 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 UserAssignedIdentityAuthInfo. -func (u UserAssignedIdentityAuthInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["authType"] = AuthTypeUserAssignedIdentity - populate(objectMap, "clientId", u.ClientID) - populate(objectMap, "subscriptionId", u.SubscriptionID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentityAuthInfo. -func (u *UserAssignedIdentityAuthInfo) 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 "authType": - err = unpopulate(val, "AuthType", &u.AuthType) - delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &u.ClientID) - delete(rawMsg, key) - case "subscriptionId": - err = unpopulate(val, "SubscriptionID", &u.SubscriptionID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateResult. -func (v *ValidateResult) 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", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "authType": - err = unpopulate(val, "AuthType", &v.AuthType) - delete(rawMsg, key) - case "isConnectionAvailable": - err = unpopulate(val, "IsConnectionAvailable", &v.IsConnectionAvailable) - delete(rawMsg, key) - case "linkerName": - err = unpopulate(val, "LinkerName", &v.LinkerName) - delete(rawMsg, key) - case "reportEndTimeUtc": - err = unpopulateTimeRFC3339(val, "ReportEndTimeUTC", &v.ReportEndTimeUTC) - delete(rawMsg, key) - case "reportStartTimeUtc": - err = unpopulateTimeRFC3339(val, "ReportStartTimeUTC", &v.ReportStartTimeUTC) - delete(rawMsg, key) - case "sourceId": - err = unpopulate(val, "SourceID", &v.SourceID) - delete(rawMsg, key) - case "targetId": - err = unpopulate(val, "TargetID", &v.TargetID) - delete(rawMsg, key) - case "validationDetail": - err = unpopulate(val, "ValidationDetail", &v.ValidationDetail) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ValueSecretInfo. -func (v ValueSecretInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["secretType"] = SecretTypeRawValue - populate(objectMap, "value", v.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ValueSecretInfo. -func (v *ValueSecretInfo) 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", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "secretType": - err = unpopulate(val, "SecretType", &v.SecretType) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &v.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, 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 -}