From 0d4297f441bc65d22b5c314caafff5aea8e81b50 Mon Sep 17 00:00:00 2001 From: TracyYaoYao <18314464415@163.com> Date: Tue, 26 Mar 2024 16:49:37 +0800 Subject: [PATCH] Customize memory ojbects for profile Logscrub --- src/Cdn/Cdn.Autorest/Az.Cdn.psd1 | 2 +- src/Cdn/Cdn.Autorest/README.md | 8 +-- ...zFrontDoorCdnProfileLogScrubbingObject.ps1 | 54 ++++++++++++++++ ...rontDoorCdnProfileScrubbingRulesObject.ps1 | 61 +++++++++++++++++++ src/Cdn/Cdn.Autorest/docs/Az.Cdn.md | 12 ++-- ...zFrontDoorCdnProfileLogScrubbingObject.md} | 6 +- ...rontDoorCdnProfileScrubbingRulesObject.md} | 8 +-- ...zFrontDoorCdnProfileLogScrubbingObject.md} | 0 ...rontDoorCdnProfileScrubbingRulesObject.md} | 0 ...DoorCdnProfileLogScrubbingObject.Tests.ps1 | 21 +++++++ ...orCdnProfileScrubbingRulesObject.Tests.ps1 | 21 +++++++ 11 files changed, 175 insertions(+), 18 deletions(-) create mode 100644 src/Cdn/Cdn.Autorest/custom/New-AzFrontDoorCdnProfileLogScrubbingObject.ps1 create mode 100644 src/Cdn/Cdn.Autorest/custom/New-AzFrontDoorCdnProfileScrubbingRulesObject.ps1 rename src/Cdn/Cdn.Autorest/docs/{New-AzCdnProfileLogScrubbingObject.md => New-AzFrontDoorCdnProfileLogScrubbingObject.md} (91%) rename src/Cdn/Cdn.Autorest/docs/{New-AzCdnProfileScrubbingRulesObject.md => New-AzFrontDoorCdnProfileScrubbingRulesObject.md} (88%) rename src/Cdn/Cdn.Autorest/examples/{New-AzCdnProfileLogScrubbingObject.md => New-AzFrontDoorCdnProfileLogScrubbingObject.md} (100%) rename src/Cdn/Cdn.Autorest/examples/{New-AzCdnProfileScrubbingRulesObject.md => New-AzFrontDoorCdnProfileScrubbingRulesObject.md} (100%) create mode 100644 src/Cdn/Cdn.Autorest/test/New-AzFrontDoorCdnProfileLogScrubbingObject.Tests.ps1 create mode 100644 src/Cdn/Cdn.Autorest/test/New-AzFrontDoorCdnProfileScrubbingRulesObject.Tests.ps1 diff --git a/src/Cdn/Cdn.Autorest/Az.Cdn.psd1 b/src/Cdn/Cdn.Autorest/Az.Cdn.psd1 index 4ab96bc13139..ea3150f7631b 100644 --- a/src/Cdn/Cdn.Autorest/Az.Cdn.psd1 +++ b/src/Cdn/Cdn.Autorest/Az.Cdn.psd1 @@ -11,7 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.Cdn.private.dll' FormatsToProcess = './Az.Cdn.format.ps1xml' - FunctionsToExport = 'Clear-AzCdnEndpointContent', 'Clear-AzFrontDoorCdnEndpointContent', 'Disable-AzCdnCustomDomainCustomHttps', 'Enable-AzCdnCustomDomainCustomHttps', 'Enable-AzFrontDoorCdnProfileMigration', 'Get-AzCdnCustomDomain', 'Get-AzCdnEdgeNode', 'Get-AzCdnEndpoint', 'Get-AzCdnEndpointResourceUsage', 'Get-AzCdnOrigin', 'Get-AzCdnOriginGroup', 'Get-AzCdnProfile', 'Get-AzCdnProfileResourceUsage', 'Get-AzCdnProfileSupportedOptimizationType', 'Get-AzCdnSubscriptionResourceUsage', 'Get-AzFrontDoorCdnCustomDomain', 'Get-AzFrontDoorCdnEndpoint', 'Get-AzFrontDoorCdnEndpointResourceUsage', 'Get-AzFrontDoorCdnOrigin', 'Get-AzFrontDoorCdnOriginGroup', 'Get-AzFrontDoorCdnOriginGroupResourceUsage', 'Get-AzFrontDoorCdnProfile', 'Get-AzFrontDoorCdnProfileResourceUsage', 'Get-AzFrontDoorCdnRoute', 'Get-AzFrontDoorCdnRule', 'Get-AzFrontDoorCdnRuleSet', 'Get-AzFrontDoorCdnRuleSetResourceUsage', 'Get-AzFrontDoorCdnSecret', 'Get-AzFrontDoorCdnSecurityPolicy', 'Import-AzCdnEndpointContent', 'New-AzCdnCustomDomain', 'New-AzCdnDeliveryRuleCacheExpirationActionObject', 'New-AzCdnDeliveryRuleCacheKeyQueryStringActionObject', 'New-AzCdnDeliveryRuleCookiesConditionObject', 'New-AzCdnDeliveryRuleHttpVersionConditionObject', 'New-AzCdnDeliveryRuleIsDeviceConditionObject', 'New-AzCdnDeliveryRuleObject', 'New-AzCdnDeliveryRulePostArgsConditionObject', 'New-AzCdnDeliveryRuleQueryStringConditionObject', 'New-AzCdnDeliveryRuleRemoteAddressConditionObject', 'New-AzCdnDeliveryRuleRequestBodyConditionObject', 'New-AzCdnDeliveryRuleRequestHeaderActionObject', 'New-AzCdnDeliveryRuleRequestHeaderConditionObject', 'New-AzCdnDeliveryRuleRequestMethodConditionObject', 'New-AzCdnDeliveryRuleRequestSchemeConditionObject', 'New-AzCdnDeliveryRuleRequestUriConditionObject', 'New-AzCdnDeliveryRuleResponseHeaderActionObject', 'New-AzCdnDeliveryRuleUrlFileExtensionConditionObject', 'New-AzCdnDeliveryRuleUrlFileNameConditionObject', 'New-AzCdnDeliveryRuleUrlPathConditionObject', 'New-AzCdnEndpoint', 'New-AzCdnHealthProbeParametersObject', 'New-AzCdnLoadParametersObject', 'New-AzCdnManagedHttpsParametersObject', 'New-AzCdnOrigin', 'New-AzCdnOriginGroup', 'New-AzCdnOriginGroupOverrideActionObject', 'New-AzCdnProfile', 'New-AzCdnProfileLogScrubbingObject', 'New-AzCdnProfileScrubbingRulesObject', 'New-AzCdnPurgeParametersObject', 'New-AzCdnResourceReferenceObject', 'New-AzCdnResponseBasedOriginErrorDetectionParametersObject', 'New-AzCdnUrlRedirectActionObject', 'New-AzCdnUrlRewriteActionObject', 'New-AzCdnUrlSigningActionObject', 'New-AzCdnUserManagedHttpsParametersObject', 'New-AzFrontDoorCdnCustomDomain', 'New-AzFrontDoorCdnCustomDomainTlsSettingParametersObject', 'New-AzFrontDoorCdnEndpoint', 'New-AzFrontDoorCdnMigrationParametersObject', 'New-AzFrontDoorCdnMigrationWebApplicationFirewallMappingObject', 'New-AzFrontDoorCdnOrigin', 'New-AzFrontDoorCdnOriginGroup', 'New-AzFrontDoorCdnOriginGroupHealthProbeSettingObject', 'New-AzFrontDoorCdnOriginGroupLoadBalancingSettingObject', 'New-AzFrontDoorCdnProfile', 'New-AzFrontDoorCdnProfileChangeSkuWafMappingObject', 'New-AzFrontDoorCdnProfileUpgradeParametersObject', 'New-AzFrontDoorCdnPurgeParametersObject', 'New-AzFrontDoorCdnResourceReferenceObject', 'New-AzFrontDoorCdnRoute', 'New-AzFrontDoorCdnRule', 'New-AzFrontDoorCdnRuleClientPortConditionObject', 'New-AzFrontDoorCdnRuleCookiesConditionObject', 'New-AzFrontDoorCdnRuleHostNameConditionObject', 'New-AzFrontDoorCdnRuleHttpVersionConditionObject', 'New-AzFrontDoorCdnRuleIsDeviceConditionObject', 'New-AzFrontDoorCdnRulePostArgsConditionObject', 'New-AzFrontDoorCdnRuleQueryStringConditionObject', 'New-AzFrontDoorCdnRuleRemoteAddressConditionObject', 'New-AzFrontDoorCdnRuleRequestBodyConditionObject', 'New-AzFrontDoorCdnRuleRequestHeaderActionObject', 'New-AzFrontDoorCdnRuleRequestHeaderConditionObject', 'New-AzFrontDoorCdnRuleRequestMethodConditionObject', 'New-AzFrontDoorCdnRuleRequestSchemeConditionObject', 'New-AzFrontDoorCdnRuleRequestUriConditionObject', 'New-AzFrontDoorCdnRuleResponseHeaderActionObject', 'New-AzFrontDoorCdnRuleRouteConfigurationOverrideActionObject', 'New-AzFrontDoorCdnRuleServerPortConditionObject', 'New-AzFrontDoorCdnRuleSet', 'New-AzFrontDoorCdnRuleSocketAddrConditionObject', 'New-AzFrontDoorCdnRuleSslProtocolConditionObject', 'New-AzFrontDoorCdnRuleUrlFileExtensionConditionObject', 'New-AzFrontDoorCdnRuleUrlFileNameConditionObject', 'New-AzFrontDoorCdnRuleUrlPathConditionObject', 'New-AzFrontDoorCdnRuleUrlRedirectActionObject', 'New-AzFrontDoorCdnRuleUrlRewriteActionObject', 'New-AzFrontDoorCdnRuleUrlSigningActionObject', 'New-AzFrontDoorCdnSecret', 'New-AzFrontDoorCdnSecretCustomerCertificateParametersObject', 'New-AzFrontDoorCdnSecretFirstPartyManagedCertificateParametersObject', 'New-AzFrontDoorCdnSecretManagedCertificateParametersObject', 'New-AzFrontDoorCdnSecretUrlSigningKeyParametersObject', 'New-AzFrontDoorCdnSecurityPolicy', 'New-AzFrontDoorCdnSecurityPolicyWebApplicationFirewallAssociationObject', 'New-AzFrontDoorCdnSecurityPolicyWebApplicationFirewallParametersObject', 'Remove-AzCdnCustomDomain', 'Remove-AzCdnEndpoint', 'Remove-AzCdnOrigin', 'Remove-AzCdnOriginGroup', 'Remove-AzCdnProfile', 'Remove-AzFrontDoorCdnCustomDomain', 'Remove-AzFrontDoorCdnEndpoint', 'Remove-AzFrontDoorCdnOrigin', 'Remove-AzFrontDoorCdnOriginGroup', 'Remove-AzFrontDoorCdnProfile', 'Remove-AzFrontDoorCdnRoute', 'Remove-AzFrontDoorCdnRule', 'Remove-AzFrontDoorCdnRuleSet', 'Remove-AzFrontDoorCdnSecret', 'Remove-AzFrontDoorCdnSecurityPolicy', 'Start-AzCdnEndpoint', 'Start-AzFrontDoorCdnProfilePrepareMigration', 'Stop-AzCdnEndpoint', 'Stop-AzFrontDoorCdnProfileMigration', 'Test-AzCdnEndpointCustomDomain', 'Test-AzCdnNameAvailability', 'Test-AzCdnProbe', 'Test-AzFrontDoorCdnEndpointCustomDomain', 'Test-AzFrontDoorCdnEndpointNameAvailability', 'Test-AzFrontDoorCdnProfileHostNameAvailability', 'Test-AzFrontDoorCdnProfileMigration', 'Update-AzCdnEndpoint', 'Update-AzCdnOrigin', 'Update-AzCdnOriginGroup', 'Update-AzCdnProfile', 'Update-AzFrontDoorCdnCustomDomain', 'Update-AzFrontDoorCdnCustomDomainValidationToken', 'Update-AzFrontDoorCdnEndpoint', 'Update-AzFrontDoorCdnOrigin', 'Update-AzFrontDoorCdnOriginGroup', 'Update-AzFrontDoorCdnProfile', 'Update-AzFrontDoorCdnProfileSku', 'Update-AzFrontDoorCdnRoute', 'Update-AzFrontDoorCdnRule', 'Update-AzFrontDoorCdnSecurityPolicy', '*' + FunctionsToExport = 'Clear-AzCdnEndpointContent', 'Clear-AzFrontDoorCdnEndpointContent', 'Disable-AzCdnCustomDomainCustomHttps', 'Enable-AzCdnCustomDomainCustomHttps', 'Enable-AzFrontDoorCdnProfileMigration', 'Get-AzCdnCustomDomain', 'Get-AzCdnEdgeNode', 'Get-AzCdnEndpoint', 'Get-AzCdnEndpointResourceUsage', 'Get-AzCdnOrigin', 'Get-AzCdnOriginGroup', 'Get-AzCdnProfile', 'Get-AzCdnProfileResourceUsage', 'Get-AzCdnProfileSupportedOptimizationType', 'Get-AzCdnSubscriptionResourceUsage', 'Get-AzFrontDoorCdnCustomDomain', 'Get-AzFrontDoorCdnEndpoint', 'Get-AzFrontDoorCdnEndpointResourceUsage', 'Get-AzFrontDoorCdnOrigin', 'Get-AzFrontDoorCdnOriginGroup', 'Get-AzFrontDoorCdnOriginGroupResourceUsage', 'Get-AzFrontDoorCdnProfile', 'Get-AzFrontDoorCdnProfileResourceUsage', 'Get-AzFrontDoorCdnRoute', 'Get-AzFrontDoorCdnRule', 'Get-AzFrontDoorCdnRuleSet', 'Get-AzFrontDoorCdnRuleSetResourceUsage', 'Get-AzFrontDoorCdnSecret', 'Get-AzFrontDoorCdnSecurityPolicy', 'Import-AzCdnEndpointContent', 'New-AzCdnCustomDomain', 'New-AzCdnDeliveryRuleCacheExpirationActionObject', 'New-AzCdnDeliveryRuleCacheKeyQueryStringActionObject', 'New-AzCdnDeliveryRuleCookiesConditionObject', 'New-AzCdnDeliveryRuleHttpVersionConditionObject', 'New-AzCdnDeliveryRuleIsDeviceConditionObject', 'New-AzCdnDeliveryRuleObject', 'New-AzCdnDeliveryRulePostArgsConditionObject', 'New-AzCdnDeliveryRuleQueryStringConditionObject', 'New-AzCdnDeliveryRuleRemoteAddressConditionObject', 'New-AzCdnDeliveryRuleRequestBodyConditionObject', 'New-AzCdnDeliveryRuleRequestHeaderActionObject', 'New-AzCdnDeliveryRuleRequestHeaderConditionObject', 'New-AzCdnDeliveryRuleRequestMethodConditionObject', 'New-AzCdnDeliveryRuleRequestSchemeConditionObject', 'New-AzCdnDeliveryRuleRequestUriConditionObject', 'New-AzCdnDeliveryRuleResponseHeaderActionObject', 'New-AzCdnDeliveryRuleUrlFileExtensionConditionObject', 'New-AzCdnDeliveryRuleUrlFileNameConditionObject', 'New-AzCdnDeliveryRuleUrlPathConditionObject', 'New-AzCdnEndpoint', 'New-AzCdnHealthProbeParametersObject', 'New-AzCdnLoadParametersObject', 'New-AzCdnManagedHttpsParametersObject', 'New-AzCdnOrigin', 'New-AzCdnOriginGroup', 'New-AzCdnOriginGroupOverrideActionObject', 'New-AzCdnProfile', 'New-AzCdnPurgeParametersObject', 'New-AzCdnResourceReferenceObject', 'New-AzCdnResponseBasedOriginErrorDetectionParametersObject', 'New-AzCdnUrlRedirectActionObject', 'New-AzCdnUrlRewriteActionObject', 'New-AzCdnUrlSigningActionObject', 'New-AzCdnUserManagedHttpsParametersObject', 'New-AzFrontDoorCdnCustomDomain', 'New-AzFrontDoorCdnCustomDomainTlsSettingParametersObject', 'New-AzFrontDoorCdnEndpoint', 'New-AzFrontDoorCdnMigrationParametersObject', 'New-AzFrontDoorCdnMigrationWebApplicationFirewallMappingObject', 'New-AzFrontDoorCdnOrigin', 'New-AzFrontDoorCdnOriginGroup', 'New-AzFrontDoorCdnOriginGroupHealthProbeSettingObject', 'New-AzFrontDoorCdnOriginGroupLoadBalancingSettingObject', 'New-AzFrontDoorCdnProfile', 'New-AzFrontDoorCdnProfileChangeSkuWafMappingObject', 'New-AzFrontDoorCdnProfileLogScrubbingObject', 'New-AzFrontDoorCdnProfileScrubbingRulesObject', 'New-AzFrontDoorCdnProfileUpgradeParametersObject', 'New-AzFrontDoorCdnPurgeParametersObject', 'New-AzFrontDoorCdnResourceReferenceObject', 'New-AzFrontDoorCdnRoute', 'New-AzFrontDoorCdnRule', 'New-AzFrontDoorCdnRuleClientPortConditionObject', 'New-AzFrontDoorCdnRuleCookiesConditionObject', 'New-AzFrontDoorCdnRuleHostNameConditionObject', 'New-AzFrontDoorCdnRuleHttpVersionConditionObject', 'New-AzFrontDoorCdnRuleIsDeviceConditionObject', 'New-AzFrontDoorCdnRulePostArgsConditionObject', 'New-AzFrontDoorCdnRuleQueryStringConditionObject', 'New-AzFrontDoorCdnRuleRemoteAddressConditionObject', 'New-AzFrontDoorCdnRuleRequestBodyConditionObject', 'New-AzFrontDoorCdnRuleRequestHeaderActionObject', 'New-AzFrontDoorCdnRuleRequestHeaderConditionObject', 'New-AzFrontDoorCdnRuleRequestMethodConditionObject', 'New-AzFrontDoorCdnRuleRequestSchemeConditionObject', 'New-AzFrontDoorCdnRuleRequestUriConditionObject', 'New-AzFrontDoorCdnRuleResponseHeaderActionObject', 'New-AzFrontDoorCdnRuleRouteConfigurationOverrideActionObject', 'New-AzFrontDoorCdnRuleServerPortConditionObject', 'New-AzFrontDoorCdnRuleSet', 'New-AzFrontDoorCdnRuleSocketAddrConditionObject', 'New-AzFrontDoorCdnRuleSslProtocolConditionObject', 'New-AzFrontDoorCdnRuleUrlFileExtensionConditionObject', 'New-AzFrontDoorCdnRuleUrlFileNameConditionObject', 'New-AzFrontDoorCdnRuleUrlPathConditionObject', 'New-AzFrontDoorCdnRuleUrlRedirectActionObject', 'New-AzFrontDoorCdnRuleUrlRewriteActionObject', 'New-AzFrontDoorCdnRuleUrlSigningActionObject', 'New-AzFrontDoorCdnSecret', 'New-AzFrontDoorCdnSecretCustomerCertificateParametersObject', 'New-AzFrontDoorCdnSecretFirstPartyManagedCertificateParametersObject', 'New-AzFrontDoorCdnSecretManagedCertificateParametersObject', 'New-AzFrontDoorCdnSecretUrlSigningKeyParametersObject', 'New-AzFrontDoorCdnSecurityPolicy', 'New-AzFrontDoorCdnSecurityPolicyWebApplicationFirewallAssociationObject', 'New-AzFrontDoorCdnSecurityPolicyWebApplicationFirewallParametersObject', 'Remove-AzCdnCustomDomain', 'Remove-AzCdnEndpoint', 'Remove-AzCdnOrigin', 'Remove-AzCdnOriginGroup', 'Remove-AzCdnProfile', 'Remove-AzFrontDoorCdnCustomDomain', 'Remove-AzFrontDoorCdnEndpoint', 'Remove-AzFrontDoorCdnOrigin', 'Remove-AzFrontDoorCdnOriginGroup', 'Remove-AzFrontDoorCdnProfile', 'Remove-AzFrontDoorCdnRoute', 'Remove-AzFrontDoorCdnRule', 'Remove-AzFrontDoorCdnRuleSet', 'Remove-AzFrontDoorCdnSecret', 'Remove-AzFrontDoorCdnSecurityPolicy', 'Start-AzCdnEndpoint', 'Start-AzFrontDoorCdnProfilePrepareMigration', 'Stop-AzCdnEndpoint', 'Stop-AzFrontDoorCdnProfileMigration', 'Test-AzCdnEndpointCustomDomain', 'Test-AzCdnNameAvailability', 'Test-AzCdnProbe', 'Test-AzFrontDoorCdnEndpointCustomDomain', 'Test-AzFrontDoorCdnEndpointNameAvailability', 'Test-AzFrontDoorCdnProfileHostNameAvailability', 'Test-AzFrontDoorCdnProfileMigration', 'Update-AzCdnEndpoint', 'Update-AzCdnOrigin', 'Update-AzCdnOriginGroup', 'Update-AzCdnProfile', 'Update-AzFrontDoorCdnCustomDomain', 'Update-AzFrontDoorCdnCustomDomainValidationToken', 'Update-AzFrontDoorCdnEndpoint', 'Update-AzFrontDoorCdnOrigin', 'Update-AzFrontDoorCdnOriginGroup', 'Update-AzFrontDoorCdnProfile', 'Update-AzFrontDoorCdnProfileSku', 'Update-AzFrontDoorCdnRoute', 'Update-AzFrontDoorCdnRule', 'Update-AzFrontDoorCdnSecurityPolicy', '*' AliasesToExport = '*' PrivateData = @{ PSData = @{ diff --git a/src/Cdn/Cdn.Autorest/README.md b/src/Cdn/Cdn.Autorest/README.md index 33e9db05de5f..36eec70a6dcf 100644 --- a/src/Cdn/Cdn.Autorest/README.md +++ b/src/Cdn/Cdn.Autorest/README.md @@ -107,10 +107,10 @@ directive: # CDN content - PurgeParameters - LoadParameters - # AFDX profile LogScrubbing - - ProfileLogScrubbing - - ProfileScrubbingRules - + + # AFDX profile LogScrubbing, need to rename the memory ojects, not sure how to rename a memory object currently. + # - ProfileLogScrubbing + # - ProfileScrubbingRules # Migration to AFDx # - MigrationParameters # - MigrationWebApplicationFirewallMapping diff --git a/src/Cdn/Cdn.Autorest/custom/New-AzFrontDoorCdnProfileLogScrubbingObject.ps1 b/src/Cdn/Cdn.Autorest/custom/New-AzFrontDoorCdnProfileLogScrubbingObject.ps1 new file mode 100644 index 000000000000..1848d795f9a8 --- /dev/null +++ b/src/Cdn/Cdn.Autorest/custom/New-AzFrontDoorCdnProfileLogScrubbingObject.ps1 @@ -0,0 +1,54 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for ProfileLogScrubbing. +.Description +Create an in-memory object for ProfileLogScrubbing. + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.Api20240201.ProfileLogScrubbing +.Link +https://learn.microsoft.com/powershell/module/Az.Cdn/new-AzFrontDoorCdnProfileLogScrubbingObject +#> +function New-AzFrontDoorCdnProfileLogScrubbingObject { + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.Api20240201.ProfileLogScrubbing')] + [CmdletBinding(PositionalBinding=$false)] + Param( + + [Parameter(HelpMessage="List of log scrubbing rules applied to the Azure Front Door profile logs.")] + [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.Api20240201.IProfileScrubbingRules[]] + $ScrubbingRule, + [Parameter(HelpMessage="State of the log scrubbing config. Default value is Enabled.")] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ProfileScrubbingState])] + [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ProfileScrubbingState] + $State + ) + + process { + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.Api20240201.ProfileLogScrubbing]::New() + + if ($PSBoundParameters.ContainsKey('ScrubbingRule')) { + $Object.ScrubbingRule = $ScrubbingRule + } + if ($PSBoundParameters.ContainsKey('State')) { + $Object.State = $State + } + return $Object + } +} + diff --git a/src/Cdn/Cdn.Autorest/custom/New-AzFrontDoorCdnProfileScrubbingRulesObject.ps1 b/src/Cdn/Cdn.Autorest/custom/New-AzFrontDoorCdnProfileScrubbingRulesObject.ps1 new file mode 100644 index 000000000000..a91c7aeeefa9 --- /dev/null +++ b/src/Cdn/Cdn.Autorest/custom/New-AzFrontDoorCdnProfileScrubbingRulesObject.ps1 @@ -0,0 +1,61 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for ProfileScrubbingRules. +.Description +Create an in-memory object for ProfileScrubbingRules. + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.Api20240201.ProfileScrubbingRules +.Link +https://learn.microsoft.com/powershell/module/Az.Cdn/new-AzFrontDoorCdnProfileScrubbingRulesObject +#> +function New-AzFrontDoorCdnProfileScrubbingRulesObject { + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.Api20240201.ProfileScrubbingRules')] + [CmdletBinding(PositionalBinding=$false)] + Param( + + [Parameter(Mandatory, HelpMessage="The variable to be scrubbed from the logs.")] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ScrubbingRuleEntryMatchVariable])] + [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ScrubbingRuleEntryMatchVariable] + $MatchVariable, + [Parameter(HelpMessage="When matchVariable is a collection, operator used to specify which elements in the collection this rule applies to.")] + [string] + $Selector, + [Parameter(HelpMessage="Defines the state of a log scrubbing rule. Default value is enabled.")] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ScrubbingRuleEntryState])] + [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Support.ScrubbingRuleEntryState] + $State + ) + + process { + $Object = [Microsoft.Azure.PowerShell.Cmdlets.Cdn.Models.Api20240201.ProfileScrubbingRules]::New() + + if ($PSBoundParameters.ContainsKey('MatchVariable')) { + $Object.MatchVariable = $MatchVariable + } + if ($PSBoundParameters.ContainsKey('Selector')) { + $Object.Selector = $Selector + } + if ($PSBoundParameters.ContainsKey('State')) { + $Object.State = $State + } + return $Object + } +} + diff --git a/src/Cdn/Cdn.Autorest/docs/Az.Cdn.md b/src/Cdn/Cdn.Autorest/docs/Az.Cdn.md index 8e82be72345b..e2121c29f1a8 100644 --- a/src/Cdn/Cdn.Autorest/docs/Az.Cdn.md +++ b/src/Cdn/Cdn.Autorest/docs/Az.Cdn.md @@ -187,12 +187,6 @@ Create an in-memory object for OriginGroupOverrideAction. ### [New-AzCdnProfile](New-AzCdnProfile.md) Creates an CDN profile with the specified profile name under the specified subscription and resource group. -### [New-AzCdnProfileLogScrubbingObject](New-AzCdnProfileLogScrubbingObject.md) -Create an in-memory object for ProfileLogScrubbing. - -### [New-AzCdnProfileScrubbingRulesObject](New-AzCdnProfileScrubbingRulesObject.md) -Create an in-memory object for ProfileScrubbingRules. - ### [New-AzCdnPurgeParametersObject](New-AzCdnPurgeParametersObject.md) Create an in-memory object for PurgeParameters. @@ -247,6 +241,12 @@ Creates a new Azure Front Door Standard or Azure Front Door Premium or CDN profi ### [New-AzFrontDoorCdnProfileChangeSkuWafMappingObject](New-AzFrontDoorCdnProfileChangeSkuWafMappingObject.md) Create an in-memory object for ProfileChangeSkuWafMapping. +### [New-AzFrontDoorCdnProfileLogScrubbingObject](New-AzFrontDoorCdnProfileLogScrubbingObject.md) +Create an in-memory object for ProfileLogScrubbing. + +### [New-AzFrontDoorCdnProfileScrubbingRulesObject](New-AzFrontDoorCdnProfileScrubbingRulesObject.md) +Create an in-memory object for ProfileScrubbingRules. + ### [New-AzFrontDoorCdnProfileUpgradeParametersObject](New-AzFrontDoorCdnProfileUpgradeParametersObject.md) Create an in-memory object for ProfileUpgradeParameters. diff --git a/src/Cdn/Cdn.Autorest/docs/New-AzCdnProfileLogScrubbingObject.md b/src/Cdn/Cdn.Autorest/docs/New-AzFrontDoorCdnProfileLogScrubbingObject.md similarity index 91% rename from src/Cdn/Cdn.Autorest/docs/New-AzCdnProfileLogScrubbingObject.md rename to src/Cdn/Cdn.Autorest/docs/New-AzFrontDoorCdnProfileLogScrubbingObject.md index e5cd4e8f906b..5e1c7297f48b 100644 --- a/src/Cdn/Cdn.Autorest/docs/New-AzCdnProfileLogScrubbingObject.md +++ b/src/Cdn/Cdn.Autorest/docs/New-AzFrontDoorCdnProfileLogScrubbingObject.md @@ -1,11 +1,11 @@ --- external help file: Module Name: Az.Cdn -online version: https://learn.microsoft.com/powershell/module/Az.Cdn/new-AzCdnProfileLogScrubbingObject +online version: https://learn.microsoft.com/powershell/module/Az.Cdn/new-AzFrontDoorCdnProfileLogScrubbingObject schema: 2.0.0 --- -# New-AzCdnProfileLogScrubbingObject +# New-AzFrontDoorCdnProfileLogScrubbingObject ## SYNOPSIS Create an in-memory object for ProfileLogScrubbing. @@ -13,7 +13,7 @@ Create an in-memory object for ProfileLogScrubbing. ## SYNTAX ``` -New-AzCdnProfileLogScrubbingObject [-ScrubbingRule ] +New-AzFrontDoorCdnProfileLogScrubbingObject [-ScrubbingRule ] [-State ] [] ``` diff --git a/src/Cdn/Cdn.Autorest/docs/New-AzCdnProfileScrubbingRulesObject.md b/src/Cdn/Cdn.Autorest/docs/New-AzFrontDoorCdnProfileScrubbingRulesObject.md similarity index 88% rename from src/Cdn/Cdn.Autorest/docs/New-AzCdnProfileScrubbingRulesObject.md rename to src/Cdn/Cdn.Autorest/docs/New-AzFrontDoorCdnProfileScrubbingRulesObject.md index 84769012a76b..ddba8fff4367 100644 --- a/src/Cdn/Cdn.Autorest/docs/New-AzCdnProfileScrubbingRulesObject.md +++ b/src/Cdn/Cdn.Autorest/docs/New-AzFrontDoorCdnProfileScrubbingRulesObject.md @@ -1,11 +1,11 @@ --- external help file: Module Name: Az.Cdn -online version: https://learn.microsoft.com/powershell/module/Az.Cdn/new-AzCdnProfileScrubbingRulesObject +online version: https://learn.microsoft.com/powershell/module/Az.Cdn/new-AzFrontDoorCdnProfileScrubbingRulesObject schema: 2.0.0 --- -# New-AzCdnProfileScrubbingRulesObject +# New-AzFrontDoorCdnProfileScrubbingRulesObject ## SYNOPSIS Create an in-memory object for ProfileScrubbingRules. @@ -13,8 +13,8 @@ Create an in-memory object for ProfileScrubbingRules. ## SYNTAX ``` -New-AzCdnProfileScrubbingRulesObject -MatchVariable [-Selector ] - [-State ] [] +New-AzFrontDoorCdnProfileScrubbingRulesObject -MatchVariable + [-Selector ] [-State ] [] ``` ## DESCRIPTION diff --git a/src/Cdn/Cdn.Autorest/examples/New-AzCdnProfileLogScrubbingObject.md b/src/Cdn/Cdn.Autorest/examples/New-AzFrontDoorCdnProfileLogScrubbingObject.md similarity index 100% rename from src/Cdn/Cdn.Autorest/examples/New-AzCdnProfileLogScrubbingObject.md rename to src/Cdn/Cdn.Autorest/examples/New-AzFrontDoorCdnProfileLogScrubbingObject.md diff --git a/src/Cdn/Cdn.Autorest/examples/New-AzCdnProfileScrubbingRulesObject.md b/src/Cdn/Cdn.Autorest/examples/New-AzFrontDoorCdnProfileScrubbingRulesObject.md similarity index 100% rename from src/Cdn/Cdn.Autorest/examples/New-AzCdnProfileScrubbingRulesObject.md rename to src/Cdn/Cdn.Autorest/examples/New-AzFrontDoorCdnProfileScrubbingRulesObject.md diff --git a/src/Cdn/Cdn.Autorest/test/New-AzFrontDoorCdnProfileLogScrubbingObject.Tests.ps1 b/src/Cdn/Cdn.Autorest/test/New-AzFrontDoorCdnProfileLogScrubbingObject.Tests.ps1 new file mode 100644 index 000000000000..59aee3bcebbe --- /dev/null +++ b/src/Cdn/Cdn.Autorest/test/New-AzFrontDoorCdnProfileLogScrubbingObject.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzFrontDoorCdnProfileLogScrubbingObject')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzFrontDoorCdnProfileLogScrubbingObject.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzFrontDoorCdnProfileLogScrubbingObject' { + It '__AllParameterSets' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/Cdn/Cdn.Autorest/test/New-AzFrontDoorCdnProfileScrubbingRulesObject.Tests.ps1 b/src/Cdn/Cdn.Autorest/test/New-AzFrontDoorCdnProfileScrubbingRulesObject.Tests.ps1 new file mode 100644 index 000000000000..9de8d8b7e684 --- /dev/null +++ b/src/Cdn/Cdn.Autorest/test/New-AzFrontDoorCdnProfileScrubbingRulesObject.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzFrontDoorCdnProfileScrubbingRulesObject')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzFrontDoorCdnProfileScrubbingRulesObject.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzFrontDoorCdnProfileScrubbingRulesObject' { + It '__AllParameterSets' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +}