diff --git a/.gitattributes b/.gitattributes
index 679d5721eae1..15a998ef3e62 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -9,3 +9,7 @@
*.psm1 text eol=crlf
*.ps1xml text eol=crlf
build.proj text eol=crlf
+
+generated/** linguist-generated
+generated/ linguist-generated
+*.cs linguist-generated
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 486ad1e55271..5576012057f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -242,4 +242,4 @@ src/DataFactory/DataFactoryV2.Test/SessionRecords/Microsoft.Azure.Commands.DataF
.venv
# Visual studio live unit testing config
-*.lutconfig
+*.lutconfig
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/.gitignore b/src/BotService copy/BotService.Autorest/.gitignore
new file mode 100644
index 000000000000..3fe20bec0f3a
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/.gitignore
@@ -0,0 +1 @@
+generated/
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/Az.BotService.csproj b/src/BotService copy/BotService.Autorest/Az.BotService.csproj
new file mode 100644
index 000000000000..f4bbf577d50c
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/Az.BotService.csproj
@@ -0,0 +1,10 @@
+
+
+ BotService
+ BotService
+
+
+
+
+
+
diff --git a/src/BotService copy/BotService.Autorest/Az.BotService.format.ps1xml b/src/BotService copy/BotService.Autorest/Az.BotService.format.ps1xml
new file mode 100644
index 000000000000..8a758f04befe
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/Az.BotService.format.ps1xml
@@ -0,0 +1,3211 @@
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotServiceIdentity
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.BotServiceIdentity
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ChannelName
+
+
+ ConnectionName
+
+
+ PrivateEndpointConnectionName
+
+
+ ResourceGroupName
+
+
+ ResourceName
+
+
+ SubscriptionId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.AlexaChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.AlexaChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.AlexaChannelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.AlexaChannelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AlexaSkillId
+
+
+ IsEnabled
+
+
+ ServiceEndpointUri
+
+
+ UrlFragment
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Kind
+
+
+ Location
+
+
+ Name
+
+
+ SkuName
+
+
+ SkuTier
+
+
+ Zone
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Kind
+
+
+ Location
+
+
+ Name
+
+
+ SkuName
+
+
+ SkuTier
+
+
+ Zone
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AppPasswordHint
+
+
+ CmekEncryptionStatus
+
+
+ CmekKeyVaultUrl
+
+
+ ConfiguredChannel
+
+
+ Description
+
+
+ DeveloperAppInsightKey
+
+
+ DeveloperAppInsightsApiKey
+
+
+ DeveloperAppInsightsApplicationId
+
+
+ DisableLocalAuth
+
+
+ DisplayName
+
+
+ EnabledChannel
+
+
+ Endpoint
+
+
+ EndpointVersion
+
+
+ IconUrl
+
+
+ IsCmekEnabled
+
+
+ IsDeveloperAppInsightsApiKeySet
+
+
+ IsStreamingSupported
+
+
+ LuisAppId
+
+
+ LuisKey
+
+
+ ManifestUrl
+
+
+ MigrationToken
+
+
+ MsaAppId
+
+
+ MsaAppMsiResourceId
+
+
+ MsaAppTenantId
+
+
+ MsaAppType
+
+
+ OpenWithHint
+
+
+ ProvisioningState
+
+
+ PublicNetworkAccess
+
+
+ PublishingCredentials
+
+
+ SchemaTransformationVersion
+
+
+ StorageResourceId
+
+
+ TenantId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesAllSettings
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesAllSettings
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesParameters
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotPropertiesParameters
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotResponseList
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotResponseList
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Channel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelResponseList
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelResponseList
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelSettings
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ChannelSettings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ BotIconUrl
+
+
+ BotId
+
+
+ ChannelDisplayName
+
+
+ ChannelId
+
+
+ DisableLocalAuth
+
+
+ ExtensionKey1
+
+
+ ExtensionKey2
+
+
+ IsEnabled
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CheckNameAvailabilityRequestBody
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CheckNameAvailabilityRequestBody
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CheckNameAvailabilityResponseBody
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CheckNameAvailabilityResponseBody
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Message
+
+
+ Valid
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionItemName
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionItemName
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Kind
+
+
+ Location
+
+
+ Name
+
+
+ SkuName
+
+
+ SkuTier
+
+
+ Zone
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingParameter
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingParameter
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Key
+
+
+ Value
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ClientId
+
+
+ ClientSecret
+
+
+ Name
+
+
+ ProvisioningState
+
+
+ Scope
+
+
+ ServiceProviderDisplayName
+
+
+ ServiceProviderId
+
+
+ SettingId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingResponseList
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingResponseList
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponse
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponse
+
+
+
+
+
+
+
+
+
+
+
+ Location
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponseProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CreateEmailSignInUrlResponseProperties
+
+
+
+
+
+
+
+
+
+
+
+ Url
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineChannelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineChannelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DirectLineEmbedCode
+
+
+ ExtensionKey1
+
+
+ ExtensionKey2
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSite
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSite
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AppId
+
+
+ ETag
+
+
+ IsBlockUserUploadEnabled
+
+
+ IsDetailedLoggingEnabled
+
+
+ IsEnabled
+
+
+ IsEndpointParametersEnabled
+
+
+ IsNoStorageEnabled
+
+
+ IsSecureSiteEnabled
+
+
+ IsTokenEnabled
+
+
+ IsV1Enabled
+
+
+ IsV3Enabled
+
+
+ IsWebchatPreviewEnabled
+
+
+ Key
+
+
+ Key2
+
+
+ Name
+
+
+ TrustedOrigin
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSpeechChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSpeechChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSpeechChannelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.DirectLineSpeechChannelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CognitiveServiceRegion
+
+
+ CognitiveServiceResourceId
+
+
+ CognitiveServiceSubscriptionKey
+
+
+ CustomSpeechModelId
+
+
+ CustomVoiceDeploymentId
+
+
+ IsDefaultBotForCogSvcAccount
+
+
+ IsEnabled
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.EmailChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.EmailChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.EmailChannelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.EmailChannelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AuthMethod
+
+
+ EmailAddress
+
+
+ IsEnabled
+
+
+ MagicCode
+
+
+ Password
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ErrorBody
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ErrorBody
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Message
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookChannelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookChannelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AppId
+
+
+ AppSecret
+
+
+ CallbackUrl
+
+
+ IsEnabled
+
+
+ VerifyToken
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookPage
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.FacebookPage
+
+
+
+
+
+
+
+
+
+
+
+ AccessToken
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.HostSettingsResponse
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.HostSettingsResponse
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ BotOpenIdMetadata
+
+
+ OAuthUrl
+
+
+ ToBotFromChannelOpenIdMetadataUrl
+
+
+ ToBotFromChannelTokenIssuer
+
+
+ ToBotFromEmulatorOpenIdMetadataUrl
+
+
+ ToChannelFromBotLoginUrl
+
+
+ ToChannelFromBotOAuthScope
+
+
+ ValidateAuthority
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.KikChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.KikChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.KikChannelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.KikChannelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ApiKey
+
+
+ IsEnabled
+
+
+ IsValidated
+
+
+ UserName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineChannelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineChannelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CallbackUrl
+
+
+ IsValidated
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineRegistration
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.LineRegistration
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ChannelAccessToken
+
+
+ ChannelSecret
+
+
+ GeneratedId
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ListChannelWithKeysResponse
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ListChannelWithKeysResponse
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ChannelName
+
+
+ Etag
+
+
+ Kind
+
+
+ Location
+
+
+ Name
+
+
+ PropertiesEtag
+
+
+ PropertiesLocation
+
+
+ PropertiesProvisioningState
+
+
+ SkuName
+
+
+ SkuTier
+
+
+ Zone
+
+
+ ChangedTime
+
+
+ EntityTag
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.MSTeamsChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.MSTeamsChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.MSTeamsChannelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.MSTeamsChannelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AcceptedTerm
+
+
+ CallingWebhook
+
+
+ DeploymentEnvironment
+
+
+ EnableCalling
+
+
+ IncomingCallRoute
+
+
+ IsEnabled
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationDisplayInfo
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationDisplayInfo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description
+
+
+ Operation
+
+
+ Provider
+
+
+ Resource
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationEntity
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationEntity
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Origin
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationEntityListResult
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationEntityListResult
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationResultsDescription
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OperationResultsDescription
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ StartTime
+
+
+ Status
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OutlookChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.OutlookChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnection
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnection
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateEndpointConnectionProperties
+
+
+
+
+
+
+
+
+
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResource
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResource
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceBase
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceBase
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkResourceProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ GroupId
+
+
+ RequiredMember
+
+
+ RequiredZoneName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkServiceConnectionState
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.PrivateLinkServiceConnectionState
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ActionsRequired
+
+
+ Description
+
+
+ Status
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.QnAMakerEndpointKeysRequestBody
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.QnAMakerEndpointKeysRequestBody
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Authkey
+
+
+ Hostname
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.QnAMakerEndpointKeysResponse
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.QnAMakerEndpointKeysResponse
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstalledVersion
+
+
+ LastStableVersion
+
+
+ PrimaryEndpointKey
+
+
+ SecondaryEndpointKey
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Resource
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Resource
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Kind
+
+
+ Location
+
+
+ Name
+
+
+ Zone
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTags
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ResourceTags
+
+
+
+
+
+
+
+
+
+
+
+ Item
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameter
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameter
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Default
+
+
+ Description
+
+
+ DisplayName
+
+
+ HelpUrl
+
+
+ Name
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadataConstraints
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderParameterMetadataConstraints
+
+
+
+
+
+
+
+
+
+
+
+ Required
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DevPortalUrl
+
+
+ DisplayName
+
+
+ IconUrl
+
+
+ ServiceProviderName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderResponseList
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderResponseList
+
+
+
+
+
+
+
+
+
+
+
+ NextLink
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Site
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Site
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AppId
+
+
+ ETag
+
+
+ IsBlockUserUploadEnabled
+
+
+ IsDetailedLoggingEnabled
+
+
+ IsEnabled
+
+
+ IsEndpointParametersEnabled
+
+
+ IsNoStorageEnabled
+
+
+ IsSecureSiteEnabled
+
+
+ IsTokenEnabled
+
+
+ IsV1Enabled
+
+
+ IsV3Enabled
+
+
+ IsWebchatPreviewEnabled
+
+
+ Key
+
+
+ Key2
+
+
+ Name
+
+
+ TrustedOrigin
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteInfo
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SiteInfo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Key
+
+
+ SiteName
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Sku
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Sku
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+
+
+ Tier
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkypeChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkypeChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkypeChannelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SkypeChannelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CallingWebHook
+
+
+ EnableCalling
+
+
+ EnableGroup
+
+
+ EnableMediaCard
+
+
+ EnableMessaging
+
+
+ EnableScreenSharing
+
+
+ EnableVideo
+
+
+ GroupsMode
+
+
+ IncomingCallRoute
+
+
+ IsEnabled
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SlackChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SlackChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SlackChannelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SlackChannelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ClientId
+
+
+ ClientSecret
+
+
+ IsEnabled
+
+
+ IsValidated
+
+
+ LandingPageUrl
+
+
+ LastSubmissionId
+
+
+ RedirectAction
+
+
+ RegisterBeforeOAuthFlow
+
+
+ Scope
+
+
+ SigningSecret
+
+
+ VerificationToken
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SmsChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SmsChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SmsChannelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.SmsChannelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AccountSid
+
+
+ AuthToken
+
+
+ IsEnabled
+
+
+ IsValidated
+
+
+ Phone
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.TelegramChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.TelegramChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.TelegramChannelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.TelegramChannelProperties
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AccessToken
+
+
+ IsEnabled
+
+
+ IsValidated
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatChannel
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatChannel
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Etag
+
+
+ Location
+
+
+ Name
+
+
+ ProvisioningState
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatChannelProperties
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatChannelProperties
+
+
+
+
+
+
+
+
+
+
+
+ WebChatEmbedCode
+
+
+
+
+
+
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatSite
+
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.WebChatSite
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ AppId
+
+
+ ETag
+
+
+ IsBlockUserUploadEnabled
+
+
+ IsDetailedLoggingEnabled
+
+
+ IsEnabled
+
+
+ IsEndpointParametersEnabled
+
+
+ IsNoStorageEnabled
+
+
+ IsSecureSiteEnabled
+
+
+ IsTokenEnabled
+
+
+ IsV1Enabled
+
+
+ IsV3Enabled
+
+
+ IsWebchatPreviewEnabled
+
+
+ Key
+
+
+ Key2
+
+
+ Name
+
+
+ TrustedOrigin
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/Az.BotService.psd1 b/src/BotService copy/BotService.Autorest/Az.BotService.psd1
new file mode 100644
index 000000000000..d5c80bb4989c
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/Az.BotService.psd1
@@ -0,0 +1,136 @@
+#
+# Module manifest for module 'Az.BotService'
+#
+# Generated by: Microsoft Corporation
+#
+# Generated on: 01/12/2022
+#
+
+@{
+
+# Script module or binary module file associated with this manifest.
+RootModule = './Az.BotService.psm1'
+
+# Version number of this module.
+ModuleVersion = '0.5.0'
+
+# Supported PSEditions
+CompatiblePSEditions = 'Core', 'Desktop'
+
+# ID used to uniquely identify this module
+GUID = '0fbff4fb-215b-4aca-b867-d1acfecab531'
+
+# Author of this module
+Author = 'Microsoft Corporation'
+
+# Company or vendor of this module
+CompanyName = 'Microsoft Corporation'
+
+# Copyright statement for this module
+Copyright = 'Microsoft Corporation. All rights reserved.'
+
+# Description of the functionality provided by this module
+Description = 'Microsoft Azure PowerShell: BotService cmdlets'
+
+# Minimum version of the PowerShell engine required by this module
+PowerShellVersion = '5.1'
+
+# Name of the PowerShell host required by this module
+# PowerShellHostName = ''
+
+# Minimum version of the PowerShell host required by this module
+# PowerShellHostVersion = ''
+
+# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
+DotNetFrameworkVersion = '4.7.2'
+
+# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
+# ClrVersion = ''
+
+# Processor architecture (None, X86, Amd64) required by this module
+# ProcessorArchitecture = ''
+
+# Modules that must be imported into the global environment prior to importing this module
+RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.10.4'; })
+
+# Assemblies that must be loaded prior to importing this module
+RequiredAssemblies = './bin/Az.BotService.private.dll'
+
+# Script files (.ps1) that are run in the caller's environment prior to importing this module.
+# ScriptsToProcess = @()
+
+# Type files (.ps1xml) to be loaded when importing this module
+# TypesToProcess = @()
+
+# Format files (.ps1xml) to be loaded when importing this module
+FormatsToProcess = './Az.BotService.format.ps1xml'
+
+# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
+# NestedModules = @()
+
+# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
+FunctionsToExport = 'Export-AzBotServiceApp', 'Get-AzBotService',
+ 'Get-AzBotServiceHostSetting',
+ 'Initialize-AzBotServicePrepareDeploy', 'New-AzBotService',
+ 'New-AzBotServiceDirectLineKey', 'Publish-AzBotServiceApp',
+ 'Remove-AzBotService', 'Update-AzBotService'
+
+# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
+CmdletsToExport = @()
+
+# Variables to export from this module
+# VariablesToExport = @()
+
+# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
+AliasesToExport = '*'
+
+# DSC resources to export from this module
+# DscResourcesToExport = @()
+
+# List of all modules packaged with this module
+# ModuleList = @()
+
+# List of all files packaged with this module
+# FileList = @()
+
+# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
+PrivateData = @{
+
+ PSData = @{
+
+ # Tags applied to this module. These help with module discovery in online galleries.
+ Tags = 'Azure','ResourceManager','ARM','PSModule','BotService'
+
+ # A URL to the license for this module.
+ LicenseUri = 'https://aka.ms/azps-license'
+
+ # A URL to the main website for this project.
+ ProjectUri = 'https://github.com/Azure/azure-powershell'
+
+ # A URL to an icon representing this module.
+ # IconUri = ''
+
+ # ReleaseNotes of this module
+ ReleaseNotes = '* Upgraded API version to 2022-06-15-preview.'
+
+ # Prerelease string of this module
+ # Prerelease = ''
+
+ # Flag to indicate whether the module requires explicit user acceptance for install/update/save
+ # RequireLicenseAcceptance = $false
+
+ # External dependent modules of this module
+ # ExternalModuleDependencies = @()
+
+ } # End of PSData hashtable
+
+ } # End of PrivateData hashtable
+
+# HelpInfo URI of this module
+# HelpInfoURI = ''
+
+# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
+# DefaultCommandPrefix = ''
+
+}
+
diff --git a/src/BotService copy/BotService.Autorest/Az.BotService.psm1 b/src/BotService copy/BotService.Autorest/Az.BotService.psm1
new file mode 100644
index 000000000000..04ed7ff75aef
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/Az.BotService.psm1
@@ -0,0 +1,115 @@
+# region Generated
+ # ----------------------------------------------------------------------------------
+ # 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.
+ # ----------------------------------------------------------------------------------
+ # Load required Az.Accounts module
+ $accountsName = 'Az.Accounts'
+ $accountsModule = Get-Module -Name $accountsName
+ if(-not $accountsModule) {
+ $localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
+ if(Test-Path -Path $localAccountsPath) {
+ $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
+ if($localAccounts) {
+ $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
+ }
+ }
+ if(-not $accountsModule) {
+ $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0
+ if($hasAdequateVersion) {
+ $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru
+ }
+ }
+ }
+
+ if(-not $accountsModule) {
+ Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://learn.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
+ } elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) {
+ Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
+ }
+ Write-Information "Loaded Module '$($accountsModule.Name)'"
+
+ # Load the private module dll
+ $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.BotService.private.dll')
+
+ # Get the private module's instance
+ $instance = [Microsoft.Azure.PowerShell.Cmdlets.BotService.Module]::Instance
+
+ # Ask for the shared functionality table
+ $VTable = Register-AzModule
+
+ # Tweaks the pipeline on module load
+ $instance.OnModuleLoad = $VTable.OnModuleLoad
+
+ # Following two delegates are added for telemetry
+ $instance.GetTelemetryId = $VTable.GetTelemetryId
+ $instance.Telemetry = $VTable.Telemetry
+
+
+ # Tweaks the pipeline per call
+ $instance.OnNewRequest = $VTable.OnNewRequest
+
+ # Gets shared parameter values
+ $instance.GetParameterValue = $VTable.GetParameterValue
+
+ # Allows shared module to listen to events from this module
+ $instance.EventListener = $VTable.EventListener
+
+ # Gets shared argument completers
+ $instance.ArgumentCompleter = $VTable.ArgumentCompleter
+
+ # The name of the currently selected Azure profile
+ $instance.ProfileName = $VTable.ProfileName
+
+
+ # Load the custom module
+ $customModulePath = Join-Path $PSScriptRoot './custom/Az.BotService.custom.psm1'
+ if(Test-Path $customModulePath) {
+ $null = Import-Module -Name $customModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export proxy cmdlet scripts
+ $exportsPath = Join-Path $PSScriptRoot './exports'
+ $directories = Get-ChildItem -Directory -Path $exportsPath
+ $profileDirectory = $null
+ if($instance.ProfileName) {
+ if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
+ $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
+ } else {
+ # Don't export anything if the profile doesn't exist for the module
+ $exportsPath = $null
+ Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
+ }
+ } elseif(($directories | Measure-Object).Count -gt 0) {
+ # Load the last folder if no profile is selected
+ $profileDirectory = $directories | Select-Object -Last 1
+ }
+
+ if($profileDirectory) {
+ Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
+ $exportsPath = $profileDirectory.FullName
+ }
+
+ if($exportsPath) {
+ Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
+ Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
+ }
+
+ # Finalize initialization of this module
+ $instance.Init();
+ Write-Information "Loaded Module '$($instance.Name)'"
+# endregion
diff --git a/src/BotService copy/BotService.Autorest/LiveTests/TestLiveScenarios.disabled.ps1 b/src/BotService copy/BotService.Autorest/LiveTests/TestLiveScenarios.disabled.ps1
new file mode 100644
index 000000000000..e65298e5e7f5
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/LiveTests/TestLiveScenarios.disabled.ps1
@@ -0,0 +1,71 @@
+Invoke-LiveTestScenario -Name "Create new registration bot service" -Description "Test creating a new registration bot service with all default values" -ScenarioScript `
+{
+ param ($rg)
+
+ $rgName = $rg.ResourceGroupName
+ $botName = New-LiveTestResourceName
+ $botLocation = "westus"
+ $WebApplication1 = "ae96ba8b-3711-4464-abc4-9aeec3531a87"
+
+ $actual = New-AzBotService -ResourceGroupName $rgName -Name $botName -ApplicationId $WebApplication1 -Location $botLocation -Sku F0 -Description "description" -Registration
+ Assert-AreEqual $botName $actual.Name
+ Assert-AreEqual $botLocation $actual.Location
+ Assert-AreEqual "F0" $actual.Sku.Name
+}
+
+Invoke-LiveTestScenario -Name "List bot service" -Description "Test listing bot services in a resourcegroup" -ScenarioScript `
+{
+ param ($rg)
+
+ $rgName = $rg.ResourceGroupName
+ $botName = New-LiveTestResourceName
+ $botLocation = "westus"
+ $WebApplication1 = "ae96ba8b-3711-4464-abc4-9aeec3531a87"
+
+ $null = New-AzBotService -ResourceGroupName $rgName -Name $botName -ApplicationId $WebApplication1 -Location $botLocation -Sku F0 -Description "description" -Registration
+ $actual = Get-AzBotService -ResourceGroupName $rgName
+ Assert-AreEqual 1 $actual.Count
+}
+
+Invoke-LiveTestScenario -Name "Get bot service" -Description "Test getting one specific bot service" -ScenarioScript `
+{
+ param ($rg)
+
+ $rgName = $rg.ResourceGroupName
+ $botName = New-LiveTestResourceName
+ $botLocation = "westus"
+ $WebApplication1 = "ae96ba8b-3711-4464-abc4-9aeec3531a87"
+
+ $null = New-AzBotService -ResourceGroupName $rgName -Name $botName -ApplicationId $WebApplication1 -Location $botLocation -Sku F0 -Description "description" -Registration
+ $actual = Get-AzBotService -ResourceGroupName $rgName -Name $botName
+ Assert-AreEqual $botName $actual.Name
+}
+
+Invoke-LiveTestScenario -Name "Update bot service" -Description "Test Updating one specific bot service" -ScenarioScript `
+{
+ param ($rg)
+
+ $rgName = $rg.ResourceGroupName
+ $botName = New-LiveTestResourceName
+ $botLocation = "westus"
+ $WebApplication1 = "ae96ba8b-3711-4464-abc4-9aeec3531a87"
+
+ $null = New-AzBotService -ResourceGroupName $rgName -Name $botName -ApplicationId $WebApplication1 -Location $botLocation -Sku F0 -Description "description" -Registration
+ $actual = Update-AzBotService -Name $botName -ResourceGroupName $rgName -Kind bot
+ Assert-AreEqual "bot" $actual.Kind
+}
+
+Invoke-LiveTestScenario -Name "Remove bot servcie" -Description "Test Removing a bot service" -ScenarioScript `
+{
+ param ($rg)
+
+ $rgName = $rg.ResourceGroupName
+ $botName = New-LiveTestResourceName
+ $botLocation = "westus"
+ $WebApplication1 = "ae96ba8b-3711-4464-abc4-9aeec3531a87"
+
+ $null = New-AzBotService -ResourceGroupName $rgName -Name $botName -ApplicationId $WebApplication1 -Location $botLocation -Sku F0 -Description "description" -Registration
+ Invoke-LiveTestCommand -Command "Remove-AzBotService -ResourceGroupName $rgName -Name $botName"
+ $GetServiceList = Get-AzBotService
+ Assert-False { $GetServiceList.Name -contains $botName}
+}
diff --git a/src/BotService copy/BotService.Autorest/README.md b/src/BotService copy/BotService.Autorest/README.md
new file mode 100644
index 000000000000..a86df48cfc1c
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/README.md
@@ -0,0 +1,156 @@
+
+# Az.BotService
+This directory contains the PowerShell module for the BotService service.
+
+---
+## Status
+[](https://www.powershellgallery.com/packages/Az.BotService/)
+
+## Info
+- Modifiable: yes
+- Generated: all
+- Committed: yes
+- Packaged: yes
+
+---
+## Detail
+This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
+
+## Module Requirements
+- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
+
+## Authentication
+AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
+
+## Development
+For information on how to develop for `Az.BotService`, see [how-to.md](how-to.md).
+
+
+region Generated
+# Az.BotService
+This directory contains the PowerShell module for the BotService service.
+
+---
+## Status
+[](https://www.powershellgallery.com/packages/Az.BotService/)
+
+## Info
+- Modifiable: yes
+- Generated: all
+- Committed: yes
+- Packaged: yes
+
+---
+## Detail
+This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
+
+## Module Requirements
+- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
+
+## Authentication
+AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
+
+## Development
+For information on how to develop for `Az.BotService`, see [how-to.md](how-to.md).
+
+
+---
+## Generation Requirements
+Use of the beta version of `autorest.powershell` generator requires the following:
+- [NodeJS LTS](https://nodejs.org) (10.15.x LTS preferred)
+ - **Note**: It *will not work* with Node < 10.x. Using 11.x builds may cause issues as they may introduce instability or breaking changes.
+> If you want an easy way to install and update Node, [NVS - Node Version Switcher](../nodejs/installing-via-nvs.md) or [NVM - Node Version Manager](../nodejs/installing-via-nvm.md) is recommended.
+- [AutoRest](https://aka.ms/autorest) v3 beta
`npm install -g autorest@beta`
+- PowerShell 6.0 or greater
+ - If you don't have it installed, you can use the cross-platform npm package
`npm install -g pwsh`
+- .NET Core SDK 2.0 or greater
+ - If you don't have it installed, you can use the cross-platform npm package
`npm install -g dotnet-sdk-2.2`
+## Run Generation
+In this directory, run AutoRest:
+> `autorest`
+---
+### AutoRest Configuration
+> see https://aka.ms/autorest
+``` yaml
+branch: 827a487dc10fb666baa2d2b261c9264ea710f1b4
+require:
+ - $(this-folder)/../readme.azure.noprofile.md
+input-file:
+ - $(repo)/specification/botservice/resource-manager/Microsoft.BotService/preview/2022-06-15-preview/botservice.json
+title: BotService
+module-version: 0.1.0
+identity-correction-for-post: true
+subject-prefix: 'BotService'
+directive:
+ - from: botservice.json
+ where: $.definitions.EmailChannelAuthMethod
+ transform: >-
+ return {
+ "type": "number",
+ "description": "Email channel auth method. 0 Password (Default); 1 Graph.",
+ "enum": [
+ 0,
+ 1
+ ]
+ }
+ - from: botservice.json
+ where: $.paths["/subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId}"]
+ transform: delete $["get"]
+ - where:
+ variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$|^RegenerateViaIdentity$|^RegenerateViaIdentityExpanded$
+ remove: true
+ - where:
+ subject: Bot
+ set:
+ subject: BotService
+ - where:
+ subject: BotService
+ verb: New
+ hide: true
+ - where:
+ subject: Channel|EnterpriseChannel|BotConnectionServiceProvider|BotConnection
+ remove: true
+ - where:
+ subject: BotCheckNameAvailability
+ hide: true
+ - where:
+ subject: BotService
+ parameter-name: ResourceName
+ set:
+ parameter-name: Name
+ alias: BotName
+ - where:
+ model-name: BotChannel
+ property-name: ProvisioningState
+ set:
+ property-name: PropertiesProvisioningState
+ - where:
+ subject: PrivateEndpointConnection
+ hide: true
+ - where:
+ verb: Get
+ subject: PrivateLinkResource
+ hide: true
+ - where:
+ subject: BotService
+ set:
+ subject-prefix: ''
+ - where:
+ verb: Get
+ subject: HostSetting
+ variant: GetViaIdentity
+ hide: true
+ - where:
+ verb: Get
+ subject: QnAMakerEndpointKey
+ hide: true
+ - where:
+ subject: BotCheckNameAvailability
+ set:
+ subject: CheckNameAvailability
+ - where:
+ verb: New
+ subject: DirectLineKey
+ variant: Regenerate
+ hide: true
+```
diff --git a/src/BotService copy/BotService.Autorest/UX/Microsoft.BotService/botServices.json b/src/BotService copy/BotService.Autorest/UX/Microsoft.BotService/botServices.json
new file mode 100644
index 000000000000..1cb4473b30d8
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/UX/Microsoft.BotService/botServices.json
@@ -0,0 +1,85 @@
+{
+ "resourceType": "botServices",
+ "apiVersion": "2022-06-15-preview",
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.botservice"
+ },
+ "commands": [
+ {
+ "name": "Get-AzBotService",
+ "description": "Returns a BotService specified by the parameters.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.botservice/get-azbotservice"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Returns a BotService specified by the parameters.",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.resourceName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Remove-AzBotService",
+ "description": "Deletes a Bot Service from the resource group.",
+ "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}",
+ "help": {
+ "learnMore": {
+ "url": "https://learn.microsoft.com/powershell/module/az.botservice/remove-azbotservice"
+ },
+ "parameterSets": [
+ {
+ "parameters": [
+ "-Name ",
+ "-ResourceGroupName ",
+ "[-SubscriptionId ]"
+ ]
+ }
+ ]
+ },
+ "examples": [
+ {
+ "description": "Deletes a Bot Service from the resource group. ",
+ "parameters": [
+ {
+ "name": "-Name",
+ "value": "[Path.resourceName]"
+ },
+ {
+ "name": "-ResourceGroupName",
+ "value": "[Path.resourceGroupName]"
+ },
+ {
+ "name": "-SubscriptionId",
+ "value": "[Path.subscriptionId]"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/BotService copy/BotService.Autorest/build-module.ps1 b/src/BotService copy/BotService.Autorest/build-module.ps1
new file mode 100644
index 000000000000..b47acc32062f
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/build-module.ps1
@@ -0,0 +1,161 @@
+# ----------------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs)
+$ErrorActionPreference = 'Stop'
+
+if($PSEdition -ne 'Core') {
+ Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.'
+}
+
+if(-not $Isolated -and -not $Debugger) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+
+ if($LastExitCode -ne 0) {
+ # Build failed. Don't attempt to run the module.
+ return
+ }
+
+ if($Test) {
+ . (Join-Path $PSScriptRoot 'test-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Tests failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Docs) {
+ . (Join-Path $PSScriptRoot 'generate-help.ps1')
+ if($LastExitCode -ne 0) {
+ # Docs generation failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ if($Pack) {
+ . (Join-Path $PSScriptRoot 'pack-module.ps1')
+ if($LastExitCode -ne 0) {
+ # Packing failed. Don't attempt to run the module.
+ return
+ }
+ }
+
+ $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1'
+ if($Code) {
+ . $runModulePath -Code
+ } elseif($Run) {
+ . $runModulePath
+ } else {
+ Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script."
+ }
+ return
+}
+
+$binFolder = Join-Path $PSScriptRoot 'bin'
+$objFolder = Join-Path $PSScriptRoot 'obj'
+
+if(-not $Debugger) {
+ Write-Host -ForegroundColor Green 'Cleaning build folders...'
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
+
+ if((Test-Path $binFolder) -or (Test-Path $objFolder)) {
+ Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?'
+ Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.'
+ }
+
+ Write-Host -ForegroundColor Green 'Compiling module...'
+ $buildConfig = 'Debug'
+ if($Release) {
+ $buildConfig = 'Release'
+ }
+ dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo
+ if($LastExitCode -ne 0) {
+ Write-Error 'Compilation failed.'
+ }
+
+ $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.BotService.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+
+# Load DLL to use build-time cmdlets
+$null = Import-Module -Name $dll
+
+$modulePaths = $dll
+$customPsm1 = Join-Path $PSScriptRoot 'custom\Az.BotService.custom.psm1'
+if(Test-Path $customPsm1) {
+ $modulePaths = @($dll, $customPsm1)
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(Test-Path $exportsFolder) {
+ $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $exportsFolder
+
+$internalFolder = Join-Path $PSScriptRoot 'internal'
+if(Test-Path $internalFolder) {
+ $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $internalFolder
+
+$psd1 = Join-Path $PSScriptRoot './Az.BotService.psd1'
+$guid = Get-ModuleGuid -Psd1Path $psd1
+$moduleName = 'Az.BotService'
+$examplesFolder = Join-Path $PSScriptRoot 'examples'
+$null = New-Item -ItemType Directory -Force -Path $examplesFolder
+
+Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
+$modelCmdlets = @()
+if ($modelCmdlets.Count -gt 0) {
+ . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
+ CreateModelCmdlet($modelCmdlets)
+}
+
+if($NoDocs) {
+ Write-Host -ForegroundColor Green 'Creating exports...'
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder
+} else {
+ Write-Host -ForegroundColor Green 'Creating exports and docs...'
+ $moduleDescription = 'Microsoft Azure PowerShell: BotService cmdlets'
+ $docsFolder = Join-Path $PSScriptRoot 'docs'
+ if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+ }
+ $null = New-Item -ItemType Directory -Force -Path $docsFolder
+ Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid
+}
+
+Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
+$formatPs1xml = Join-Path $PSScriptRoot './Az.BotService.format.ps1xml'
+Export-FormatPs1xml -FilePath $formatPs1xml
+
+Write-Host -ForegroundColor Green 'Creating psd1...'
+$customFolder = Join-Path $PSScriptRoot 'custom'
+Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid
+
+Write-Host -ForegroundColor Green 'Creating test stubs...'
+$testFolder = Join-Path $PSScriptRoot 'test'
+$null = New-Item -ItemType Directory -Force -Path $testFolder
+Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder
+
+Write-Host -ForegroundColor Green 'Creating example stubs...'
+Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
diff --git a/src/BotService copy/BotService.Autorest/check-dependencies.ps1 b/src/BotService copy/BotService.Autorest/check-dependencies.ps1
new file mode 100644
index 000000000000..c29591c7bfe1
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/check-dependencies.ps1
@@ -0,0 +1,65 @@
+# ----------------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources)
+$ErrorActionPreference = 'Stop'
+
+if(-not $Isolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+ & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+ return
+}
+
+function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
+ if($predicate) {
+ $module = Get-Module -ListAvailable -Name $moduleName
+ if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) {
+ $null = New-Item -ItemType Directory -Force -Path $path
+ Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
+ if ($requiredVersion) {
+ Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path
+ }elseif($versionMinimum) {
+ Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path
+ } else {
+ Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path
+ }
+ }
+ }
+}
+
+$ProgressPreference = 'SilentlyContinue'
+$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1
+
+$localModulesPath = Join-Path $PSScriptRoot 'generated\modules'
+if(Test-Path -Path $localModulesPath) {
+ $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
+}
+
+DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5'
+DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
+
+$tools = Join-Path $PSScriptRoot 'tools'
+$resourceDir = Join-Path $tools 'Resources'
+$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1'
+
+if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) {
+ Write-Host -ForegroundColor Green "Building local Resource module used for test..."
+ Set-Location $resourceDir
+ $null = autorest .\README.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources
+ $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/
+ Set-Location $HOME/.PSSharedModules/Resources
+ $null = .\build-module.ps1
+ Set-Location $PSScriptRoot
+}
diff --git a/src/BotService copy/BotService.Autorest/create-model-cmdlets.ps1 b/src/BotService copy/BotService.Autorest/create-model-cmdlets.ps1
new file mode 100644
index 000000000000..597258195f85
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/create-model-cmdlets.ps1
@@ -0,0 +1,179 @@
+# ----------------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------------
+
+function CreateModelCmdlet {
+
+ param([string[]]$Models)
+
+ if ($Models.Count -eq 0)
+ {
+ return
+ }
+
+ $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
+ $ModuleName = 'BotService'
+ $OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
+ $null = New-Item -ItemType Directory -Force -Path $OutputDir
+
+ $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
+ $Content = ''
+ $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 )
+ { $Content += get-content $_.fullname -raw
+ } }
+
+ $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content)
+ $Nodes = $Tree.ChildNodes().ChildNodes()
+ foreach ($Model in $Models)
+ {
+ $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$Model") }
+ if ($InterfaceNode.count -eq 0) {
+ continue
+ }
+ # through a queue, we iterate all the parent models.
+ $Queue = @($InterfaceNode)
+ $visited = @("I$Model")
+ $AllInterfaceNodes = @()
+ while ($Queue.count -ne 0)
+ {
+ $AllInterfaceNodes += $Queue[0]
+ # Baselist contains the direct parent models.
+ foreach ($parent in $Queue[0].BaseList.Types)
+ {
+ if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value)))
+ {
+ $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) })
+ $visited = [Array]$visited + $parent.Type.Right.Identifier.Value
+ }
+ }
+ $first, $Queue = $Queue
+ }
+
+ $Namespace = $InterfaceNode.Parent.Name
+ $ObjectType = $Model
+ $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
+ # remove duplicated module name
+ if ($ObjectType.StartsWith($ModuleName)) {
+ $ModulePrefix = ''
+ } else {
+ $ModulePrefix = $ModuleName
+ }
+ $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
+
+ $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string]
+ $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string]
+ foreach ($Node in $AllInterfaceNodes)
+ {
+ foreach ($Member in $Node.Members)
+ {
+ $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments
+ $Required = $false
+ $Description = ""
+ $Readonly = $False
+ foreach ($Argument in $Arguments)
+ {
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Required")
+ {
+ $Required = $Argument.Expression.Token.Value
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Description")
+ {
+ $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"')
+ }
+ if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly")
+ {
+ $Readonly = $Argument.Expression.Token.Value
+ }
+ }
+ if ($Readonly)
+ {
+ continue
+ }
+ $Identifier = $Member.Identifier.Value
+ $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1]
+ $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string]
+ if ($Required)
+ {
+ $ParameterDefinePropertyList.Add("Mandatory")
+ }
+ if ($Description -ne "")
+ {
+ $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"")
+ }
+ $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList)
+ # check whether completer is needed
+ $completer = '';
+ if($Type.Split('.').Split('.')[-2] -eq 'Support') {
+ # If Type is an array, need to strip []
+ $strippedType = $Type.Replace('[]', '')
+ $completer += "`n [ArgumentCompleter([${strippedType}])]"
+ }
+ $ParameterDefineScript = "
+ [Parameter($ParameterDefineProperty)]${completer}
+ [${Type}]
+ `$${Identifier}"
+ $ParameterDefineScriptList.Add($ParameterDefineScript)
+ $ParameterAssignScriptList.Add("
+ if (`$PSBoundParameters.ContainsKey('${Identifier}')) {
+ `$Object.${Identifier} = `$${Identifier}
+ }")
+ }
+ }
+ $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator ","
+ $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator ""
+
+ $Script = "
+# ----------------------------------------------------------------------------------
+# 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 ${ObjectType}.
+.Description
+Create an in-memory object for ${ObjectType}.
+
+.Outputs
+${ObjectTypeWithNamespace}
+.Link
+https://learn.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
+#>
+function New-Az${ModulePrefix}${ObjectType}Object {
+ [OutputType('${ObjectTypeWithNamespace}')]
+ [CmdletBinding(PositionalBinding=`$false)]
+ Param(
+${ParameterDefineScript}
+ )
+
+ process {
+ `$Object = [${ObjectTypeWithNamespace}]::New()
+${ParameterAssignScript}
+ return `$Object
+ }
+}
+"
+ Set-Content -Path $OutputPath -Value $Script
+ }
+}
diff --git a/src/BotService copy/BotService.Autorest/custom/Az.BotService.custom.psm1 b/src/BotService copy/BotService.Autorest/custom/Az.BotService.custom.psm1
new file mode 100644
index 000000000000..f5ec93aa9448
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/custom/Az.BotService.custom.psm1
@@ -0,0 +1,17 @@
+# region Generated
+ # Load the private module dll
+ $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.BotService.private.dll')
+
+ # Load the internal module
+ $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.BotService.internal.psm1'
+ if(Test-Path $internalModulePath) {
+ $null = Import-Module -Name $internalModulePath
+ }
+
+ # Export nothing to clear implicit exports
+ Export-ModuleMember
+
+ # Export script cmdlets
+ Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
+ Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias)
+# endregion
diff --git a/src/BotService copy/BotService.Autorest/custom/Export-AzBotServiceApp.ps1 b/src/BotService copy/BotService.Autorest/custom/Export-AzBotServiceApp.ps1
new file mode 100644
index 000000000000..fd8641832e9d
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/custom/Export-AzBotServiceApp.ps1
@@ -0,0 +1,226 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/export-azbotserviceapp
+#>
+function Export-AzBotServiceApp {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])]
+ [CmdletBinding(PositionalBinding=$false)]
+ param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Alias('BotName')]
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ ${SavePath},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+
+ process {
+ try {
+ $EnvPSBoundParameters = @{}
+ if ($PSBoundParameters.ContainsKey('Debug')) {
+ $EnvPSBoundParameters['Debug'] = $Debug
+ }
+ if ($PSBoundParameters.ContainsKey('HttpPipelineAppend')) {
+ $EnvPSBoundParameters['HttpPipelineAppend'] = $HttpPipelineAppend
+ }
+ if ($PSBoundParameters.ContainsKey('HttpPipelinePrepend')) {
+ $EnvPSBoundParameters['HttpPipelinePrepend'] = $HttpPipelinePrepend
+ }
+ if ($PSBoundParameters.ContainsKey('Proxy')) {
+ $EnvPSBoundParameters['Proxy'] = $Proxy
+ }
+ if ($PSBoundParameters.ContainsKey('ProxyCredential')) {
+ $EnvPSBoundParameters['ProxyCredential'] = $ProxyCredential
+ }
+ if ($PSBoundParameters.ContainsKey('ProxyUseDefaultCredentials')) {
+ $EnvPSBoundParameters['ProxyUseDefaultCredentials'] = $ProxyUseDefaultCredentials
+ }
+ $BotService = Get-AzBotService -ResourceGroupName $ResourceGroupName -Name $Name @EnvPSBoundParameters
+ if ('bot' -eq $BotService.Kind)
+ {
+ throw "Source download is not supported for registration only bots."
+ }
+ if (-not $PSBoundParameters.ContainsKey('SavePath'))
+ {
+ $SavePath = '.'
+ Write-Host 'Parameter $SavePath not provided, defaulting to current working directory.'
+ }
+ $SavePath = Resolve-Path -Path $SavePath
+ if (-not (Get-Item $SavePath) -is [System.IO.DirectoryInfo])
+ {
+ throw "SavePath is not a valid directory."
+ }
+ DownloadBotZip -ResourceGroupName $ResourceGroupName -Name $Name -SavePath $SavePath -EnvParameters $EnvPSBoundParameters
+
+ } catch {
+ throw
+ }
+ }
+}
+
+function DownloadBotZip
+{
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.DoNotExportAttribute()]
+ param(
+ [Parameter()]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+ [Parameter()]
+ [System.String]
+ # The name of the Bot resource.
+ ${Name},
+ [Parameter()]
+ [System.String]
+ # The path to save your bot.
+ ${SavePath},
+ [Parameter()]
+ [hashtable]
+ ${EnvParameters}
+ )
+ process {
+ $WebApp = Get-AzWebApp -ResourceGroupName $ResourceGroupName -Name $Name @EnvParameters
+ foreach ($HostNameSslState in $WebApp.HostNameSslStates)
+ {
+ if ('Repository' -eq $HostNameSslState.HostType)
+ {
+ $HostName = $HostNameSslState.Name
+ $ScmUrl = "https://$HostName"
+ $PublishingProfileInfo = [xml](Get-AzWebAppPublishingProfile -ResourceGroupName $ResourceGroupName -Name $Name @EnvParameters)
+ foreach ($publishProfile in $PublishingProfileInfo.publishData.publishProfile)
+ {
+ if ('MSDeploy' -eq $publishProfile.publishMethod)
+ {
+ $Username = $publishProfile.userName
+ $UserPWD = $publishProfile.userPWD
+ $JWT = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${Username}:${UserPWD}"))
+ $OctetHeader = @{'content-type' = 'application/octet-stream'; 'authorization' = "Basic $JWT"}
+ $NeedToPackSourceCode = $False
+ try {
+ $Response = Invoke-WebRequest -Method Get -Headers $OctetHeader -Uri "$ScmUrl/api/zip/site/clirepo/"
+
+ if (200 -ne $Response.StatusCode)
+ {
+ $NeedToPackSourceCode = $True
+ }
+ }
+ catch {
+ $NeedToPackSourceCode = $True
+ }
+ if ($NeedToPackSourceCode)
+ {
+ $Payload = @{
+ "command" = "PostDeployScripts\\prepareSrc.cmd $userPWD";
+ "dir" = "site\wwwroot"
+ }
+ $Body = ConvertTo-Json $Payload
+ $JsonHeader = @{'content-type' = 'application/json'; 'authorization' = "Basic $JWT"}
+ $PrepareSrcResponse = Invoke-WebRequest -Method Post -Headers $JsonHeader -Uri "$ScmUrl/api/command" -Body $Body
+ if (200 -ne $PrepareSrcResponse.StatusCode)
+ {
+ throw "Fail to pack the source code into bot-src.zip."
+ }
+ }
+ $DownloadPath = [System.IO.Path]::Combine($SavePath, $Name)
+ if (Test-Path -Path $DownloadPath)
+ {
+ throw "The path $DownloadPath already exists. Please delete this folder or specify an alternate path."
+ }
+ New-Item -Path $DownloadPath -ItemType Directory
+ $ZipPath = [System.IO.Path]::Combine($SavePath, 'download.zip')
+ $Response = Invoke-WebRequest -Method Get -Headers $OctetHeader -Uri "$ScmUrl/api/vfs/site/bot-src.zip" -OutFile $ZipPath
+ Expand-Archive -Path $ZipPath -DestinationPath $DownloadPath
+ Remove-Item -Path $ZipPath
+ return
+ }
+ }
+ throw "Cannot find web deploy profile for $Name."
+ }
+ }
+ throw 'Failed to retrieve Scm Uri'
+ }
+}
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/custom/Initialize-AzBotServicePrepareDeploy.ps1 b/src/BotService copy/BotService.Autorest/custom/Initialize-AzBotServicePrepareDeploy.ps1
new file mode 100644
index 000000000000..c8029096f9ad
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/custom/Initialize-AzBotServicePrepareDeploy.ps1
@@ -0,0 +1,154 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/initialize-azbotservicepreparedeploy
+#>
+function Initialize-AzBotServicePrepareDeploy {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])]
+ [CmdletBinding(PositionalBinding=$false)]
+ param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The path to prepare a resource.
+ ${CodeDir},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The project file name.
+ ${ProjFileName},
+
+ [Parameter()]
+ [ValidateNotNullOrEmpty()]
+ [ValidateSet('C#', 'JavaScript', 'TypeScript')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The language could be C#, JavaScript or TypeScript.
+ ${Language} = 'C#',
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+
+ process {
+ try {
+ if (!$CodeDir) {
+ $CodeDir = Resolve-Path -Path .
+ Write-Host "CodeDir not provided, defaulting to current working directory: $CodeDir."
+ }
+ if (-not (Test-Path -Path $CodeDir)) {
+ throw "Provided CodeDir value $CodeDir does not exist."
+ }
+ if (("JavaScript" -eq $Language) -or ("TypeScript" -eq $Language)) {
+ if ($PSBoundParameters.ContainsKey("ProjFileName")) {
+ throw "ProjectFilePath should not be passed in if language is not Csharp."
+ }
+ $DestWebConfig = [System.IO.Path]::Combine($CodeDir, 'web.config')
+ if (Test-Path -Path $DestWebConfig) {
+ throw "web.config is found in $CodeDir.Please delete it first."
+ }
+ if (-not (Test-Path -Path ([System.IO.Path]::Combine($CodePath, "package.json")))) {
+ Write-Warning "WARNING: This command should normally be run in the same folder as the package.json for Node.js bots. Package.json and web.config are usually in the same folder and at the root level of the .zip file."
+ }
+ if ("JavaScript" -eq $Language) {
+ $SourceWebConfig = [System.IO.Path]::Combine($PSScriptRoot, 'web.config')
+ }
+ else {
+ $SourceWebConfig = [System.IO.Path]::Combine($PSScriptRoot, 'typescript.web.config')
+ }
+ Copy-Item -Path $SourceWebConfig -Destination $DestWebConfig
+ }
+ else {
+ if (-not $PSBoundParameters.ContainsKey("ProjFileName")) {
+ throw "ProjectFilePath must be provided if language is Csharp."
+ }
+ if (-not $ProjFileName.EndsWith('.csproj')) {
+ $ProjFileName = "$ProjFileName.csproj"
+ }
+ $DestWebConfig = [System.IO.Path]::Combine($CodeDir, '.deployment')
+ if (Test-Path -Path $DestWebConfig) {
+ throw ".deployment is found in $CodeDir.Please delete it first."
+ }
+ $CsprojFile = [System.IO.Path]::Combine($CodeDir, $ProjFileName)
+ if (-not (Test-Path -Path $CsprojFile)) {
+ throw "$ProjFileName file not found.Please verify the relative path to the .csproj file from the $CodeDir"
+ }
+ $DeploymentContent = "[config]{0}SCM_SCRIPT_GENERATOR_ARGS=--aspNetCore '$ProjFileName{1}'" -f @([environment]::NewLine, [environment]::NewLine)
+ Set-Content -Path $DestWebConfig -Value $DeploymentContent
+ }
+ } catch {
+ throw
+ }
+ }
+}
+
diff --git a/src/BotService copy/BotService.Autorest/custom/New-AzBotService.ps1 b/src/BotService copy/BotService.Autorest/custom/New-AzBotService.ps1
new file mode 100644
index 000000000000..b67153a6eb25
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/custom/New-AzBotService.ps1
@@ -0,0 +1,297 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/new-azbotservice
+#>
+function New-AzBotService {
+ [OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])]
+ [CmdletBinding(PositionalBinding=$false)]
+ param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Alias('BotName')]
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${Name},
+
+ [Parameter(ParameterSetName='Registration')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # DisplayName can be different from the bot Name.
+ ${DisplayName},
+
+ [Parameter(ParameterSetName='Registration')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The bot's endpoint
+ ${Endpoint},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The description of the bot
+ ${Description},
+
+ [Parameter(ParameterSetName='Registration')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Switch]
+ # Default kind of a bot.
+ ${Registration},
+
+ [Parameter(ParameterSetName='WebApp')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Switch]
+ ${Webapp},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # Microsoft App Id for the bot
+ ${ApplicationId},
+
+ [Parameter(ParameterSetName='WebApp', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Security.SecureString]
+ # Microsoft App secret generated by the corresponding Add Id
+ ${ApplicationSecret},
+
+ [Parameter(ParameterSetName='WebApp')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # Provide this if required ServerFarm has been created.
+ ${ExistingServerFarmId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # Specifies the location of the resource.
+ ${Location} = 'global',
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # Specifies the location of the server farm.
+ ${ServerFarmLocation} = 'westeurope',
+
+
+ [Parameter(Mandatory)]
+ [ValidateNotNullOrEmpty()]
+ [ValidateSet('F0', 'S1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The sku name
+ ${Sku},
+
+ [Parameter()]
+ [ValidateNotNullOrEmpty()]
+ [ValidateSet('C#', 'JavaScript')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ ${Language} = 'C#',
+
+ [Parameter()]
+ [ValidateNotNullOrEmpty()]
+ [ValidateSet('echo')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ ${BotTemplateType} = 'echo',
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+ )
+
+ process {
+ try {
+ $EnvPSBoundParameters = @{}
+ if ($PSBoundParameters.ContainsKey('Debug')) {
+ $EnvPSBoundParameters['Debug'] = $Debug
+ }
+ if ($PSBoundParameters.ContainsKey('HttpPipelineAppend')) {
+ $EnvPSBoundParameters['HttpPipelineAppend'] = $HttpPipelineAppend
+ }
+ if ($PSBoundParameters.ContainsKey('HttpPipelinePrepend')) {
+ $EnvPSBoundParameters['HttpPipelinePrepend'] = $HttpPipelinePrepend
+ }
+ if ($PSBoundParameters.ContainsKey('Proxy')) {
+ $EnvPSBoundParameters['Proxy'] = $Proxy
+ }
+ if ($PSBoundParameters.ContainsKey('ProxyCredential')) {
+ $EnvPSBoundParameters['ProxyCredential'] = $ProxyCredential
+ }
+ if ($PSBoundParameters.ContainsKey('ProxyUseDefaultCredentials')) {
+ $EnvPSBoundParameters['ProxyUseDefaultCredentials'] = $ProxyUseDefaultCredentials
+ }
+ $BotKind = 'bot'
+ If (!$PSBoundParameters.ContainsKey('Webapp'))
+ {
+ $Kind = $BotKind
+ }
+ else
+ {
+ $Kind = 'sdk'
+ }
+ $NameAvailabilityResponse = Az.BotService.internal\Get-AzBotServiceCheckNameAvailability -Name $Name -Type $Kind @EnvPSBoundParameters
+ If (-not $NameAvailabilityResponse.valid)
+ {
+ Write-Error $NameAvailabilityResponse.Message
+ throw
+ }
+ if ($BotKind -eq $Kind)
+ {
+ if ($PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $EnvPSBoundParameters['SubscriptionId'] = [System.String]$SubscriptionId
+ }
+ if (-not $PSBoundParameters.ContainsKey('DisplayName'))
+ {
+ $DisplayName = $Name
+ }
+ return Az.BotService.internal\New-AzBotService -Location $Location -Sku $Sku -Kind $Kind -DisplayName $Name -MsaAppId $ApplicationId `
+ -ResourceGroupName $ResourceGroupName -Name $Name -Endpoint $Endpoint @EnvPSBoundParameters
+ }
+ else
+ {
+ $SiteName = $Name.Substring(0, [Math]::Min(40, $Name.Length)).Trim('-')
+ $ZipUrl = RetrieveBotTemplateLink -Language $Language -BotTemplateType $BotTemplateType
+ if ($PSBoundParameters.ContainsKey('ExistingServerFarmId'))
+ {
+ $ServerFarmId = $ExistingServerFarmId
+ $CreateServerFarm = $false
+ }
+ else
+ {
+ $ServerFarmId = "/subscriptions/$SubscriptionId/resourceGroups/$ResourceGroupName/providers/Microsoft.Web/serverfarms/$Name"
+ $CreateServerFarm = $true
+ }
+ $TemplateFile = [System.IO.Path]::Combine($PSScriptRoot, 'webappv4.template.json')
+ $AppSecret = . "$PSScriptRoot/../utils/Unprotect-SecureString.ps1" $ApplicationSecret
+ $Parameter = @{
+ 'location' = $Location;
+ 'kind' = $Kind;
+ 'sku' = $Sku;
+ 'siteName' = $SiteName;
+ 'appId' = $ApplicationId;
+ 'appSecret' = $AppSecret;
+ 'serverFarmId' = $ServerFarmId;
+ 'zipUrl' = $ZipUrl;
+ 'botEnv' = 'prod';
+ 'createServerFarm' = $CreateServerFarm;
+ 'serverFarmLocation' = $ServerFarmLocation;
+ 'botId' = $Name;
+ 'description' = $Description
+ }
+ $Null = New-AzResourceGroupDeployment -ResourceGroupName $ResourceGroupName -TemplateParameterObject $Parameter `
+ -TemplateFile $TemplateFile @EnvPSBoundParameters
+
+ return Get-AzBotService -ResourceGroupName $ResourceGroupName -Name $Name @EnvPSBoundParameters
+ }
+ } catch {
+ throw
+ }
+ }
+}
+
+function RetrieveBotTemplateLink
+{
+ [OutputType([System.String])]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.DoNotExportAttribute()]
+ param(
+ [Parameter()]
+ [System.String]
+ ${Language},
+ [Parameter()]
+ [System.String]
+ ${BotTemplateType}
+ )
+
+ process {
+ $Response = Invoke-WebRequest -Method Get -Uri 'https://dev.botframework.com/api/misc/bottemplateroot'
+ if (200 -ne $Response.StatusCode)
+ {
+ Write-Error "Unable to get bot code template from CDN. Please file an issue on https://github.com/microsoft/botframework-sdk."
+ throw
+ }
+ $CDNLink = $Response.Content.Replace('"', '')
+ if (('C#' -eq $Language) -and ('echo' -eq $BotTemplateType))
+ {
+ return $CDNLink + 'csharp-abs-webapp-v4_echobot_precompiled.zip'
+ } elseif (('Javascript' -eq $Language) -and ('echo' -eq $BotTemplateType))
+ {
+ return $CDNLink + 'node.js-abs-webapp-v4_echobot.zip'
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/custom/Publish-AzBotServiceApp.ps1 b/src/BotService copy/BotService.Autorest/custom/Publish-AzBotServiceApp.ps1
new file mode 100644
index 000000000000..a8772cca0bca
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/custom/Publish-AzBotServiceApp.ps1
@@ -0,0 +1,59 @@
+
+# ----------------------------------------------------------------------------------
+#
+# Copyright Microsoft Corporation
+# 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.
+# ----------------------------------------------------------------------------------
+
+<#
+.Synopsis
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/publish-azbotserviceapp
+#>
+function Publish-AzBotServiceApp {
+ [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
+ param(
+ [Parameter(Mandatory)]
+ [ValidateNotNull()]
+ [System.String]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [ValidateNotNull()]
+ [System.String]
+ # This parameter defines the name of the bot.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [ValidateNotNull()]
+ [System.String]
+ #This parameter defines the Path of the ZIP
+ ${CodeDir}
+ )
+
+ process {
+ try {
+ $ZipName = 'Template.Zip'
+ Compress-Archive $CodeDir $ZipName
+ Write-Host 'Completed ZIP'
+ Import-Module Az.WebSites
+ Publish-AzWebApp -ArchivePath $ZipName -ResourceGroupName $ResourceGroupName -Name $Name -Force
+ Remove-Item $ZipName
+ } catch {
+ throw
+ }
+ }
+}
+
diff --git a/src/BotService copy/BotService.Autorest/custom/README.md b/src/BotService copy/BotService.Autorest/custom/README.md
new file mode 100644
index 000000000000..a12e30c41550
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/custom/README.md
@@ -0,0 +1,41 @@
+# Custom
+This directory contains custom implementation for non-generated cmdlets for the `Az.BotService` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.BotService.custom.psm1`. This file should not be modified.
+
+## Info
+- Modifiable: yes
+- Generated: partial
+- Committed: yes
+- Packaged: yes
+
+## Details
+For `Az.BotService` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*.
+
+For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.BotService.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder.
+
+For script cmdlets, these are loaded via the `Az.BotService.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
+
+## Purpose
+This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.
+
+## Usage
+The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
+- Break
+- DefaultProfile
+- HttpPipelineAppend
+- HttpPipelinePrepend
+- Proxy
+- ProxyCredential
+- ProxyUseDefaultCredentials
+
+These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.BotService`. For C#, follow the usage seen in the `ProcessRecordAsync` method.
+
+### Attributes
+For processing the cmdlets, we've created some additional attributes:
+- `Microsoft.Azure.PowerShell.Cmdlets.BotService.DescriptionAttribute`
+ - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
+- `Microsoft.Azure.PowerShell.Cmdlets.BotService.DoNotExportAttribute`
+ - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.BotService`.
+- `Microsoft.Azure.PowerShell.Cmdlets.BotService.InternalExportAttribute`
+ - Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.BotService`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
+- `Microsoft.Azure.PowerShell.Cmdlets.BotService.ProfileAttribute`
+ - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/custom/typescript.web.config b/src/BotService copy/BotService.Autorest/custom/typescript.web.config
new file mode 100644
index 000000000000..12475de5b707
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/custom/typescript.web.config
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/custom/web.config b/src/BotService copy/BotService.Autorest/custom/web.config
new file mode 100644
index 000000000000..5d227c5fee45
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/custom/web.config
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/BotService copy/BotService.Autorest/custom/webappv4.template.json b/src/BotService copy/BotService.Autorest/custom/webappv4.template.json
new file mode 100644
index 000000000000..13e2e3960e86
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/custom/webappv4.template.json
@@ -0,0 +1,183 @@
+{
+ "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "parameters": {
+ "botEnv": {
+ "type": "string",
+ "defaultValue": "prod"
+ },
+ "botId": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string",
+ "defaultValue": ""
+ },
+ "location": {
+ "type": "string"
+ },
+ "sku": {
+ "type": "string"
+ },
+ "kind": {
+ "type": "string"
+ },
+ "siteName": {
+ "type": "string"
+ },
+ "appId": {
+ "type": "string",
+ "defaultValue": "1234"
+ },
+ "appSecret": {
+ "type": "string",
+ "defaultValue": "blank"
+ },
+ "zipUrl": {
+ "type": "string",
+ "defaultValue": ""
+ },
+ "serverFarmId": {
+ "type": "string"
+ },
+ "createServerFarm": {
+ "type": "bool"
+ },
+ "serverFarmLocation": {
+ "type": "string",
+ "defaultValue": ""
+ },
+ "serverFarmSku": {
+ "type": "object",
+ "defaultValue": {
+ "name": "S1",
+ "tier": "Standard",
+ "size": "S1",
+ "family": "S",
+ "capacity": 1
+ }
+ },
+ "endpoint": {
+ "type": "string",
+ "defaultValue": ""
+ },
+ "botFileEncryptionKey": {
+ "type": "string",
+ "defaultValue": ""
+ }
+ },
+ "variables": {
+ "serverFarmName": "[last(split(parameters('serverFarmId'), '/'))]",
+ "botAppKinds": {
+ "sdk": "app",
+ "bot": ""
+ },
+ "botAppKind": "[variables('botAppKinds')[parameters('kind')]]",
+ "siteHost": "[concat(parameters('siteName'), '.azurewebsites.net')]",
+ "botEndpointConfig": {
+ "bot": "[parameters('endpoint')]",
+ "sdk": "[concat('https://', variables('siteHost'), '/api/messages')]"
+ },
+ "botEndpoint": "[variables('botEndpointConfig')[parameters('kind')]]"
+ },
+ "resources": [
+ {
+ "type": "Microsoft.Web/serverfarms",
+ "condition": "[parameters('createServerFarm')]",
+ "name": "[variables('serverFarmName')]",
+ "apiVersion": "2016-09-01",
+ "location": "[parameters('serverFarmLocation')]",
+ "sku": "[parameters('serverFarmSku')]",
+ "properties": {
+ "name": "[variables('serverFarmName')]"
+ }
+ },
+ {
+ "name": "[parameters('siteName')]",
+ "type": "Microsoft.Web/sites",
+ "apiVersion": "2015-08-01",
+ "location": "[parameters('location')]",
+ "kind": "[variables('botAppKind')]",
+ "dependsOn": [
+ "[parameters('serverFarmId')]"
+ ],
+ "properties": {
+ "name": "[parameters('siteName')]",
+ "serverFarmId": "[parameters('serverFarmId')]",
+ "siteConfig": {
+ "appSettings": [
+ {
+ "name": "WEBSITE_NODE_DEFAULT_VERSION",
+ "value": "10.14.1"
+ },
+ {
+ "name": "MicrosoftAppId",
+ "value": "[parameters('appId')]"
+ },
+ {
+ "name": "MicrosoftAppPassword",
+ "value": "[parameters('appSecret')]"
+ }
+ ],
+ "cors": {
+ "allowedOrigins": [
+ "https://botservice.hosting.portal.azure.net",
+ "https://hosting.onecloud.azure-test.net/"
+ ]
+ }
+ }
+ },
+ "resources": [
+ {
+ "name": "MSDeploy",
+ "type": "Extensions",
+ "apiVersion": "2015-02-01",
+ "condition": "[not(equals(parameters('zipUrl'), ''))]",
+ "dependsOn": [
+ "[concat('Microsoft.Web/Sites/', parameters('siteName'))]"
+ ],
+ "properties": {
+ "packageUri": "[parameters('zipUrl')]",
+ "dbType": "None",
+ "connectionString": "",
+ "setParameters": {
+ "IIS Web Application Name": "[parameters('siteName')]"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "apiVersion": "2017-12-01",
+ "type": "Microsoft.BotService/botServices",
+ "name": "[parameters('botId')]",
+ "location": "global",
+ "kind": "[parameters('kind')]",
+ "sku": {
+ "name": "[parameters('sku')]"
+ },
+ "properties": {
+ "name": "[parameters('botId')]",
+ "displayName": "[parameters('botId')]",
+ "endpoint": "[variables('botEndpoint')]",
+ "msaAppId": "[parameters('appId')]",
+ "publishingCredentials": "[list(concat(resourceId('Microsoft.Web/Sites', parameters('siteName')), '/config/publishingcredentials'), '2018-02-01')]",
+ "allSettings": {
+ "WEBSITE_NODE_DEFAULT_VERSION": "10.14.1",
+ "SCM_DO_BUILD_DURING_DEPLOYMENT": "true",
+ "BotId": "[parameters('botId')]",
+ "MicrosoftAppId": "[parameters('appId')]",
+ "MicrosoftAppPassword": "[parameters('appSecret')]",
+ "botFilePath": "[concat('./', parameters('botId'), '.bot')]",
+ "botFileSecret": "[parameters('botFileEncryptionKey')]",
+ "description": "[parameters('description')]"
+ }
+ },
+ "dependsOn": [
+ "[parameters('serverFarmId')]",
+ "[resourceId('Microsoft.Web/sites/', parameters('siteName'))]",
+ "MSDeploy"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/examples/Export-AzBotServiceApp.md b/src/BotService copy/BotService.Autorest/examples/Export-AzBotServiceApp.md
new file mode 100644
index 000000000000..29fc0e6408f8
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/examples/Export-AzBotServiceApp.md
@@ -0,0 +1,15 @@
+### Example 1: Download the BotService App folder
+```powershell
+Export-AzBotServiceApp -ResourceGroupName youriBotTest -name youriechobottest
+```
+```output
+Parameter $SavePath not provided, defaulting to current working directory.
+
+ Directory: D:\powershell\BotService\azure-powershell\src\BotService
+
+Mode LastWriteTime Length Name
+---- ------------- ------ ----
+d---- 2020/12/15 1:45 PM youriechobottest
+```
+
+Download the BotService App folder
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/examples/Get-AzBotService.md b/src/BotService copy/BotService.Autorest/examples/Get-AzBotService.md
new file mode 100644
index 000000000000..ca20d73356a5
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/examples/Get-AzBotService.md
@@ -0,0 +1,55 @@
+### Example 1: List by subscription
+```powershell
+Get-AzBotService
+```
+
+```output
+Etag Kind Location Name SkuName SkuTier Zone
+---- ---- -------- ---- ------- ------- ----
+"4f003041-0000-1800-0000-6281fec80000" bot global botTest1 F0 {}
+"0d0018e1-0000-1800-0000-6371e9540000" bot global botTest2 F0 {}
+"05000ef7-0000-0200-0000-5fd7065a0000" sdk global botTest3 S1 {}
+"0600ef2b-0000-0200-0000-5fd727a70000" sdk global botTest4 S1 {}
+```
+
+Returns BotService resources belonging to current subscription.
+
+### Example 2: Get by Name and ResourceGroupName
+```powershell
+Get-AzBotService -Name botTest1 -ResourceGroupName botTest-rg
+```
+
+```output
+Etag Kind Location Name SkuName SkuTier Zone
+---- ---- -------- ---- ------- ------- ----
+"4f003041-0000-1800-0000-6281fec80000" bot global botTest1 F0 {}
+```
+
+Returns a BotService specified by Name and ResourceGroupName.
+
+### Example 3: GetViaIdentity
+```powershell
+Get-AzBotService -InputObject $botTest1
+```
+
+```output
+Etag Kind Location Name SkuName SkuTier Zone
+---- ---- -------- ---- ------- ------- ----
+"4f003041-0000-1800-0000-6281fec80000" bot global botTest1 F0 {}
+```
+
+Returns a BotService specified by the input IBotServiceIdentity.
+
+### Example 4: List by resource group
+```powershell
+Get-AzBotService -ResourceGroupName botTest-rg
+```
+
+```output
+Etag Kind Location Name SkuName SkuTier Zone
+---- ---- -------- ---- ------- ------- ----
+"4f003041-0000-1800-0000-6281fec80000" bot global botTest1 F0 {}
+"05000ef7-0000-0200-0000-5fd7065a0000" sdk global botTest3 S1 {}
+```
+
+Returns all the resources of a particular type belonging to a resource group.
diff --git a/src/BotService copy/BotService.Autorest/examples/Get-AzBotServiceHostSetting.md b/src/BotService copy/BotService.Autorest/examples/Get-AzBotServiceHostSetting.md
new file mode 100644
index 000000000000..0b7f95ce79a5
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/examples/Get-AzBotServiceHostSetting.md
@@ -0,0 +1,13 @@
+### Example 1: Get
+```powershell
+Get-AzBotServiceHostSetting
+```
+
+```output
+BotOpenIdMetadata OAuthUrl ToBotFromChannelOpenIdMetadataUrl ToBotFromChannelTokenIssuer ToBotFromEmulatorOpenIdMetadataUrl ToChannelFromBotLoginUrl ToChannelFromBotOAuthScope
+----------------- -------- --------------------------------- --------------------------- ---------------------------------- ------------------------ --------------------------
+```
+
+Get per subscription settings needed to host bot in compute resource such as Azure App Service
+
+
diff --git a/src/BotService copy/BotService.Autorest/examples/Initialize-AzBotServicePrepareDeploy.md b/src/BotService copy/BotService.Autorest/examples/Initialize-AzBotServicePrepareDeploy.md
new file mode 100644
index 000000000000..972902f36ec8
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/examples/Initialize-AzBotServicePrepareDeploy.md
@@ -0,0 +1,6 @@
+### Example 1: Initialize the Project FileFolder
+```powershell
+Initialize-AzBotServicePrepareDeploy -CodeDir D:\zips\MyEchoBot -ProjFileName MyEchoBot.csproj
+```
+
+Initialize Prepares a resource for use, and sets it to a default state
diff --git a/src/BotService copy/BotService.Autorest/examples/New-AzBotService.md b/src/BotService copy/BotService.Autorest/examples/New-AzBotService.md
new file mode 100644
index 000000000000..cba47bd9e364
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/examples/New-AzBotService.md
@@ -0,0 +1,23 @@
+### Example 1: Create a new bot
+```powershell
+New-AzBotService -resourcegroupname BotTest-rg -name BotTest1 -ApplicationId "af5fce4d-ee68-4b25-be09-f3222582e133" -Location global -Sku F0 -Description "123134" -Registration
+```
+```output
+Etag Kind Location Name SkuName SkuTier Zone
+---- ---- -------- ---- ------- ------- ----
+"060085fb-0000-1800-0000-5fd71d7c0000" bot global BotTest1 F0 {}
+```
+
+Create a new Bot by ResourceGroupName and ApplicationId
+
+### Example 2: Create a new Web App
+```powershell
+New-AzBotService -resourcegroupname BotTest-rg -name BotTest2 -ApplicationId "b1ab1727-0465-4255-a1bb-976210af972c" -Location global -Sku F0 -Description "123134" -Webapp
+```
+```output
+Etag Kind Location Name SkuName SkuTier Zone
+---- ---- -------- ---- ------- ------- ----
+"06008351-0000-0200-0000-5fd732870000" sdk global BotTest2 F0 {}
+```
+
+Create a new Web App by ResourceGroupName and ApplicationId
diff --git a/src/BotService copy/BotService.Autorest/examples/New-AzBotServiceDirectLineKey.md b/src/BotService copy/BotService.Autorest/examples/New-AzBotServiceDirectLineKey.md
new file mode 100644
index 000000000000..687a7228b232
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/examples/New-AzBotServiceDirectLineKey.md
@@ -0,0 +1,8 @@
+### Example 1: Regenerate directLine Key
+```powershell
+New-AzBotServiceDirectLineKey -ChannelName 'DirectLineChannel' -ResourceGroupName botTest-rg -ResourceName botTest1 -Key key1 -SiteName siteName
+```
+
+Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource.
+
+
diff --git a/src/BotService copy/BotService.Autorest/examples/Publish-AzBotServiceApp.md b/src/BotService copy/BotService.Autorest/examples/Publish-AzBotServiceApp.md
new file mode 100644
index 000000000000..375e7c410511
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/examples/Publish-AzBotServiceApp.md
@@ -0,0 +1,6 @@
+### Example 1: Publish your BotService to Azure
+```powershell
+Publish-AzBotServiceApp -ResourceGroupName youriBotTest -CodeDir D:\zips\MyEchoBot -Name youriechobottest
+```
+
+Publish your BotService to Azure by code
diff --git a/src/BotService copy/BotService.Autorest/examples/Remove-AzBotService.md b/src/BotService copy/BotService.Autorest/examples/Remove-AzBotService.md
new file mode 100644
index 000000000000..3005b0f94b41
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/examples/Remove-AzBotService.md
@@ -0,0 +1,13 @@
+### Example 1: Delete the BotService By Name and ResourceGroupName
+```powershell
+Remove-AzBotService -Name youri-bot -ResourceGroupName youriBotTest
+```
+
+Delete the BotService By Name and ResourceGroupName
+
+### Example 2: Delete the BotService By InputObject
+```powershell
+$getservice = Get-AzBotService -Name youriechobottest -ResourceGroupName youriBotTest
+Remove-AzBotService -InputObject $getservice
+```
+Delete the BotService By InputObject
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/examples/Update-AzBotService.md b/src/BotService copy/BotService.Autorest/examples/Update-AzBotService.md
new file mode 100644
index 000000000000..5560c0f84650
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/examples/Update-AzBotService.md
@@ -0,0 +1,25 @@
+### Example 1: Update the Bot by Name and ResourceGroupName
+```powershell
+Update-AzBotService -Name 'youri-apptest' -ResourceGroupName 'youriBotTest' -kind Bot
+```
+```output
+Etag Kind Location Name SkuName SkuTier Zone
+---- ---- -------- ---- ------- ------- ----
+"0700e71b-0000-1800-0000-5fd73ed80000" Bot global youri-apptest F0 {}
+```
+
+Update the Bot by Name and ResourceGroupName
+
+### Example 2: Update the Bot by InputObject
+```powershell
+$getAzbot = Get-AzBotService -Name 'youri-apptest' -ResourceGroupName 'youriBotTest'
+Update-AzBotService -InputObject $getAzbot -kind sdk
+```
+```output
+Etag Kind Location Name SkuName SkuTier Zone
+---- ---- -------- ---- ------- ------- ----
+"07008b1c-0000-1800-0000-5fd73f9e0000" sdk global youri-apptest F0 {}
+```
+
+Update the Bot by InputObject
+
diff --git a/src/BotService copy/BotService.Autorest/export-surface.ps1 b/src/BotService copy/BotService.Autorest/export-surface.ps1
new file mode 100644
index 000000000000..15f7fa1c7ea8
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/export-surface.ps1
@@ -0,0 +1,41 @@
+# ----------------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $Isolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+ return
+}
+
+$dll = Join-Path $PSScriptRoot 'bin\Az.BotService.private.dll'
+if(-not (Test-Path $dll)) {
+ Write-Error "Unable to find output assembly in '$binFolder'."
+}
+$null = Import-Module -Name $dll
+
+$moduleName = 'Az.BotService'
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+$resourcesFolder = Join-Path $PSScriptRoot 'resources'
+
+Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'"
+
+Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent
+Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'"
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/exports/Export-AzBotServiceApp.ps1 b/src/BotService copy/BotService.Autorest/exports/Export-AzBotServiceApp.ps1
new file mode 100644
index 000000000000..c210d0c93c47
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/exports/Export-AzBotServiceApp.ps1
@@ -0,0 +1,182 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Example
+Export-AzBotServiceApp -ResourceGroupName youriBotTest -name youriechobottest
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/export-azbotserviceapp
+#>
+function Export-AzBotServiceApp {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Alias('BotName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ ${SavePath},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ __AllParameterSets = 'Az.BotService.custom\Export-AzBotServiceApp';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/BotService copy/BotService.Autorest/exports/Get-AzBotService.ps1 b/src/BotService copy/BotService.Autorest/exports/Get-AzBotService.ps1
new file mode 100644
index 000000000000..db8e9d0397c8
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/exports/Get-AzBotService.ps1
@@ -0,0 +1,211 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Example
+Get-AzBotService
+.Example
+Get-AzBotService -Name botTest1 -ResourceGroupName botTest-rg
+.Example
+Get-AzBotService -InputObject $botTest1
+.Example
+Get-AzBotService -ResourceGroupName botTest-rg
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [ChannelName ]: The name of the Channel resource.
+ [ConnectionName ]: The name of the Bot Service Connection Setting resource.
+ [Id ]: Resource identity path
+ [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource
+ [ResourceGroupName ]: The name of the Bot resource group in the user subscription.
+ [ResourceName ]: The name of the Bot resource.
+ [SubscriptionId ]: Azure Subscription ID.
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/get-azbotservice
+#>
+function Get-AzBotService {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])]
+[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('BotName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.BotService.private\Get-AzBotService_Get';
+ GetViaIdentity = 'Az.BotService.private\Get-AzBotService_GetViaIdentity';
+ List = 'Az.BotService.private\Get-AzBotService_List';
+ List1 = 'Az.BotService.private\Get-AzBotService_List1';
+ }
+ if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/BotService copy/BotService.Autorest/exports/Get-AzBotServiceHostSetting.ps1 b/src/BotService copy/BotService.Autorest/exports/Get-AzBotServiceHostSetting.ps1
new file mode 100644
index 000000000000..5944e9858563
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/exports/Get-AzBotServiceHostSetting.ps1
@@ -0,0 +1,164 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Get per subscription settings needed to host bot in compute resource such as Azure App Service
+.Description
+Get per subscription settings needed to host bot in compute resource such as Azure App Service
+.Example
+Get-AzBotServiceHostSetting
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/get-azbotservicehostsetting
+#>
+function Get-AzBotServiceHostSetting {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse])]
+[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.BotService.private\Get-AzBotServiceHostSetting_Get';
+ }
+ if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/BotService copy/BotService.Autorest/exports/Initialize-AzBotServicePrepareDeploy.ps1 b/src/BotService copy/BotService.Autorest/exports/Initialize-AzBotServicePrepareDeploy.ps1
new file mode 100644
index 000000000000..b34bece164d8
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/exports/Initialize-AzBotServicePrepareDeploy.ps1
@@ -0,0 +1,182 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Example
+Initialize-AzBotServicePrepareDeploy -CodeDir D:\zips\MyEchoBot -ProjFileName MyEchoBot.csproj
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/initialize-azbotservicepreparedeploy
+#>
+function Initialize-AzBotServicePrepareDeploy {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The path to prepare a resource.
+ ${CodeDir},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The project file name.
+ ${ProjFileName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The language could be C#, JavaScript or TypeScript.
+ ${Language},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ __AllParameterSets = 'Az.BotService.custom\Initialize-AzBotServicePrepareDeploy';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/BotService copy/BotService.Autorest/exports/New-AzBotService.ps1 b/src/BotService copy/BotService.Autorest/exports/New-AzBotService.ps1
new file mode 100644
index 000000000000..0542290d29b1
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/exports/New-AzBotService.ps1
@@ -0,0 +1,255 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Example
+New-AzBotService -resourcegroupname BotTest-rg -name BotTest1 -ApplicationId "af5fce4d-ee68-4b25-be09-f3222582e133" -Location global -Sku F0 -Description "123134" -Registration
+.Example
+New-AzBotService -resourcegroupname BotTest-rg -name BotTest2 -ApplicationId "b1ab1727-0465-4255-a1bb-976210af972c" -Location global -Sku F0 -Description "123134" -Webapp
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/new-azbotservice
+#>
+function New-AzBotService {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])]
+[CmdletBinding(DefaultParameterSetName='Registration', PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # Microsoft App Id for the bot
+ ${ApplicationId},
+
+ [Parameter()]
+ [Alias('BotName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${Name},
+
+ [Parameter(ParameterSetName='Registration')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # DisplayName can be different from the bot Name.
+ ${DisplayName},
+
+ [Parameter(ParameterSetName='Registration')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The bot's endpoint
+ ${Endpoint},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The description of the bot
+ ${Description},
+
+ [Parameter(ParameterSetName='Registration')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.Management.Automation.SwitchParameter]
+ # Default kind of a bot.
+ ${Registration},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # Specifies the location of the resource.
+ ${Location},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # Specifies the location of the server farm.
+ ${ServerFarmLocation},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ ${Language},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ ${BotTemplateType},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='WebApp', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.Security.SecureString]
+ # Microsoft App secret generated by the corresponding Add Id
+ ${ApplicationSecret},
+
+ [Parameter(ParameterSetName='WebApp')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.Management.Automation.SwitchParameter]
+ ${Webapp},
+
+ [Parameter(ParameterSetName='WebApp')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # Provide this if required ServerFarm has been created.
+ ${ExistingServerFarmId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The sku name
+ ${Sku},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Registration = 'Az.BotService.custom\New-AzBotService';
+ WebApp = 'Az.BotService.custom\New-AzBotService';
+ }
+ if (('Registration', 'WebApp') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/BotService copy/BotService.Autorest/exports/New-AzBotServiceDirectLineKey.ps1 b/src/BotService copy/BotService.Autorest/exports/New-AzBotServiceDirectLineKey.ps1
new file mode 100644
index 000000000000..d7f6b9ea1e26
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/exports/New-AzBotServiceDirectLineKey.ps1
@@ -0,0 +1,196 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource
+.Description
+Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource
+.Example
+New-AzBotServiceDirectLineKey -ChannelName 'DirectLineChannel' -ResourceGroupName botTest-rg -ResourceName botTest1 -Key key1 -SiteName siteName
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/new-azbotservicedirectlinekey
+#>
+function New-AzBotServiceDirectLineKey {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel])]
+[CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName])]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName]
+ # The name of the Channel resource for which keys are to be regenerated.
+ ${ChannelName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${ResourceName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key])]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key]
+ # Determines which key is to be regenerated
+ ${Key},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The site name
+ ${SiteName},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ RegenerateExpanded = 'Az.BotService.private\New-AzBotServiceDirectLineKey_RegenerateExpanded';
+ }
+ if (('RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/BotService copy/BotService.Autorest/exports/ProxyCmdletDefinitions.ps1 b/src/BotService copy/BotService.Autorest/exports/ProxyCmdletDefinitions.ps1
new file mode 100644
index 000000000000..23c121eb007e
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/exports/ProxyCmdletDefinitions.ps1
@@ -0,0 +1,1810 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Get per subscription settings needed to host bot in compute resource such as Azure App Service
+.Description
+Get per subscription settings needed to host bot in compute resource such as Azure App Service
+.Example
+Get-AzBotServiceHostSetting
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/get-azbotservicehostsetting
+#>
+function Get-AzBotServiceHostSetting {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IHostSettingsResponse])]
+[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.BotService.private\Get-AzBotServiceHostSetting_Get';
+ }
+ if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Example
+Get-AzBotService
+.Example
+Get-AzBotService -Name botTest1 -ResourceGroupName botTest-rg
+.Example
+Get-AzBotService -InputObject $botTest1
+.Example
+Get-AzBotService -ResourceGroupName botTest-rg
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [ChannelName ]: The name of the Channel resource.
+ [ConnectionName ]: The name of the Bot Service Connection Setting resource.
+ [Id ]: Resource identity path
+ [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource
+ [ResourceGroupName ]: The name of the Bot resource group in the user subscription.
+ [ResourceName ]: The name of the Bot resource.
+ [SubscriptionId ]: Azure Subscription ID.
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/get-azbotservice
+#>
+function Get-AzBotService {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])]
+[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)]
+param(
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Alias('BotName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${Name},
+
+ [Parameter(ParameterSetName='Get', Mandatory)]
+ [Parameter(ParameterSetName='List', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Get')]
+ [Parameter(ParameterSetName='List')]
+ [Parameter(ParameterSetName='List1')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Get = 'Az.BotService.private\Get-AzBotService_Get';
+ GetViaIdentity = 'Az.BotService.private\Get-AzBotService_GetViaIdentity';
+ List = 'Az.BotService.private\Get-AzBotService_List';
+ List1 = 'Az.BotService.private\Get-AzBotService_List1';
+ }
+ if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource
+.Description
+Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource
+.Example
+New-AzBotServiceDirectLineKey -ChannelName 'DirectLineChannel' -ResourceGroupName botTest-rg -ResourceName botTest1 -Key key1 -SiteName siteName
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/new-azbotservicedirectlinekey
+#>
+function New-AzBotServiceDirectLineKey {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel])]
+[CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName])]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.RegenerateKeysChannelName]
+ # The name of the Channel resource for which keys are to be regenerated.
+ ${ChannelName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${ResourceName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(Mandatory)]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key])]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Key]
+ # Determines which key is to be regenerated
+ ${Key},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The site name
+ ${SiteName},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ RegenerateExpanded = 'Az.BotService.private\New-AzBotServiceDirectLineKey_RegenerateExpanded';
+ }
+ if (('RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Deletes a Bot Service from the resource group.
+.Description
+Deletes a Bot Service from the resource group.
+.Example
+Remove-AzBotService -Name youri-bot -ResourceGroupName youriBotTest
+.Example
+$getservice = Get-AzBotService -Name youriechobottest -ResourceGroupName youriBotTest
+Remove-AzBotService -InputObject $getservice
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [ChannelName ]: The name of the Channel resource.
+ [ConnectionName ]: The name of the Bot Service Connection Setting resource.
+ [Id ]: Resource identity path
+ [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource
+ [ResourceGroupName ]: The name of the Bot resource group in the user subscription.
+ [ResourceName ]: The name of the Bot resource.
+ [SubscriptionId ]: Azure Subscription ID.
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/remove-azbotservice
+#>
+function Remove-AzBotService {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Alias('BotName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${Name},
+
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Delete')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Delete = 'Az.BotService.private\Remove-AzBotService_Delete';
+ DeleteViaIdentity = 'Az.BotService.private\Remove-AzBotService_DeleteViaIdentity';
+ }
+ if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Updates a Bot Service
+.Description
+Updates a Bot Service
+.Example
+Update-AzBotService -Name 'youri-apptest' -ResourceGroupName 'youriBotTest' -kind Bot
+.Example
+$getAzbot = Get-AzBotService -Name 'youri-apptest' -ResourceGroupName 'youriBotTest'
+Update-AzBotService -InputObject $getAzbot -kind sdk
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [ChannelName ]: The name of the Channel resource.
+ [ConnectionName ]: The name of the Bot Service Connection Setting resource.
+ [Id ]: Resource identity path
+ [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource
+ [ResourceGroupName ]: The name of the Bot resource group in the user subscription.
+ [ResourceName ]: The name of the Bot resource.
+ [SubscriptionId ]: Azure Subscription ID.
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/update-azbotservice
+#>
+function Update-AzBotService {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('BotName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${Name},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings]))]
+ [System.Collections.Hashtable]
+ # Contains resource all settings defined as key/value pairs.
+ ${AllSetting},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The hint (e.g.
+ # keyVault secret resourceId) on how to fetch the app secret
+ ${AppPasswordHint},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The CMK Url
+ ${CmekKeyVaultUrl},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The description of the bot
+ ${Description},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The Application Insights key
+ ${DeveloperAppInsightKey},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The Application Insights Api Key
+ ${DeveloperAppInsightsApiKey},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The Application Insights App Id
+ ${DeveloperAppInsightsApplicationId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication.
+ ${DisableLocalAuth},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The Name of the bot
+ ${DisplayName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The bot's endpoint
+ ${Endpoint},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # Entity Tag
+ ${Etag},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The Icon Url of the bot
+ ${IconUrl},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Whether Cmek is enabled
+ ${IsCmekEnabled},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Whether the bot is streaming supported
+ ${IsStreamingSupported},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind])]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind]
+ # Required.
+ # Gets or sets the Kind of the resource.
+ ${Kind},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # Specifies the location of the resource.
+ ${Location},
+
+ [Parameter()]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String[]]
+ # Collection of LUIS App Ids
+ ${LuisAppId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The LUIS Key
+ ${LuisKey},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The bot's manifest url
+ ${ManifestUrl},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # Microsoft App Id for the bot
+ ${MsaAppId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # Microsoft App Managed Identity Resource Id for the bot
+ ${MsaAppMsiResourceId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # Microsoft App Tenant Id for the bot
+ ${MsaAppTenantId},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType])]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType]
+ # Microsoft App Type for the bot
+ ${MsaAppType},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The hint to browser (e.g.
+ # protocol handler) on how to open the bot for authoring
+ ${OpenWithHint},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters]))]
+ [System.Collections.Hashtable]
+ # Contains resource parameters defined as key/value pairs.
+ ${Parameter},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess])]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess]
+ # Whether the bot is in an isolated network
+ ${PublicNetworkAccess},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # Publishing credentials of the resource
+ ${PublishingCredentials},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The channel schema transformation version for the bot
+ ${SchemaTransformationVersion},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName])]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName]
+ # The sku name
+ ${SkuName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The storage resourceId for the bot
+ ${StorageResourceId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags]))]
+ [System.Collections.Hashtable]
+ # Contains resource tags defined as key/value pairs.
+ ${Tag},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The Tenant Id for the bot
+ ${TenantId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ UpdateExpanded = 'Az.BotService.private\Update-AzBotService_UpdateExpanded';
+ UpdateViaIdentityExpanded = 'Az.BotService.private\Update-AzBotService_UpdateViaIdentityExpanded';
+ }
+ if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Example
+Export-AzBotServiceApp -ResourceGroupName youriBotTest -name youriechobottest
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/export-azbotserviceapp
+#>
+function Export-AzBotServiceApp {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Parameter()]
+ [Alias('BotName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${Name},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ ${SavePath},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ __AllParameterSets = 'Az.BotService.custom\Export-AzBotServiceApp';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Example
+Initialize-AzBotServicePrepareDeploy -CodeDir D:\zips\MyEchoBot -ProjFileName MyEchoBot.csproj
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/initialize-azbotservicepreparedeploy
+#>
+function Initialize-AzBotServicePrepareDeploy {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])]
+[CmdletBinding(PositionalBinding=$false)]
+param(
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The path to prepare a resource.
+ ${CodeDir},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The project file name.
+ ${ProjFileName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The language could be C#, JavaScript or TypeScript.
+ ${Language},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ __AllParameterSets = 'Az.BotService.custom\Initialize-AzBotServicePrepareDeploy';
+ }
+ if (('__AllParameterSets') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Example
+New-AzBotService -resourcegroupname BotTest-rg -name BotTest1 -ApplicationId "af5fce4d-ee68-4b25-be09-f3222582e133" -Location global -Sku F0 -Description "123134" -Registration
+.Example
+New-AzBotService -resourcegroupname BotTest-rg -name BotTest2 -ApplicationId "b1ab1727-0465-4255-a1bb-976210af972c" -Location global -Sku F0 -Description "123134" -Webapp
+
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/new-azbotservice
+#>
+function New-AzBotService {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])]
+[CmdletBinding(DefaultParameterSetName='Registration', PositionalBinding=$false)]
+param(
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # Microsoft App Id for the bot
+ ${ApplicationId},
+
+ [Parameter()]
+ [Alias('BotName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${Name},
+
+ [Parameter(ParameterSetName='Registration')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # DisplayName can be different from the bot Name.
+ ${DisplayName},
+
+ [Parameter(ParameterSetName='Registration')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The bot's endpoint
+ ${Endpoint},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The description of the bot
+ ${Description},
+
+ [Parameter(ParameterSetName='Registration')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.Management.Automation.SwitchParameter]
+ # Default kind of a bot.
+ ${Registration},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # Specifies the location of the resource.
+ ${Location},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # Specifies the location of the server farm.
+ ${ServerFarmLocation},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ ${Language},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ ${BotTemplateType},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String[]]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='WebApp', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.Security.SecureString]
+ # Microsoft App secret generated by the corresponding Add Id
+ ${ApplicationSecret},
+
+ [Parameter(ParameterSetName='WebApp')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.Management.Automation.SwitchParameter]
+ ${Webapp},
+
+ [Parameter(ParameterSetName='WebApp')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # Provide this if required ServerFarm has been created.
+ ${ExistingServerFarmId},
+
+ [Parameter(Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The sku name
+ ${Sku},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Registration = 'Az.BotService.custom\New-AzBotService';
+ WebApp = 'Az.BotService.custom\New-AzBotService';
+ }
+ if (('Registration', 'WebApp') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
+
+<#
+.Synopsis
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Example
+Publish-AzBotServiceApp -ResourceGroupName youriBotTest -CodeDir D:\zips\MyEchoBot -Name youriechobottest
+
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/publish-azbotserviceapp
+#>
+function Publish-AzBotServiceApp {
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # This parameter defines the name of the bot.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # This parameter defines the Path of the ZIP
+ ${CodeDir}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ __AllParameterSets = 'Az.BotService.custom\Publish-AzBotServiceApp';
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/BotService copy/BotService.Autorest/exports/Publish-AzBotServiceApp.ps1 b/src/BotService copy/BotService.Autorest/exports/Publish-AzBotServiceApp.ps1
new file mode 100644
index 000000000000..083c7f4f2be9
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/exports/Publish-AzBotServiceApp.ps1
@@ -0,0 +1,125 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Returns a BotService specified by the parameters.
+.Description
+Returns a BotService specified by the parameters.
+.Example
+Publish-AzBotServiceApp -ResourceGroupName youriBotTest -CodeDir D:\zips\MyEchoBot -Name youriechobottest
+
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/publish-azbotserviceapp
+#>
+function Publish-AzBotServiceApp {
+[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(Mandatory)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${ResourceGroupName},
+
+ [Parameter(Mandatory)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # This parameter defines the name of the bot.
+ ${Name},
+
+ [Parameter(Mandatory)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # This parameter defines the Path of the ZIP
+ ${CodeDir}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ __AllParameterSets = 'Az.BotService.custom\Publish-AzBotServiceApp';
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/BotService copy/BotService.Autorest/exports/README.md b/src/BotService copy/BotService.Autorest/exports/README.md
new file mode 100644
index 000000000000..906ba7c3c52d
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/exports/README.md
@@ -0,0 +1,20 @@
+# Exports
+This directory contains the cmdlets *exported by* `Az.BotService`. No other cmdlets in this repository are directly exported. What that means is the `Az.BotService` module will run [Export-ModuleMember](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `..\custom` for all custom implementation.
+
+## Info
+- Modifiable: no
+- Generated: all
+- Committed: no
+- Packaged: yes
+
+## Details
+The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`..\bin\Az.BotService.private.dll`) and from the `..\custom\Az.BotService.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [README.md](..\internal/README.md) in the `..\internal` folder.
+
+## Purpose
+We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles.
+
+## Structure
+The cmdlets generated here will flat in the directory (no sub-folders) as long as there are no Azure profiles specified for any cmdlets. Azure profiles (the `Profiles` attribute) is only applied when generating with the `--azure` attribute (or `azure: true` in the configuration). When Azure profiles are applied, the folder structure has a folder per profile. Each profile folder has only those cmdlets that apply to that profile.
+
+## Usage
+When `./Az.BotService.psm1` is loaded, it dynamically exports cmdlets here based on the folder structure and on the selected profile. If there are no sub-folders, it exports all cmdlets at the root of this folder. If there are sub-folders, it checks to see the selected profile. If no profile is selected, it exports the cmdlets in the last sub-folder (alphabetically). If a profile is selected, it exports the cmdlets in the sub-folder that matches the profile name. If there is no sub-folder that matches the profile name, it exports no cmdlets and writes a warning message.
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/exports/Remove-AzBotService.ps1 b/src/BotService copy/BotService.Autorest/exports/Remove-AzBotService.ps1
new file mode 100644
index 000000000000..0cddb3f41db2
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/exports/Remove-AzBotService.ps1
@@ -0,0 +1,209 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Deletes a Bot Service from the resource group.
+.Description
+Deletes a Bot Service from the resource group.
+.Example
+Remove-AzBotService -Name youri-bot -ResourceGroupName youriBotTest
+.Example
+$getservice = Get-AzBotService -Name youriechobottest -ResourceGroupName youriBotTest
+Remove-AzBotService -InputObject $getservice
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity
+.Outputs
+System.Boolean
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [ChannelName ]: The name of the Channel resource.
+ [ConnectionName ]: The name of the Bot Service Connection Setting resource.
+ [Id ]: Resource identity path
+ [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource
+ [ResourceGroupName ]: The name of the Bot resource group in the user subscription.
+ [ResourceName ]: The name of the Bot resource.
+ [SubscriptionId ]: Azure Subscription ID.
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/remove-azbotservice
+#>
+function Remove-AzBotService {
+[OutputType([System.Boolean])]
+[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Alias('BotName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${Name},
+
+ [Parameter(ParameterSetName='Delete', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='Delete')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Returns true when the command succeeds
+ ${PassThru},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ Delete = 'Az.BotService.private\Remove-AzBotService_Delete';
+ DeleteViaIdentity = 'Az.BotService.private\Remove-AzBotService_DeleteViaIdentity';
+ }
+ if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/BotService copy/BotService.Autorest/exports/Update-AzBotService.ps1 b/src/BotService copy/BotService.Autorest/exports/Update-AzBotService.ps1
new file mode 100644
index 000000000000..074379ff84f4
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/exports/Update-AzBotService.ps1
@@ -0,0 +1,406 @@
+
+# ----------------------------------------------------------------------------------
+# 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
+Updates a Bot Service
+.Description
+Updates a Bot Service
+.Example
+Update-AzBotService -Name 'youri-apptest' -ResourceGroupName 'youriBotTest' -kind Bot
+.Example
+$getAzbot = Get-AzBotService -Name 'youri-apptest' -ResourceGroupName 'youriBotTest'
+Update-AzBotService -InputObject $getAzbot -kind sdk
+
+.Inputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity
+.Outputs
+Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot
+.Notes
+COMPLEX PARAMETER PROPERTIES
+
+To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
+
+INPUTOBJECT : Identity Parameter
+ [ChannelName ]: The name of the Channel resource.
+ [ConnectionName ]: The name of the Bot Service Connection Setting resource.
+ [Id ]: Resource identity path
+ [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource
+ [ResourceGroupName ]: The name of the Bot resource group in the user subscription.
+ [ResourceName ]: The name of the Bot resource.
+ [SubscriptionId ]: Azure Subscription ID.
+.Link
+https://learn.microsoft.com/powershell/module/az.botservice/update-azbotservice
+#>
+function Update-AzBotService {
+[OutputType([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot])]
+[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
+param(
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Alias('BotName')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource.
+ ${Name},
+
+ [Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [System.String]
+ # The name of the Bot resource group in the user subscription.
+ ${ResourceGroupName},
+
+ [Parameter(ParameterSetName='UpdateExpanded')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
+ [System.String]
+ # Azure Subscription ID.
+ ${SubscriptionId},
+
+ [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Path')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.IBotServiceIdentity]
+ # Identity Parameter
+ # To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
+ ${InputObject},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesAllSettings]))]
+ [System.Collections.Hashtable]
+ # Contains resource all settings defined as key/value pairs.
+ ${AllSetting},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The hint (e.g.
+ # keyVault secret resourceId) on how to fetch the app secret
+ ${AppPasswordHint},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The CMK Url
+ ${CmekKeyVaultUrl},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The description of the bot
+ ${Description},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The Application Insights key
+ ${DeveloperAppInsightKey},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The Application Insights Api Key
+ ${DeveloperAppInsightsApiKey},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The Application Insights App Id
+ ${DeveloperAppInsightsApplicationId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication.
+ ${DisableLocalAuth},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The Name of the bot
+ ${DisplayName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The bot's endpoint
+ ${Endpoint},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # Entity Tag
+ ${Etag},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The Icon Url of the bot
+ ${IconUrl},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Whether Cmek is enabled
+ ${IsCmekEnabled},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.Management.Automation.SwitchParameter]
+ # Whether the bot is streaming supported
+ ${IsStreamingSupported},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind])]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.Kind]
+ # Required.
+ # Gets or sets the Kind of the resource.
+ ${Kind},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # Specifies the location of the resource.
+ ${Location},
+
+ [Parameter()]
+ [AllowEmptyCollection()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String[]]
+ # Collection of LUIS App Ids
+ ${LuisAppId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The LUIS Key
+ ${LuisKey},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The bot's manifest url
+ ${ManifestUrl},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # Microsoft App Id for the bot
+ ${MsaAppId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # Microsoft App Managed Identity Resource Id for the bot
+ ${MsaAppMsiResourceId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # Microsoft App Tenant Id for the bot
+ ${MsaAppTenantId},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType])]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.MsaAppType]
+ # Microsoft App Type for the bot
+ ${MsaAppType},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The hint to browser (e.g.
+ # protocol handler) on how to open the bot for authoring
+ ${OpenWithHint},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotPropertiesParameters]))]
+ [System.Collections.Hashtable]
+ # Contains resource parameters defined as key/value pairs.
+ ${Parameter},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess])]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.PublicNetworkAccess]
+ # Whether the bot is in an isolated network
+ ${PublicNetworkAccess},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # Publishing credentials of the resource
+ ${PublishingCredentials},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The channel schema transformation version for the bot
+ ${SchemaTransformationVersion},
+
+ [Parameter()]
+ [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName])]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.SkuName]
+ # The sku name
+ ${SkuName},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The storage resourceId for the bot
+ ${StorageResourceId},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IResourceTags]))]
+ [System.Collections.Hashtable]
+ # Contains resource tags defined as key/value pairs.
+ ${Tag},
+
+ [Parameter()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Body')]
+ [System.String]
+ # The Tenant Id for the bot
+ ${TenantId},
+
+ [Parameter()]
+ [Alias('AzureRMContext', 'AzureCredential')]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Azure')]
+ [System.Management.Automation.PSObject]
+ # The credentials, account, tenant, and subscription used for communication with Azure.
+ ${DefaultProfile},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Wait for .NET debugger to attach
+ ${Break},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be appended to the front of the pipeline
+ ${HttpPipelineAppend},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.SendAsyncStep[]]
+ # SendAsync Pipeline Steps to be prepended to the front of the pipeline
+ ${HttpPipelinePrepend},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Uri]
+ # The URI for the proxy server to use
+ ${Proxy},
+
+ [Parameter(DontShow)]
+ [ValidateNotNull()]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.PSCredential]
+ # Credentials for a proxy server to use for the remote call
+ ${ProxyCredential},
+
+ [Parameter(DontShow)]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Category('Runtime')]
+ [System.Management.Automation.SwitchParameter]
+ # Use the default credentials for the proxy
+ ${ProxyUseDefaultCredentials}
+)
+
+begin {
+ try {
+ $outBuffer = $null
+ if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
+ $PSBoundParameters['OutBuffer'] = 1
+ }
+ $parameterSet = $PSCmdlet.ParameterSetName
+
+ if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
+ [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
+ }
+ $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ if ($preTelemetryId -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString()
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet)
+ } else {
+ $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ if ($internalCalledCmdlets -eq '') {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name
+ } else {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal'
+ }
+
+ $mapping = @{
+ UpdateExpanded = 'Az.BotService.private\Update-AzBotService_UpdateExpanded';
+ UpdateViaIdentityExpanded = 'Az.BotService.private\Update-AzBotService_UpdateViaIdentityExpanded';
+ }
+ if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
+ $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
+ }
+ $cmdInfo = Get-Command -Name $mapping[$parameterSet]
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
+ $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
+ $scriptCmd = {& $wrappedCmd @PSBoundParameters}
+ $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
+ $steppablePipeline.Begin($PSCmdlet)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+
+process {
+ try {
+ $steppablePipeline.Process($_)
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+
+ finally {
+ $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
+ $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+
+}
+end {
+ try {
+ $steppablePipeline.End()
+
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets
+ if ($preTelemetryId -eq '') {
+ [Microsoft.Azure.PowerShell.Cmdlets.BotService.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet)
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ }
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId
+
+ } catch {
+ [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()
+ throw
+ }
+}
+}
diff --git a/src/BotService copy/BotService.Autorest/generate-help.ps1 b/src/BotService copy/BotService.Autorest/generate-help.ps1
new file mode 100644
index 000000000000..2b665c15c023
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/generate-help.ps1
@@ -0,0 +1,74 @@
+# ----------------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------------
+param([switch]$Isolated)
+$ErrorActionPreference = 'Stop'
+
+$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path
+if(-not $Isolated) {
+ Write-Host -ForegroundColor Green 'Creating isolated process...'
+ & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated
+ return
+}
+
+$exportsFolder = Join-Path $PSScriptRoot 'exports'
+if(-not (Test-Path $exportsFolder)) {
+ Write-Error "Exports folder '$exportsFolder' was not found."
+}
+
+$directories = Get-ChildItem -Directory -Path $exportsFolder
+$hasProfiles = ($directories | Measure-Object).Count -gt 0
+if(-not $hasProfiles) {
+ $directories = Get-Item -Path $exportsFolder
+}
+
+$docsFolder = Join-Path $PSScriptRoot 'docs'
+if(Test-Path $docsFolder) {
+ $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
+}
+$null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue
+$examplesFolder = Join-Path $PSScriptRoot 'examples'
+
+$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.BotService.psd1')
+$modulePath = $modulePsd1.FullName
+$moduleName = $modulePsd1.BaseName
+
+# Load DLL to use build-time cmdlets
+Import-Module -Name $modulePath
+Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.BotService.private.dll')
+$instance = [Microsoft.Azure.PowerShell.Cmdlets.BotService.Module]::Instance
+# Module info is shared per profile
+$moduleInfo = Get-Module -Name $moduleName
+
+foreach($directory in $directories)
+{
+ if($hasProfiles) {
+ Select-AzProfile -Name $directory.Name
+ }
+ # Reload module per profile
+ Import-Module -Name $modulePath -Force
+
+ $cmdletNames = Get-ScriptCmdlet -ScriptFolder $directory.FullName
+ $cmdletHelpInfo = $cmdletNames | ForEach-Object { Get-Help -Name $_ -Full }
+ $cmdletFunctionInfo = Get-ScriptCmdlet -ScriptFolder $directory.FullName -AsFunctionInfo
+
+ $docsPath = Join-Path $docsFolder $directory.Name
+ $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue
+ $examplesPath = Join-Path $examplesFolder $directory.Name
+
+ Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath
+ Write-Host -ForegroundColor Green "Created documentation in '$docsPath'"
+}
+
+Write-Host -ForegroundColor Green '-------------Done-------------'
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/generate-info.json b/src/BotService copy/BotService.Autorest/generate-info.json
new file mode 100644
index 000000000000..283ae4459cd3
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/generate-info.json
@@ -0,0 +1,8 @@
+{
+ "swagger_commit": "2278f5552561a7959a49a1e38cb7ddbb349d1589",
+ "node": "v14.15.5",
+ "autorest": "`-- (empty)",
+ "autorest_core": "3.9.3",
+ "autorest_modelerfour": "4.15.414",
+ "autorest_powershell": "3.0.498"
+}
diff --git a/src/BotService copy/BotService.Autorest/generated/Module.cs b/src/BotService copy/BotService.Autorest/generated/Module.cs
new file mode 100644
index 000000000000..06e62e302ced
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/generated/Module.cs
@@ -0,0 +1,181 @@
+// 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.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BotService
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions;
+ using SendAsyncStepDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>;
+ using PipelineChangeDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>;
+ using GetParameterDelegate = global::System.Func;
+ using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
+ using ArgumentCompleterDelegate = global::System.Func;
+ using GetTelemetryIdDelegate = global::System.Func;
+ using TelemetryDelegate = global::System.Action;
+ using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>;
+ using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>;
+ using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>;
+ using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>;
+
+ /// A class that contains the module-common code and data.
+ public partial class Module
+ {
+ /// The currently selected profile.
+ public string Profile = global::System.String.Empty;
+
+ public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler();
+
+ /// the ISendAsync pipeline instance
+ private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline _pipeline;
+
+ /// the ISendAsync pipeline instance (when proxy is enabled)
+ private Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline _pipelineWithProxy;
+
+ public bool _useProxy = false;
+
+ public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy();
+
+ /// Gets completion data for azure specific fields
+ public ArgumentCompleterDelegate ArgumentCompleter { get; set; }
+
+ /// The instance of the Client API
+ public Microsoft.Azure.PowerShell.Cmdlets.BotService.BotService ClientAPI { get; set; }
+
+ /// A delegate that gets called for each signalled event
+ public EventListenerDelegate EventListener { get; set; }
+
+ /// The delegate to call to get parameter data from a common module.
+ public GetParameterDelegate GetParameterValue { get; set; }
+
+ /// The delegate to get the telemetry Id.
+ public GetTelemetryIdDelegate GetTelemetryId { get; set; }
+
+ /// Backing field for property.
+ private static Microsoft.Azure.PowerShell.Cmdlets.BotService.Module _instance;
+
+ /// the singleton of this module class
+ public static Microsoft.Azure.PowerShell.Cmdlets.BotService.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.BotService.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.BotService.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Module());
+
+ /// The Name of this module
+ public string Name => @"Az.BotService";
+
+ /// The delegate to call when this module is loaded (supporting a commmon module).
+ public ModuleLoadPipelineDelegate OnModuleLoad { get; set; }
+
+ /// The delegate to call before each new request (supporting a commmon module).
+ public NewRequestPipelineDelegate OnNewRequest { get; set; }
+
+ /// The name of the currently selected Azure profile
+ public global::System.String ProfileName { get; set; }
+
+ /// The ResourceID for this module (azure arm).
+ public string ResourceId => @"Az.BotService";
+
+ /// The delegate for creating a telemetry.
+ public TelemetryDelegate Telemetry { get; set; }
+
+ /// The from the cmdlet
+ /// The HttpPipeline for the request
+
+ partial void AfterCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline pipeline);
+
+ /// The from the cmdlet
+ /// The HttpPipeline for the request
+
+ partial void BeforeCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline pipeline);
+
+ partial void CustomInit();
+
+ /// Creates an instance of the HttpPipeline for each call.
+ /// The from the cmdlet
+ /// the cmdlet's correlation id.
+ /// the cmdlet's process record correlation id.
+ /// the cmdlet's parameterset name.
+ /// a dict for extensible parameters
+ /// An instance of Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline for the remote call.
+ public Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline CreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string processRecordId, string parameterSetName = null, global::System.Collections.Generic.IDictionary extensibleParameters = null)
+ {
+ Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline pipeline = null;
+ BeforeCreatePipeline(invocationInfo, ref pipeline);
+ pipeline = (pipeline ?? (_useProxy ? _pipelineWithProxy : _pipeline)).Clone();
+ AfterCreatePipeline(invocationInfo, ref pipeline);
+ pipeline.Append(new Runtime.CmdInfoHandler(processRecordId, invocationInfo, parameterSetName).SendAsync);
+ OnNewRequest?.Invoke( invocationInfo, correlationId,processRecordId, (step)=> { pipeline.Prepend(step); } , (step)=> { pipeline.Append(step); } );
+ return pipeline;
+ }
+
+ /// Gets parameters from a common module.
+ /// The from the cmdlet
+ /// the cmdlet's correlation id.
+ /// The name of the parameter to get the value for.
+ ///
+ /// The parameter value from the common module. (Note: this should be type converted on the way back)
+ ///
+ public object GetParameter(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string parameterName) => GetParameterValue?.Invoke( ResourceId, Name, invocationInfo, correlationId,parameterName );
+
+ /// Initialization steps performed after the module is loaded.
+ public void Init()
+ {
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } );
+ OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } );
+ CustomInit();
+ }
+
+ /// Creates the module instance.
+ private Module()
+ {
+ // constructor
+ ClientAPI = new Microsoft.Azure.PowerShell.Cmdlets.BotService.BotService();
+ _handler.Proxy = _webProxy;
+ _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient()));
+ _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient(_handler)));
+ }
+
+ /// The HTTP Proxy to use.
+ /// The HTTP Proxy Credentials
+ /// True if the proxy should use default credentials
+ public void SetProxyConfiguration(global::System.Uri proxy, global::System.Management.Automation.PSCredential proxyCredential, bool proxyUseDefaultCredentials)
+ {
+ _useProxy = proxy != null;
+ if (proxy == null)
+ {
+ return;
+ }
+ // set the proxy configuration
+ _webProxy.Address = proxy;
+ _webProxy.BypassProxyOnLocal = false;
+ if (proxyUseDefaultCredentials)
+ {
+ _webProxy.Credentials = null;
+ _webProxy.UseDefaultCredentials = true;
+ }
+ else
+ {
+ _webProxy.UseDefaultCredentials = false;
+ _webProxy.Credentials = proxyCredential ?.GetNetworkCredential();
+ }
+ }
+
+ /// Called to dispatch events to the common module listener
+ /// The ID of the event
+ /// The cancellation token for the event
+ /// A delegate to get the detailed event data
+ /// The callback for the event dispatcher
+ /// The from the cmdlet
+ /// the cmdlet's parameterset name.
+ /// the cmdlet's correlation id.
+ /// the cmdlet's process record correlation id.
+ /// the exception that is being thrown (if available)
+ ///
+ /// A that will be complete when handling of the event is completed.
+ ///
+ public async global::System.Threading.Tasks.Task Signal(string id, global::System.Threading.CancellationToken token, global::System.Func getEventData, SignalDelegate signal, global::System.Management.Automation.InvocationInfo invocationInfo, string parameterSetName, string correlationId, string processRecordId, global::System.Exception exception)
+ {
+ using( NoSynchronizationContext )
+ {
+ await EventListener?.Invoke(id,token,getEventData, signal, invocationInfo, parameterSetName, correlationId,processRecordId,exception);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/BotService copy/BotService.Autorest/generated/api/BotService.cs b/src/BotService copy/BotService.Autorest/generated/api/BotService.cs
new file mode 100644
index 000000000000..5df477f96a35
--- /dev/null
+++ b/src/BotService copy/BotService.Autorest/generated/api/BotService.cs
@@ -0,0 +1,5424 @@
+// 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.
+
+namespace Microsoft.Azure.PowerShell.Cmdlets.BotService
+{
+ using static Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Extensions;
+
+ ///
+ /// Low-level API implementation for the BotService service.
+ /// Azure Bot Service is a platform for creating smart conversational agents.
+ ///
+ public partial class BotService
+ {
+
+ /// Register a new Auth Connection for a Bot Service
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// The name of the Bot Service Connection Setting resource.
+ /// Azure Subscription ID.
+ /// The parameters to provide for creating the Connection Setting.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionCreate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BotService/botServices/"
+ + global::System.Uri.EscapeDataString(resourceName)
+ + "/connections/"
+ + global::System.Uri.EscapeDataString(connectionName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Register a new Auth Connection for a Bot Service
+ ///
+ /// The parameters to provide for creating the Connection Setting.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/connections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var resourceName = _match.Groups["resourceName"].Value;
+ var connectionName = _match.Groups["connectionName"].Value;
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BotService/botServices/"
+ + resourceName
+ + "/connections/"
+ + connectionName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ case global::System.Net.HttpStatusCode.Created:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// The name of the Bot Service Connection Setting resource.
+ /// Azure Subscription ID.
+ /// The parameters to provide for creating the Connection Setting.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionCreate_Validate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(resourceName),resourceName);
+ await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64);
+ await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(connectionName),connectionName);
+ await eventListener.AssertMinimumLength(nameof(connectionName),connectionName,2);
+ await eventListener.AssertMaximumLength(nameof(connectionName),connectionName,64);
+ await eventListener.AssertRegEx(nameof(connectionName),connectionName,@"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(body), body);
+ await eventListener.AssertObjectIsValid(nameof(body), body);
+ }
+ }
+
+ /// Deletes a Connection Setting registration for a Bot Service
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// The name of the Bot Service Connection Setting resource.
+ /// Azure Subscription ID.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionDelete(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BotService/botServices/"
+ + global::System.Uri.EscapeDataString(resourceName)
+ + "/connections/"
+ + global::System.Uri.EscapeDataString(connectionName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Deletes a Connection Setting registration for a Bot Service
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/connections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var resourceName = _match.Groups["resourceName"].Value;
+ var connectionName = _match.Groups["connectionName"].Value;
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BotService/botServices/"
+ + resourceName
+ + "/connections/"
+ + connectionName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response);
+ break;
+ }
+ case global::System.Net.HttpStatusCode.NoContent:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onNoContent(_response);
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// The name of the Bot Service Connection Setting resource.
+ /// Azure Subscription ID.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionDelete_Validate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(resourceName),resourceName);
+ await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64);
+ await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(connectionName),connectionName);
+ await eventListener.AssertMinimumLength(nameof(connectionName),connectionName,2);
+ await eventListener.AssertMaximumLength(nameof(connectionName),connectionName,64);
+ await eventListener.AssertRegEx(nameof(connectionName),connectionName,@"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ }
+ }
+
+ /// Get a Connection Setting registration for a Bot Service
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// The name of the Bot Service Connection Setting resource.
+ /// Azure Subscription ID.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionGet(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BotService/botServices/"
+ + global::System.Uri.EscapeDataString(resourceName)
+ + "/connections/"
+ + global::System.Uri.EscapeDataString(connectionName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionGet_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Get a Connection Setting registration for a Bot Service
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/connections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var resourceName = _match.Groups["resourceName"].Value;
+ var connectionName = _match.Groups["connectionName"].Value;
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BotService/botServices/"
+ + resourceName
+ + "/connections/"
+ + connectionName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionGet_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// The name of the Bot Service Connection Setting resource.
+ /// Azure Subscription ID.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionGet_Validate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(resourceName),resourceName);
+ await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64);
+ await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(connectionName),connectionName);
+ await eventListener.AssertMinimumLength(nameof(connectionName),connectionName,2);
+ await eventListener.AssertMaximumLength(nameof(connectionName),connectionName,64);
+ await eventListener.AssertRegEx(nameof(connectionName),connectionName,@"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ }
+ }
+
+ ///
+ /// Returns all the Connection Settings registered to a particular BotService resource
+ ///
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// Azure Subscription ID.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionListByBotService(string resourceGroupName, string resourceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BotService/botServices/"
+ + global::System.Uri.EscapeDataString(resourceName)
+ + "/connections"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionListByBotService_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ ///
+ /// Returns all the Connection Settings registered to a particular BotService resource
+ ///
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionListByBotServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/connections$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var resourceName = _match.Groups["resourceName"].Value;
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BotService/botServices/"
+ + resourceName
+ + "/connections"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionListByBotService_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionListByBotService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSettingResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will
+ /// get validation events back.
+ ///
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// Azure Subscription ID.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionListByBotService_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(resourceName),resourceName);
+ await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64);
+ await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ }
+ }
+
+ /// Lists the available Service Providers for creating Connection Settings
+ /// Azure Subscription ID.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionListServiceProviders(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.BotService/listAuthServiceProviders"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionListServiceProviders_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Lists the available Service Providers for creating Connection Settings
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionListServiceProvidersViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.BotService$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/listAuthServiceProviders'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/providers/Microsoft.BotService/listAuthServiceProviders"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionListServiceProviders_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionListServiceProviders_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ServiceProviderResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you
+ /// will get validation events back.
+ ///
+ /// Azure Subscription ID.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionListServiceProviders_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ }
+ }
+
+ /// Get a Connection Setting registration for a Bot Service
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// The name of the Bot Service Connection Setting resource.
+ /// Azure Subscription ID.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionListWithSecrets(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BotService/botServices/"
+ + global::System.Uri.EscapeDataString(resourceName)
+ + "/connections/"
+ + global::System.Uri.EscapeDataString(connectionName)
+ + "/listWithSecrets"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionListWithSecrets_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Get a Connection Setting registration for a Bot Service
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionListWithSecretsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/connections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}/listWithSecrets'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var resourceName = _match.Groups["resourceName"].Value;
+ var connectionName = _match.Groups["connectionName"].Value;
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BotService/botServices/"
+ + resourceName
+ + "/connections/"
+ + connectionName
+ + "/listWithSecrets"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionListWithSecrets_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionListWithSecrets_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will
+ /// get validation events back.
+ ///
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// The name of the Bot Service Connection Setting resource.
+ /// Azure Subscription ID.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionListWithSecrets_Validate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(resourceName),resourceName);
+ await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64);
+ await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(connectionName),connectionName);
+ await eventListener.AssertMinimumLength(nameof(connectionName),connectionName,2);
+ await eventListener.AssertMaximumLength(nameof(connectionName),connectionName,64);
+ await eventListener.AssertRegEx(nameof(connectionName),connectionName,@"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ }
+ }
+
+ /// Updates a Connection Setting registration for a Bot Service
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// The name of the Bot Service Connection Setting resource.
+ /// Azure Subscription ID.
+ /// The parameters to provide for updating the Connection Setting.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionUpdate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BotService/botServices/"
+ + global::System.Uri.EscapeDataString(resourceName)
+ + "/connections/"
+ + global::System.Uri.EscapeDataString(connectionName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Patch, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Updates a Connection Setting registration for a Bot Service
+ ///
+ /// The parameters to provide for updating the Connection Setting.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotConnectionUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/connections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var resourceName = _match.Groups["resourceName"].Value;
+ var connectionName = _match.Groups["connectionName"].Value;
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BotService/botServices/"
+ + resourceName
+ + "/connections/"
+ + connectionName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Patch, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotConnectionUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ case global::System.Net.HttpStatusCode.Created:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ConnectionSetting.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// The name of the Bot Service Connection Setting resource.
+ /// Azure Subscription ID.
+ /// The parameters to provide for updating the Connection Setting.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotConnectionUpdate_Validate(string resourceGroupName, string resourceName, string connectionName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IConnectionSetting body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(resourceName),resourceName);
+ await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64);
+ await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(connectionName),connectionName);
+ await eventListener.AssertMinimumLength(nameof(connectionName),connectionName,2);
+ await eventListener.AssertMaximumLength(nameof(connectionName),connectionName,64);
+ await eventListener.AssertRegEx(nameof(connectionName),connectionName,@"^[a-zA-Z0-9][\sa-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(body), body);
+ await eventListener.AssertObjectIsValid(nameof(body), body);
+ }
+ }
+
+ /// Creates a Bot Service. Bot Service is a resource group wide resource type.
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// Azure Subscription ID.
+ /// The parameters to provide for the created bot.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsCreate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BotService/botServices/"
+ + global::System.Uri.EscapeDataString(resourceName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Creates a Bot Service. Bot Service is a resource group wide resource type.
+ ///
+ /// The parameters to provide for the created bot.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var resourceName = _match.Groups["resourceName"].Value;
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BotService/botServices/"
+ + resourceName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ case global::System.Net.HttpStatusCode.Created:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation events
+ /// back.
+ ///
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// Azure Subscription ID.
+ /// The parameters to provide for the created bot.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsCreate_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(resourceName),resourceName);
+ await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64);
+ await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(body), body);
+ await eventListener.AssertObjectIsValid(nameof(body), body);
+ }
+ }
+
+ /// Deletes a Bot Service from the resource group.
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// Azure Subscription ID.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsDelete(string resourceGroupName, string resourceName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BotService/botServices/"
+ + global::System.Uri.EscapeDataString(resourceName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Deletes a Bot Service from the resource group.
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var resourceName = _match.Groups["resourceName"].Value;
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BotService/botServices/"
+ + resourceName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response);
+ break;
+ }
+ case global::System.Net.HttpStatusCode.NoContent:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onNoContent(_response);
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation events
+ /// back.
+ ///
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// Azure Subscription ID.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsDelete_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(resourceName),resourceName);
+ await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64);
+ await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ }
+ }
+
+ /// Returns a BotService specified by the parameters.
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// Azure Subscription ID.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsGet(string resourceGroupName, string resourceName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BotService/botServices/"
+ + global::System.Uri.EscapeDataString(resourceName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsGet_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Check whether a bot name is available.
+ /// The request body parameters to provide for the check name availability request
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsGetCheckNameAvailability(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/providers/Microsoft.BotService/checkNameAvailability"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsGetCheckNameAvailability_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Check whether a bot name is available.
+ ///
+ /// The request body parameters to provide for the check name availability request
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsGetCheckNameAvailabilityViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.BotService$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.BotService/checkNameAvailability'");
+ }
+
+ // replace URI parameters with values from identity
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/providers/Microsoft.BotService/checkNameAvailability"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Post, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsGetCheckNameAvailability_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsGetCheckNameAvailability_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.CheckNameAvailabilityResponseBody.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will
+ /// get validation events back.
+ ///
+ /// The request body parameters to provide for the check name availability request
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsGetCheckNameAvailability_Validate(Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.ICheckNameAvailabilityRequestBody body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(body), body);
+ await eventListener.AssertObjectIsValid(nameof(body), body);
+ }
+ }
+
+ /// Returns a BotService specified by the parameters.
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var resourceName = _match.Groups["resourceName"].Value;
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BotService/botServices/"
+ + resourceName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsGet_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation events
+ /// back.
+ ///
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// Azure Subscription ID.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsGet_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(resourceName),resourceName);
+ await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64);
+ await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ }
+ }
+
+ /// Returns all the resources of a particular type belonging to a subscription.
+ /// Azure Subscription ID.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/providers/Microsoft.BotService/botServices"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsList_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Returns all the resources of a particular type belonging to a resource group
+ /// The name of the Bot resource group in the user subscription.
+ /// Azure Subscription ID.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsListByResourceGroup(string resourceGroupName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BotService/botServices"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Returns all the resources of a particular type belonging to a resource group
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BotService/botServices"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get
+ /// validation events back.
+ ///
+ /// The name of the Bot resource group in the user subscription.
+ /// Azure Subscription ID.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsListByResourceGroup_Validate(string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ }
+ }
+
+ /// Returns all the resources of a particular type belonging to a subscription.
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.BotService/botServices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/botServices'");
+ }
+
+ // replace URI parameters with values from identity
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/providers/Microsoft.BotService/botServices"
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Get, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsList_Call(request,onOk,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotResponseList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation events
+ /// back.
+ ///
+ /// Azure Subscription ID.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ }
+ }
+
+ /// Updates a Bot Service
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// Azure Subscription ID.
+ /// The parameters to provide for the created bot.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsUpdate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BotService/botServices/"
+ + global::System.Uri.EscapeDataString(resourceName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Patch, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Updates a Bot Service
+ ///
+ /// The parameters to provide for the created bot.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task BotsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var resourceName = _match.Groups["resourceName"].Value;
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BotService/botServices/"
+ + resourceName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Patch, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.BotsUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ case global::System.Net.HttpStatusCode.Created:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Bot.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation events
+ /// back.
+ ///
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// Azure Subscription ID.
+ /// The parameters to provide for the created bot.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task BotsUpdate_Validate(string resourceGroupName, string resourceName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBot body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(resourceName),resourceName);
+ await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64);
+ await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(body), body);
+ await eventListener.AssertObjectIsValid(nameof(body), body);
+ }
+ }
+
+ /// Creates a Channel registration for a Bot Service
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// The name of the Channel resource.
+ /// Azure Subscription ID.
+ /// The parameters to provide for the created bot.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ChannelsCreate(string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName channelName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BotService/botServices/"
+ + global::System.Uri.EscapeDataString(resourceName)
+ + "/channels/"
+ + global::System.Uri.EscapeDataString(channelName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ChannelsCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Creates a Channel registration for a Bot Service
+ ///
+ /// The parameters to provide for the created bot.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ChannelsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var resourceName = _match.Groups["resourceName"].Value;
+ var channelName = _match.Groups["channelName"].Value;
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BotService/botServices/"
+ + resourceName
+ + "/channels/"
+ + channelName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Put, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // set body content
+ request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8);
+ request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ChannelsCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for method.
+ /// the prepared HttpRequestMessage to send.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 201 (Created).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ChannelsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ using( NoSynchronizationContext )
+ {
+ global::System.Net.Http.HttpResponseMessage _response = null;
+ try
+ {
+ var sendTask = sender.SendAsync(request, eventListener);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; }
+ _response = await sendTask;
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ var _contentType = _response.Content.Headers.ContentType?.MediaType;
+
+ switch ( _response.StatusCode )
+ {
+ case global::System.Net.HttpStatusCode.OK:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ case global::System.Net.HttpStatusCode.Created:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.BotChannel.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ default:
+ {
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
+ await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.Error.FromJson(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Json.JsonNode.Parse(body.Result)) ));
+ break;
+ }
+ }
+ }
+ finally
+ {
+ // finally statements
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.Finally, request, _response);
+ _response?.Dispose();
+ request?.Dispose();
+ }
+ }
+ }
+
+ ///
+ /// Validation method for method. Call this like the actual call, but you will get validation
+ /// events back.
+ ///
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// The name of the Channel resource.
+ /// Azure Subscription ID.
+ /// The parameters to provide for the created bot.
+ /// an instance that will receive events.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ internal async global::System.Threading.Tasks.Task ChannelsCreate_Validate(string resourceGroupName, string resourceName, Microsoft.Azure.PowerShell.Cmdlets.BotService.Support.ChannelName channelName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.BotService.Models.Api20220615Preview.IBotChannel body, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener)
+ {
+ using( NoSynchronizationContext )
+ {
+ await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName);
+ await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,64);
+ await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(resourceName),resourceName);
+ await eventListener.AssertMinimumLength(nameof(resourceName),resourceName,2);
+ await eventListener.AssertMaximumLength(nameof(resourceName),resourceName,64);
+ await eventListener.AssertRegEx(nameof(resourceName),resourceName,@"^[a-zA-Z0-9][a-zA-Z0-9_.-]*$");
+ await eventListener.AssertNotNull(nameof(channelName),channelName);
+ await eventListener.AssertEnum(nameof(channelName),channelName,@"AlexaChannel", @"FacebookChannel", @"EmailChannel", @"KikChannel", @"TelegramChannel", @"SlackChannel", @"MsTeamsChannel", @"SkypeChannel", @"WebChatChannel", @"DirectLineChannel", @"SmsChannel", @"LineChannel", @"DirectLineSpeechChannel", @"OutlookChannel", @"Omnichannel", @"TelephonyChannel");
+ await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId);
+ await eventListener.AssertNotNull(nameof(body), body);
+ await eventListener.AssertObjectIsValid(nameof(body), body);
+ }
+ }
+
+ /// Deletes a Channel registration from a Bot Service
+ /// The name of the Bot resource group in the user subscription.
+ /// The name of the Bot resource.
+ /// The name of the Bot resource.
+ /// Azure Subscription ID.
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ChannelsDelete(string resourceGroupName, string resourceName, string channelName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + global::System.Uri.EscapeDataString(subscriptionId)
+ + "/resourceGroups/"
+ + global::System.Uri.EscapeDataString(resourceGroupName)
+ + "/providers/Microsoft.BotService/botServices/"
+ + global::System.Uri.EscapeDataString(resourceName)
+ + "/channels/"
+ + global::System.Uri.EscapeDataString(channelName)
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ChannelsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Deletes a Channel registration from a Bot Service
+ ///
+ /// a delegate that is called when the remote service returns 200 (OK).
+ /// a delegate that is called when the remote service returns 204 (NoContent).
+ /// a delegate that is called when the remote service returns default (any response code not handled
+ /// elsewhere).
+ /// an instance that will receive events.
+ /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync pipeline to use to make the request.
+ ///
+ /// A that will be complete when handling of the response is completed.
+ ///
+ public async global::System.Threading.Tasks.Task ChannelsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.ISendAsync sender)
+ {
+ var apiVersion = @"2022-06-15-preview";
+ // Constant Parameters
+ using( NoSynchronizationContext )
+ {
+ // verify that Identity format is an exact match for uri
+
+ var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.BotService/botServices/(?[^/]+)/channels/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity);
+ if (!_match.Success)
+ {
+ throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}'");
+ }
+
+ // replace URI parameters with values from identity
+ var resourceGroupName = _match.Groups["resourceGroupName"].Value;
+ var resourceName = _match.Groups["resourceName"].Value;
+ var channelName = _match.Groups["channelName"].Value;
+ var subscriptionId = _match.Groups["subscriptionId"].Value;
+ // construct URL
+ var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
+ "/subscriptions/"
+ + subscriptionId
+ + "/resourceGroups/"
+ + resourceGroupName
+ + "/providers/Microsoft.BotService/botServices/"
+ + resourceName
+ + "/channels/"
+ + channelName
+ + "?"
+ + "api-version=" + global::System.Uri.EscapeDataString(apiVersion)
+ ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2");
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ // generate request object
+ var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}");
+ var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Method.Delete, _url);
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; }
+
+ await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.BotService.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; }
+ // make the call
+ await this.ChannelsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender);
+ }
+ }
+
+ /// Actual wire call for