From c102f17b5471ae11632923067bb1310e0b13c2e5 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sun, 11 May 2025 05:27:49 +0000 Subject: [PATCH] CodeGen from PR 34585 in Azure/azure-rest-api-specs Merge bc97f23e5b36baa44ea0dd8d6768028ef1c666e0 into 4e8d16d3793228046ac6171eadda4b8d26ad2b4f --- .../Samples/Sample_BotChannelCollection.cs | 166 ++-- .../Samples/Sample_BotChannelResource.cs | 181 ++-- .../Generated/Samples/Sample_BotCollection.cs | 51 +- .../Generated/Samples/Sample_BotResource.cs | 122 +-- ...vicePrivateEndpointConnectionCollection.cs | 30 +- ...ervicePrivateEndpointConnectionResource.cs | 22 +- .../Sample_ConnectionSettingCollection.cs | 90 ++ .../Sample_ConnectionSettingResource.cs | 108 +++ ...ecurityPerimeterConfigurationCollection.cs | 160 ++++ ...kSecurityPerimeterConfigurationResource.cs | 81 ++ .../Sample_SubscriptionResourceExtensions.cs | 60 +- .../Sample_TenantResourceExtensions.cs | 37 +- .../Generated/ArmBotServiceModelFactory.cs | 825 +++++++++++------- .../src/Generated/BotChannelCollection.cs | 163 ++-- .../Generated/BotChannelData.Serialization.cs | 26 +- .../src/Generated/BotChannelData.cs | 10 +- .../src/Generated/BotChannelResource.cs | 216 +++-- .../src/Generated/BotCollection.cs | 40 +- ...ConnectionSettingResource.Serialization.cs | 26 - .../src/Generated/BotData.Serialization.cs | 22 +- .../src/Generated/BotData.cs | 4 +- .../src/Generated/BotResource.cs | 317 ++++--- ...vicePrivateEndpointConnectionCollection.cs | 46 +- ...ateEndpointConnectionData.Serialization.cs | 4 +- ...BotServicePrivateEndpointConnectionData.cs | 8 +- ...ervicePrivateEndpointConnectionResource.cs | 24 +- ...tion.cs => ConnectionSettingCollection.cs} | 174 ++-- ...=> ConnectionSettingData.Serialization.cs} | 64 +- ...ettingData.cs => ConnectionSettingData.cs} | 20 +- ...ConnectionSettingResource.Serialization.cs | 26 + ...source.cs => ConnectionSettingResource.cs} | 242 ++--- .../Extensions/BotServiceExtensions.cs | 291 ++++-- .../Extensions/MockableBotServiceArmClient.cs | 24 +- ...MockableBotServiceResourceGroupResource.cs | 8 +- .../MockableBotServiceSubscriptionResource.cs | 206 +++-- .../MockableBotServiceTenantResource.cs | 105 ++- ...tyPerimeterConfigurationOperationSource.cs | 36 + ...rationResultsDescriptionOperationSource.cs | 30 + .../src/Generated/Models/.Serialization.cs | 116 +++ .../src/Generated/Models/.cs | 57 ++ .../src/Generated/Models/AccessMode.cs | 54 ++ .../Models/AcsChatChannel.Serialization.cs | 12 +- .../src/Generated/Models/AcsChatChannel.cs | 5 +- .../Models/AlexaChannel.Serialization.cs | 12 +- .../src/Generated/Models/AlexaChannel.cs | 5 +- .../AlexaChannelProperties.Serialization.cs | 14 +- .../Models/AlexaChannelProperties.cs | 10 +- .../src/Generated/Models/BotChannelName.cs | 102 --- .../Models/BotProperties.Serialization.cs | 100 +-- .../src/Generated/Models/BotProperties.cs | 34 +- .../Models/BotResponseList.Serialization.cs | 34 +- .../src/Generated/Models/BotResponseList.cs | 25 +- ...pointConnectionListResult.Serialization.cs | 13 +- ...vicePrivateEndpointConnectionListResult.cs | 6 +- ...cePrivateLinkResourceData.Serialization.cs | 2 +- .../BotServicePrivateLinkResourceData.cs | 6 +- .../Models/BotServicePublicNetworkAccess.cs | 51 -- .../Generated/Models/BotServiceSeverity.cs | 51 ++ ...ialization.cs => Channel.Serialization.cs} | 40 +- .../{BotChannelProperties.cs => Channel.cs} | 17 +- .../ChannelResponseList.Serialization.cs | 34 +- .../Generated/Models/ChannelResponseList.cs | 25 +- ...on.cs => ChannelSettings.Serialization.cs} | 56 +- ...tChannelSettings.cs => ChannelSettings.cs} | 32 +- ...meAvailabilityRequestBody.Serialization.cs | 140 +++ ...cs => CheckNameAvailabilityRequestBody.cs} | 17 +- ...AvailabilityResponseBody.Serialization.cs} | 42 +- ...s => CheckNameAvailabilityResponseBody.cs} | 16 +- ...nnectionSettingParameter.Serialization.cs} | 38 +- ...meter.cs => ConnectionSettingParameter.cs} | 10 +- ...nectionSettingProperties.Serialization.cs} | 70 +- ...ties.cs => ConnectionSettingProperties.cs} | 22 +- ...ectionSettingResponseList.Serialization.cs | 36 +- .../Models/ConnectionSettingResponseList.cs | 27 +- ...teEmailSignInUrlResponse.Serialization.cs} | 56 +- ...ult.cs => CreateEmailSignInUrlResponse.cs} | 17 +- ...gnInUrlResponseProperties.Serialization.cs | 10 +- .../CreateEmailSignInUrlResponseProperties.cs | 4 +- .../Models/DirectLineChannel.Serialization.cs | 12 +- .../src/Generated/Models/DirectLineChannel.cs | 5 +- .../Models/DirectLineSite.Serialization.cs | 16 +- .../src/Generated/Models/DirectLineSite.cs | 4 +- .../DirectLineSpeechChannel.Serialization.cs | 12 +- .../Models/DirectLineSpeechChannel.cs | 5 +- ...neSpeechChannelProperties.Serialization.cs | 8 +- .../DirectLineSpeechChannelProperties.cs | 5 +- .../Models/EmailChannel.Serialization.cs | 12 +- .../src/Generated/Models/EmailChannel.cs | 5 +- .../Models/FacebookChannel.Serialization.cs | 12 +- .../src/Generated/Models/FacebookChannel.cs | 5 +- ...FacebookChannelProperties.Serialization.cs | 10 +- .../Models/FacebookChannelProperties.cs | 4 +- ... => HostSettingsResponse.Serialization.cs} | 78 +- ...tingsResult.cs => HostSettingsResponse.cs} | 18 +- ....Serialization.cs => Key.Serialization.cs} | 18 +- .../Models/{BotServiceKey.cs => Key.cs} | 2 +- .../Models/KikChannel.Serialization.cs | 12 +- .../src/Generated/Models/KikChannel.cs | 5 +- .../Models/LineChannel.Serialization.cs | 12 +- .../src/Generated/Models/LineChannel.cs | 5 +- .../LineChannelProperties.Serialization.cs | 10 +- .../Generated/Models/LineChannelProperties.cs | 4 +- ...tChannelWithKeysResponse.Serialization.cs} | 95 +- ...sult.cs => ListChannelWithKeysResponse.cs} | 57 +- .../Models/M365Extensions.Serialization.cs | 12 +- .../src/Generated/Models/M365Extensions.cs | 5 +- .../Models/MsTeamsChannel.Serialization.cs | 12 +- .../src/Generated/Models/MsTeamsChannel.cs | 5 +- .../MsTeamsChannelProperties.Serialization.cs | 4 +- .../Models/MsTeamsChannelProperties.cs | 8 +- .../{BotMsaAppType.cs => MsaAppType.cs} | 28 +- .../NetworkSecurityPerimeter.Serialization.cs | 155 ++++ .../Models/NetworkSecurityPerimeter.cs | 74 ++ ...erimeterConfigurationList.Serialization.cs | 154 ++++ ...tworkSecurityPerimeterConfigurationList.cs | 77 ++ ...erConfigurationProperties.Serialization.cs | 209 +++++ ...ecurityPerimeterConfigurationProperties.cs | 82 ++ ...tion.cs => NspAccessRule.Serialization.cs} | 50 +- .../src/Generated/Models/NspAccessRule.cs | 69 ++ .../Models/NspAccessRuleDirection.cs | 51 ++ .../NspAccessRuleProperties.Serialization.cs | 292 +++++++ .../Models/NspAccessRuleProperties.cs | 96 ++ .../Models/Omnichannel.Serialization.cs | 12 +- .../src/Generated/Models/Omnichannel.cs | 5 +- .../OperationDisplayInfo.Serialization.cs | 162 ++++ .../Generated/Models/OperationDisplayInfo.cs | 77 ++ .../Models/OperationEntity.Serialization.cs | 177 ++++ .../src/Generated/Models/OperationEntity.cs | 106 +++ ...OperationEntityListResult.Serialization.cs | 147 ++++ .../Models/OperationEntityListResult.cs | 80 ++ .../Generated/Models/OperationResultStatus.cs | 60 ++ ...erationResultsDescription.Serialization.cs | 170 ++++ .../Models/OperationResultsDescription.cs | 77 ++ .../Models/OutlookChannel.Serialization.cs | 12 +- .../src/Generated/Models/OutlookChannel.cs | 5 +- .../Generated/Models/Profile.Serialization.cs | 215 +++++ .../src/Generated/Models/Profile.cs | 83 ++ .../Models/ProvisioningIssue.Serialization.cs | 144 +++ .../src/Generated/Models/ProvisioningIssue.cs | 69 ++ ...ovisioningIssueProperties.Serialization.cs | 223 +++++ .../Models/ProvisioningIssueProperties.cs | 84 ++ .../src/Generated/Models/ProvisioningState.cs | 63 ++ .../Generated/Models/PublicNetworkAccess.cs | 54 ++ ...rEndpointKeysRequestBody.Serialization.cs} | 38 +- ....cs => QnAMakerEndpointKeysRequestBody.cs} | 10 +- ...akerEndpointKeysResponse.Serialization.cs} | 38 +- ...ult.cs => QnAMakerEndpointKeysResponse.cs} | 10 +- ...enerateKeysBotChannelName.Serialization.cs | 28 - .../Models/RegenerateKeysBotChannelName.cs | 18 - .../ResourceAssociation.Serialization.cs | 144 +++ .../Generated/Models/ResourceAssociation.cs | 69 ++ .../Models/SearchAssistant.Serialization.cs | 12 +- .../src/Generated/Models/SearchAssistant.cs | 5 +- ...on.cs => ServiceProvider.Serialization.cs} | 42 +- ...tServiceProvider.cs => ServiceProvider.cs} | 12 +- ...ServiceProviderParameter.Serialization.cs} | 52 +- ...rameter.cs => ServiceProviderParameter.cs} | 22 +- .../ServiceProviderParameterMetadata.cs | 4 +- ...ameterMetadataConstraints.Serialization.cs | 4 +- ...iceProviderParameterMetadataConstraints.cs | 8 +- ...erviceProviderProperties.Serialization.cs} | 66 +- ...erties.cs => ServiceProviderProperties.cs} | 18 +- ...rviceProviderResponseList.Serialization.cs | 8 +- .../Models/ServiceProviderResponseList.cs | 6 +- ...Serialization.cs => Site.Serialization.cs} | 58 +- .../Models/{BotChannelSite.cs => Site.cs} | 18 +- ...zation.cs => SiteContent.Serialization.cs} | 42 +- ...egenerateKeysContent.cs => SiteContent.cs} | 16 +- .../Models/SkypeChannel.Serialization.cs | 12 +- .../src/Generated/Models/SkypeChannel.cs | 5 +- .../SkypeChannelProperties.Serialization.cs | 24 +- .../Models/SkypeChannelProperties.cs | 38 +- .../Models/SlackChannel.Serialization.cs | 12 +- .../src/Generated/Models/SlackChannel.cs | 5 +- .../SlackChannelProperties.Serialization.cs | 10 +- .../Models/SlackChannelProperties.cs | 4 +- .../Models/SmsChannel.Serialization.cs | 12 +- .../src/Generated/Models/SmsChannel.cs | 5 +- .../Models/TelegramChannel.Serialization.cs | 12 +- .../src/Generated/Models/TelegramChannel.cs | 5 +- .../Models/TelephonyChannel.Serialization.cs | 12 +- .../src/Generated/Models/TelephonyChannel.cs | 5 +- ...elephonyChannelProperties.Serialization.cs | 14 +- .../Models/TelephonyChannelProperties.cs | 8 +- ...lResourceApiConfiguration.Serialization.cs | 4 +- ...elephonyChannelResourceApiConfiguration.cs | 5 +- .../TelephonyPhoneNumbers.Serialization.cs | 8 +- .../Generated/Models/TelephonyPhoneNumbers.cs | 7 +- .../Models/UnknownChannel.Serialization.cs | 46 +- .../src/Generated/Models/UnknownChannel.cs | 5 +- .../Models/WebChatChannel.Serialization.cs | 12 +- .../src/Generated/Models/WebChatChannel.cs | 5 +- .../Models/WebChatSite.Serialization.cs | 16 +- .../src/Generated/Models/WebChatSite.cs | 4 +- ...ecurityPerimeterConfigurationCollection.cs | 395 +++++++++ ...erimeterConfigurationData.Serialization.cs | 155 ++++ ...tworkSecurityPerimeterConfigurationData.cs | 75 ++ ...eterConfigurationResource.Serialization.cs | 26 + ...kSecurityPerimeterConfigurationResource.cs | 255 ++++++ ...ations.cs => BotChannelsRestOperations.cs} | 374 +++++--- ...tConnectionOperationGroupRestOperations.cs | 117 +++ .../BotsOperationGroupRestOperations.cs | 115 +++ .../RestOperations/BotsRestOperations.cs | 354 +++++--- ...cs => ConnectionSettingsRestOperations.cs} | 342 +++----- .../DirectLineRestOperations.cs | 147 ---- .../RestOperations/EmailRestOperations.cs | 133 --- ...stSettingsOperationGroupRestOperations.cs} | 28 +- ...tyPerimeterConfigurationsRestOperations.cs | 415 +++++++++ ...tionResultsOperationGroupRestOperations.cs | 113 +++ .../OperationsRestOperations.cs | 173 ++++ ...rivateEndpointConnectionsRestOperations.cs | 300 ++++--- .../PrivateLinkResourcesRestOperations.cs | 133 --- ...dpointKeysOperationGroupRestOperations.cs} | 54 +- .../src/autorest.md | 125 --- .../tsp-location.yaml | 4 + sdk/storage/ci.yml | 2 + 216 files changed, 10137 insertions(+), 4063 deletions(-) create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_ConnectionSettingCollection.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_ConnectionSettingResource.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs delete mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingResource.Serialization.cs rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/{BotConnectionSettingCollection.cs => ConnectionSettingCollection.cs} (62%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/{BotConnectionSettingData.Serialization.cs => ConnectionSettingData.Serialization.cs} (73%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/{BotConnectionSettingData.cs => ConnectionSettingData.cs} (75%) create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingResource.Serialization.cs rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/{BotConnectionSettingResource.cs => ConnectionSettingResource.cs} (67%) create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/LongRunningOperation/NetworkSecurityPerimeterConfigurationOperationSource.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/LongRunningOperation/OperationResultsDescriptionOperationSource.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AccessMode.cs delete mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelName.cs delete mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePublicNetworkAccess.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceSeverity.cs rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotChannelProperties.Serialization.cs => Channel.Serialization.cs} (74%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotChannelProperties.cs => Channel.cs} (80%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotChannelSettings.Serialization.cs => ChannelSettings.Serialization.cs} (77%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotChannelSettings.cs => ChannelSettings.cs} (76%) create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CheckNameAvailabilityRequestBody.Serialization.cs rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceNameAvailabilityContent.cs => CheckNameAvailabilityRequestBody.cs} (76%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceNameAvailabilityResult.Serialization.cs => CheckNameAvailabilityResponseBody.Serialization.cs} (65%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceNameAvailabilityResult.cs => CheckNameAvailabilityResponseBody.cs} (80%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotConnectionSettingParameter.Serialization.cs => ConnectionSettingParameter.Serialization.cs} (67%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotConnectionSettingParameter.cs => ConnectionSettingParameter.cs} (84%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotConnectionSettingProperties.Serialization.cs => ConnectionSettingProperties.Serialization.cs} (69%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotConnectionSettingProperties.cs => ConnectionSettingProperties.cs} (77%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotCreateEmailSignInUriResult.Serialization.cs => CreateEmailSignInUrlResponse.Serialization.cs} (62%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotCreateEmailSignInUriResult.cs => CreateEmailSignInUrlResponse.cs} (79%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceHostSettingsResult.Serialization.cs => HostSettingsResponse.Serialization.cs} (68%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceHostSettingsResult.cs => HostSettingsResponse.cs} (82%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceKey.Serialization.cs => Key.Serialization.cs} (53%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceKey.cs => Key.cs} (92%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotChannelGetWithKeysResult.Serialization.cs => ListChannelWithKeysResponse.Serialization.cs} (78%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotChannelGetWithKeysResult.cs => ListChannelWithKeysResponse.cs} (68%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotMsaAppType.cs => MsaAppType.cs} (51%) create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeter.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceNameAvailabilityContent.Serialization.cs => NspAccessRule.Serialization.cs} (60%) create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRule.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRuleDirection.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRuleProperties.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRuleProperties.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationDisplayInfo.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationDisplayInfo.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntity.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntity.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntityListResult.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntityListResult.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationResultStatus.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationResultsDescription.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationResultsDescription.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Profile.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Profile.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssue.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssue.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssueProperties.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/PublicNetworkAccess.cs rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{GetBotServiceQnAMakerEndpointKeyContent.Serialization.cs => QnAMakerEndpointKeysRequestBody.Serialization.cs} (63%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{GetBotServiceQnAMakerEndpointKeyContent.cs => QnAMakerEndpointKeysRequestBody.cs} (82%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{GetBotServiceQnAMakerEndpointKeyResult.Serialization.cs => QnAMakerEndpointKeysResponse.Serialization.cs} (67%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{GetBotServiceQnAMakerEndpointKeyResult.cs => QnAMakerEndpointKeysResponse.cs} (83%) delete mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/RegenerateKeysBotChannelName.Serialization.cs delete mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/RegenerateKeysBotChannelName.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ResourceAssociation.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ResourceAssociation.cs rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceProvider.Serialization.cs => ServiceProvider.Serialization.cs} (64%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceProvider.cs => ServiceProvider.cs} (81%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceProviderParameter.Serialization.cs => ServiceProviderParameter.Serialization.cs} (71%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceProviderParameter.cs => ServiceProviderParameter.cs} (78%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceProviderProperties.Serialization.cs => ServiceProviderProperties.Serialization.cs} (66%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotServiceProviderProperties.cs => ServiceProviderProperties.cs} (81%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotChannelSite.Serialization.cs => Site.Serialization.cs} (85%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotChannelSite.cs => Site.cs} (88%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotChannelRegenerateKeysContent.Serialization.cs => SiteContent.Serialization.cs} (62%) rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/{BotChannelRegenerateKeysContent.cs => SiteContent.cs} (78%) create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationData.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/{ChannelsRestOperations.cs => BotChannelsRestOperations.cs} (66%) create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotConnectionOperationGroupRestOperations.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotsOperationGroupRestOperations.cs rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/{BotConnectionRestOperations.cs => ConnectionSettingsRestOperations.cs} (78%) delete mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/DirectLineRestOperations.cs delete mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/EmailRestOperations.cs rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/{HostSettingsRestOperations.cs => HostSettingsOperationGroupRestOperations.cs} (79%) create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/OperationResultsOperationGroupRestOperations.cs create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/OperationsRestOperations.cs delete mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs rename sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/{QnAMakerEndpointKeysRestOperations.cs => QnAMakerEndpointKeysOperationGroupRestOperations.cs} (64%) delete mode 100644 sdk/botservice/Azure.ResourceManager.BotService/src/autorest.md create mode 100644 sdk/botservice/Azure.ResourceManager.BotService/tsp-location.yaml diff --git a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotChannelCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotChannelCollection.cs index b955034b5ce6..0222f75947aa 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotChannelCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotChannelCollection.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.BotService.Models; using NUnit.Framework; namespace Azure.ResourceManager.BotService.Samples @@ -20,8 +19,8 @@ public partial class Sample_BotChannelCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAlexaChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutAlexaChannel.json - // this example is just showing the usage of "Channels_Create" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/PutAlexaChannel.json + // this example is just showing the usage of "BotChannel_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -40,14 +39,8 @@ public async Task CreateOrUpdate_CreateAlexaChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.AlexaChannel; - BotChannelData data = new BotChannelData(new AzureLocation("global")) - { - Properties = new AlexaChannel - { - Properties = new AlexaChannelProperties("XAlexaSkillIdX", true), - }, - }; + string channelName = "AlexaChannel"; + BotChannelData data = new BotChannelData(default); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, channelName, data); BotChannelResource result = lro.Value; @@ -62,8 +55,8 @@ public async Task CreateOrUpdate_CreateAlexaChannel() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutChannel.json - // this example is just showing the usage of "Channels_Create" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/PutChannel.json + // this example is just showing the usage of "BotChannel_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -82,17 +75,8 @@ public async Task CreateOrUpdate_CreateChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.EmailChannel; - BotChannelData data = new BotChannelData(new AzureLocation("global")) - { - Properties = new EmailChannel - { - Properties = new EmailChannelProperties("a@b.com", true) - { - Password = "pwd", - }, - }, - }; + string channelName = "EmailChannel"; + BotChannelData data = new BotChannelData(default); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, channelName, data); BotChannelResource result = lro.Value; @@ -107,8 +91,8 @@ public async Task CreateOrUpdate_CreateChannel() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateDirectLineSpeechChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutDirectLineSpeechChannel.json - // this example is just showing the usage of "Channels_Create" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/PutDirectLineSpeechChannel.json + // this example is just showing the usage of "BotChannel_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -127,19 +111,8 @@ public async Task CreateOrUpdate_CreateDirectLineSpeechChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.DirectLineSpeechChannel; - BotChannelData data = new BotChannelData(new AzureLocation("global")) - { - Properties = new DirectLineSpeechChannel - { - Properties = new DirectLineSpeechChannelProperties - { - CognitiveServiceRegion = "XcognitiveServiceRegionX", - CognitiveServiceSubscriptionKey = "XcognitiveServiceSubscriptionKeyX", - IsEnabled = true, - }, - }, - }; + string channelName = "DirectLineSpeechChannel"; + BotChannelData data = new BotChannelData(default); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, channelName, data); BotChannelResource result = lro.Value; @@ -154,8 +127,8 @@ public async Task CreateOrUpdate_CreateDirectLineSpeechChannel() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateEmailChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutEmailChannel.json - // this example is just showing the usage of "Channels_Create" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/PutEmailChannel.json + // this example is just showing the usage of "BotChannel_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -174,18 +147,8 @@ public async Task CreateOrUpdate_CreateEmailChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.EmailChannel; - BotChannelData data = new BotChannelData(new AzureLocation("global")) - { - Properties = new EmailChannel - { - Properties = new EmailChannelProperties("a@b.com", true) - { - AuthMethod = EmailChannelAuthMethod.Graph, - MagicCode = "000000", - }, - }, - }; + string channelName = "EmailChannel"; + BotChannelData data = new BotChannelData(default); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, channelName, data); BotChannelResource result = lro.Value; @@ -200,8 +163,8 @@ public async Task CreateOrUpdate_CreateEmailChannel() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateLineChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutLineChannel.json - // this example is just showing the usage of "Channels_Create" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/PutLineChannel.json + // this example is just showing the usage of "BotChannel_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -220,21 +183,8 @@ public async Task CreateOrUpdate_CreateLineChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.LineChannel; - BotChannelData data = new BotChannelData(new AzureLocation("global")) - { - Properties = new LineChannel - { - Properties = new LineChannelProperties(new LineRegistration[] - { -new LineRegistration -{ -ChannelSecret = "channelSecret", -ChannelAccessToken = "channelAccessToken", -} - }), - }, - }; + string channelName = "LineChannel"; + BotChannelData data = new BotChannelData(default); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, channelName, data); BotChannelResource result = lro.Value; @@ -249,8 +199,8 @@ public async Task CreateOrUpdate_CreateLineChannel() [Ignore("Only validating compilation of examples")] public async Task Get_GetAlexaChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetAlexaChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetAlexaChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -269,7 +219,7 @@ public async Task Get_GetAlexaChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.AlexaChannel; + string channelName = "AlexaChannel"; BotChannelResource result = await collection.GetAsync(channelName); // the variable result is a resource, you could call other operations on this instance as well @@ -283,8 +233,8 @@ public async Task Get_GetAlexaChannel() [Ignore("Only validating compilation of examples")] public async Task Get_GetChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -303,7 +253,7 @@ public async Task Get_GetChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.EmailChannel; + string channelName = "EmailChannel"; BotChannelResource result = await collection.GetAsync(channelName); // the variable result is a resource, you could call other operations on this instance as well @@ -317,8 +267,8 @@ public async Task Get_GetChannel() [Ignore("Only validating compilation of examples")] public async Task Get_GetDirectLineSpeechChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetDirectLineSpeechChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetDirectLineSpeechChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -337,7 +287,7 @@ public async Task Get_GetDirectLineSpeechChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.DirectLineSpeechChannel; + string channelName = "DirectLineSpeechChannel"; BotChannelResource result = await collection.GetAsync(channelName); // the variable result is a resource, you could call other operations on this instance as well @@ -351,8 +301,8 @@ public async Task Get_GetDirectLineSpeechChannel() [Ignore("Only validating compilation of examples")] public async Task Get_GetLineChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetLineChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetLineChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -371,7 +321,7 @@ public async Task Get_GetLineChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.LineChannel; + string channelName = "LineChannel"; BotChannelResource result = await collection.GetAsync(channelName); // the variable result is a resource, you could call other operations on this instance as well @@ -385,8 +335,8 @@ public async Task Get_GetLineChannel() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListChannelsByResourceGroup() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannelsByBotService.json - // this example is just showing the usage of "Channels_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/ListChannelsByBotService.json + // this example is just showing the usage of "BotChannel_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -421,8 +371,8 @@ public async Task GetAll_ListChannelsByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAlexaChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetAlexaChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetAlexaChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -441,7 +391,7 @@ public async Task Exists_GetAlexaChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.AlexaChannel; + string channelName = "AlexaChannel"; bool result = await collection.ExistsAsync(channelName); Console.WriteLine($"Succeeded: {result}"); @@ -451,8 +401,8 @@ public async Task Exists_GetAlexaChannel() [Ignore("Only validating compilation of examples")] public async Task Exists_GetChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -471,7 +421,7 @@ public async Task Exists_GetChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.EmailChannel; + string channelName = "EmailChannel"; bool result = await collection.ExistsAsync(channelName); Console.WriteLine($"Succeeded: {result}"); @@ -481,8 +431,8 @@ public async Task Exists_GetChannel() [Ignore("Only validating compilation of examples")] public async Task Exists_GetDirectLineSpeechChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetDirectLineSpeechChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetDirectLineSpeechChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -501,7 +451,7 @@ public async Task Exists_GetDirectLineSpeechChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.DirectLineSpeechChannel; + string channelName = "DirectLineSpeechChannel"; bool result = await collection.ExistsAsync(channelName); Console.WriteLine($"Succeeded: {result}"); @@ -511,8 +461,8 @@ public async Task Exists_GetDirectLineSpeechChannel() [Ignore("Only validating compilation of examples")] public async Task Exists_GetLineChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetLineChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetLineChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -531,7 +481,7 @@ public async Task Exists_GetLineChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.LineChannel; + string channelName = "LineChannel"; bool result = await collection.ExistsAsync(channelName); Console.WriteLine($"Succeeded: {result}"); @@ -541,8 +491,8 @@ public async Task Exists_GetLineChannel() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAlexaChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetAlexaChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetAlexaChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -561,7 +511,7 @@ public async Task GetIfExists_GetAlexaChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.AlexaChannel; + string channelName = "AlexaChannel"; NullableResponse response = await collection.GetIfExistsAsync(channelName); BotChannelResource result = response.HasValue ? response.Value : null; @@ -583,8 +533,8 @@ public async Task GetIfExists_GetAlexaChannel() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -603,7 +553,7 @@ public async Task GetIfExists_GetChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.EmailChannel; + string channelName = "EmailChannel"; NullableResponse response = await collection.GetIfExistsAsync(channelName); BotChannelResource result = response.HasValue ? response.Value : null; @@ -625,8 +575,8 @@ public async Task GetIfExists_GetChannel() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetDirectLineSpeechChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetDirectLineSpeechChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetDirectLineSpeechChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -645,7 +595,7 @@ public async Task GetIfExists_GetDirectLineSpeechChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.DirectLineSpeechChannel; + string channelName = "DirectLineSpeechChannel"; NullableResponse response = await collection.GetIfExistsAsync(channelName); BotChannelResource result = response.HasValue ? response.Value : null; @@ -667,8 +617,8 @@ public async Task GetIfExists_GetDirectLineSpeechChannel() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetLineChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetLineChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetLineChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -687,7 +637,7 @@ public async Task GetIfExists_GetLineChannel() BotChannelCollection collection = bot.GetBotChannels(); // invoke the operation - BotChannelName channelName = BotChannelName.LineChannel; + string channelName = "LineChannel"; NullableResponse response = await collection.GetIfExistsAsync(channelName); BotChannelResource result = response.HasValue ? response.Value : null; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotChannelResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotChannelResource.cs index 977516519f7c..2c8b1d3705fc 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotChannelResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotChannelResource.cs @@ -20,8 +20,8 @@ public partial class Sample_BotChannelResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAlexaChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetAlexaChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetAlexaChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -33,7 +33,7 @@ public async Task Get_GetAlexaChannel() string subscriptionId = "subscription-id"; string resourceGroupName = "OneResourceGroupName"; string resourceName = "samplebotname"; - BotChannelName channelName = BotChannelName.AlexaChannel; + string channelName = "AlexaChannel"; ResourceIdentifier botChannelResourceId = BotChannelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, channelName); BotChannelResource botChannel = client.GetBotChannelResource(botChannelResourceId); @@ -51,8 +51,8 @@ public async Task Get_GetAlexaChannel() [Ignore("Only validating compilation of examples")] public async Task Get_GetChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -64,7 +64,7 @@ public async Task Get_GetChannel() string subscriptionId = "subscription-id"; string resourceGroupName = "OneResourceGroupName"; string resourceName = "samplebotname"; - BotChannelName channelName = BotChannelName.EmailChannel; + string channelName = "EmailChannel"; ResourceIdentifier botChannelResourceId = BotChannelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, channelName); BotChannelResource botChannel = client.GetBotChannelResource(botChannelResourceId); @@ -82,8 +82,8 @@ public async Task Get_GetChannel() [Ignore("Only validating compilation of examples")] public async Task Get_GetDirectLineSpeechChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetDirectLineSpeechChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetDirectLineSpeechChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -95,7 +95,7 @@ public async Task Get_GetDirectLineSpeechChannel() string subscriptionId = "subscription-id"; string resourceGroupName = "OneResourceGroupName"; string resourceName = "samplebotname"; - BotChannelName channelName = BotChannelName.DirectLineSpeechChannel; + string channelName = "DirectLineSpeechChannel"; ResourceIdentifier botChannelResourceId = BotChannelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, channelName); BotChannelResource botChannel = client.GetBotChannelResource(botChannelResourceId); @@ -113,8 +113,8 @@ public async Task Get_GetDirectLineSpeechChannel() [Ignore("Only validating compilation of examples")] public async Task Get_GetLineChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetLineChannel.json - // this example is just showing the usage of "Channels_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetLineChannel.json + // this example is just showing the usage of "BotChannel_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -126,7 +126,7 @@ public async Task Get_GetLineChannel() string subscriptionId = "subscription-id"; string resourceGroupName = "OneResourceGroupName"; string resourceName = "samplebotname"; - BotChannelName channelName = BotChannelName.LineChannel; + string channelName = "LineChannel"; ResourceIdentifier botChannelResourceId = BotChannelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, channelName); BotChannelResource botChannel = client.GetBotChannelResource(botChannelResourceId); @@ -144,8 +144,8 @@ public async Task Get_GetLineChannel() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteChannel.json - // this example is just showing the usage of "Channels_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/DeleteChannel.json + // this example is just showing the usage of "BotChannel_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -157,7 +157,7 @@ public async Task Delete_DeleteChannel() string subscriptionId = "subscription-id"; string resourceGroupName = "OneResourceGroupName"; string resourceName = "samplebotname"; - BotChannelName channelName = BotChannelName.EmailChannel; + string channelName = "EmailChannel"; ResourceIdentifier botChannelResourceId = BotChannelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, channelName); BotChannelResource botChannel = client.GetBotChannelResource(botChannelResourceId); @@ -171,8 +171,8 @@ public async Task Delete_DeleteChannel() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteDirectLineSpeechChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteDirectLineSpeechChannel.json - // this example is just showing the usage of "Channels_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/DeleteDirectLineSpeechChannel.json + // this example is just showing the usage of "BotChannel_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -184,7 +184,7 @@ public async Task Delete_DeleteDirectLineSpeechChannel() string subscriptionId = "subscription-id"; string resourceGroupName = "OneResourceGroupName"; string resourceName = "samplebotname"; - BotChannelName channelName = BotChannelName.DirectLineSpeechChannel; + string channelName = "DirectLineSpeechChannel"; ResourceIdentifier botChannelResourceId = BotChannelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, channelName); BotChannelResource botChannel = client.GetBotChannelResource(botChannelResourceId); @@ -198,8 +198,8 @@ public async Task Delete_DeleteDirectLineSpeechChannel() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAlexaChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateAlexaChannel.json - // this example is just showing the usage of "Channels_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/UpdateAlexaChannel.json + // this example is just showing the usage of "BotChannel_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -211,18 +211,12 @@ public async Task Update_UpdateAlexaChannel() string subscriptionId = "subscription-id"; string resourceGroupName = "OneResourceGroupName"; string resourceName = "samplebotname"; - BotChannelName channelName = BotChannelName.AlexaChannel; + string channelName = "AlexaChannel"; ResourceIdentifier botChannelResourceId = BotChannelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, channelName); BotChannelResource botChannel = client.GetBotChannelResource(botChannelResourceId); // invoke the operation - BotChannelData data = new BotChannelData(new AzureLocation("global")) - { - Properties = new AlexaChannel - { - Properties = new AlexaChannelProperties("XAlexaSkillIdX", true), - }, - }; + BotChannelData data = new BotChannelData(default); BotChannelResource result = await botChannel.UpdateAsync(data); // the variable result is a resource, you could call other operations on this instance as well @@ -236,8 +230,8 @@ public async Task Update_UpdateAlexaChannel() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateChannel.json - // this example is just showing the usage of "Channels_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/UpdateChannel.json + // this example is just showing the usage of "BotChannel_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -249,21 +243,12 @@ public async Task Update_UpdateChannel() string subscriptionId = "subscription-id"; string resourceGroupName = "OneResourceGroupName"; string resourceName = "samplebotname"; - BotChannelName channelName = BotChannelName.EmailChannel; + string channelName = "EmailChannel"; ResourceIdentifier botChannelResourceId = BotChannelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, channelName); BotChannelResource botChannel = client.GetBotChannelResource(botChannelResourceId); // invoke the operation - BotChannelData data = new BotChannelData(new AzureLocation("global")) - { - Properties = new EmailChannel - { - Properties = new EmailChannelProperties("a@b.com", true) - { - Password = "pwd", - }, - }, - }; + BotChannelData data = new BotChannelData(default); BotChannelResource result = await botChannel.UpdateAsync(data); // the variable result is a resource, you could call other operations on this instance as well @@ -277,8 +262,8 @@ public async Task Update_UpdateChannel() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateDirectLineSpeechChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateDirectLineSpeechChannel.json - // this example is just showing the usage of "Channels_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/UpdateDirectLineSpeechChannel.json + // this example is just showing the usage of "BotChannel_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -290,23 +275,12 @@ public async Task Update_UpdateDirectLineSpeechChannel() string subscriptionId = "subscription-id"; string resourceGroupName = "OneResourceGroupName"; string resourceName = "samplebotname"; - BotChannelName channelName = BotChannelName.DirectLineSpeechChannel; + string channelName = "DirectLineSpeechChannel"; ResourceIdentifier botChannelResourceId = BotChannelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, channelName); BotChannelResource botChannel = client.GetBotChannelResource(botChannelResourceId); // invoke the operation - BotChannelData data = new BotChannelData(new AzureLocation("global")) - { - Properties = new DirectLineSpeechChannel - { - Properties = new DirectLineSpeechChannelProperties - { - CognitiveServiceRegion = "XcognitiveServiceRegionX", - CognitiveServiceSubscriptionKey = "XcognitiveServiceSubscriptionKeyX", - IsEnabled = true, - }, - }, - }; + BotChannelData data = new BotChannelData(default); BotChannelResource result = await botChannel.UpdateAsync(data); // the variable result is a resource, you could call other operations on this instance as well @@ -320,8 +294,8 @@ public async Task Update_UpdateDirectLineSpeechChannel() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateLineChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateLineChannel.json - // this example is just showing the usage of "Channels_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/UpdateLineChannel.json + // this example is just showing the usage of "BotChannel_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -333,25 +307,12 @@ public async Task Update_UpdateLineChannel() string subscriptionId = "subscription-id"; string resourceGroupName = "OneResourceGroupName"; string resourceName = "samplebotname"; - BotChannelName channelName = BotChannelName.LineChannel; + string channelName = "LineChannel"; ResourceIdentifier botChannelResourceId = BotChannelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, channelName); BotChannelResource botChannel = client.GetBotChannelResource(botChannelResourceId); // invoke the operation - BotChannelData data = new BotChannelData(new AzureLocation("global")) - { - Properties = new LineChannel - { - Properties = new LineChannelProperties(new LineRegistration[] - { -new LineRegistration -{ -ChannelSecret = "channelSecret", -ChannelAccessToken = "channelAccessToken", -} - }), - }, - }; + BotChannelData data = new BotChannelData(default); BotChannelResource result = await botChannel.UpdateAsync(data); // the variable result is a resource, you could call other operations on this instance as well @@ -363,10 +324,10 @@ public async Task Update_UpdateLineChannel() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetChannelWithKeys_ListChannel() + public async Task GetWithKeys_ListChannel() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListChannel.json - // this example is just showing the usage of "Channels_ListWithKeys" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/ListChannel.json + // this example is just showing the usage of "BotChannels_ListWithKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -378,14 +339,78 @@ public async Task GetChannelWithKeys_ListChannel() string subscriptionId = "subscription-id"; string resourceGroupName = "OneResourceGroupName"; string resourceName = "samplebotname"; - BotChannelName channelName = BotChannelName.EmailChannel; + string channelName = "EmailChannel"; ResourceIdentifier botChannelResourceId = BotChannelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, channelName); BotChannelResource botChannel = client.GetBotChannelResource(botChannelResourceId); // invoke the operation - BotChannelGetWithKeysResult result = await botChannel.GetChannelWithKeysAsync(); + ListChannelWithKeysResponse result = await botChannel.GetWithKeysAsync(); Console.WriteLine($"Succeeded: {result}"); } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task RegenerateKeys_RegenerateKeysForDirectLineChannelSite() + { + // Generated from example definition: 2023-09-15-preview/DirectlineRegenerateKeys.json + // this example is just showing the usage of "BotChannels_RegenerateKeys" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BotChannelResource created on azure + // for more information of creating BotChannelResource, please refer to the document of BotChannelResource + string subscriptionId = "subscription-id"; + string resourceGroupName = "OneResourceGroupName"; + string resourceName = "samplebotname"; + string channelName = "DirectLineChannel"; + ResourceIdentifier botChannelResourceId = BotChannelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, channelName); + BotChannelResource botChannel = client.GetBotChannelResource(botChannelResourceId); + + // invoke the operation + SiteContent content = new SiteContent(null, default); + BotChannelResource result = await botChannel.RegenerateKeysAsync(content); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BotChannelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task RegenerateKeys_RegenerateKeysForWebChatChannelSite() + { + // Generated from example definition: 2023-09-15-preview/WebChatRegenerateKeys.json + // this example is just showing the usage of "BotChannels_RegenerateKeys" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BotChannelResource created on azure + // for more information of creating BotChannelResource, please refer to the document of BotChannelResource + string subscriptionId = "subscription-id"; + string resourceGroupName = "OneResourceGroupName"; + string resourceName = "samplebotname"; + string channelName = "WebChatChannel"; + ResourceIdentifier botChannelResourceId = BotChannelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, channelName); + BotChannelResource botChannel = client.GetBotChannelResource(botChannelResourceId); + + // invoke the operation + SiteContent content = new SiteContent(null, default); + BotChannelResource result = await botChannel.RegenerateKeysAsync(content); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + BotChannelData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotCollection.cs index 10bc0f645329..726689ac70fe 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotCollection.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.BotService.Models; using Azure.ResourceManager.Resources; using NUnit.Framework; @@ -21,8 +20,8 @@ public partial class Sample_BotCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateBot() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateBot.json - // this example is just showing the usage of "Bots_Create" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/CreateBot.json + // this example is just showing the usage of "Bot_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -41,35 +40,7 @@ public async Task CreateOrUpdate_CreateBot() // invoke the operation string resourceName = "samplebotname"; - BotData data = new BotData(new AzureLocation("West US")) - { - Properties = new BotProperties("The Name of the bot", new Uri("http://mybot.coffee"), "exampleappid") - { - Description = "The description of the bot", - IconUri = new Uri("http://myicon"), - MsaAppType = BotMsaAppType.UserAssignedMSI, - MsaAppTenantId = "exampleapptenantid", - MsaAppMSIResourceId = new ResourceIdentifier("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), - DeveloperAppInsightKey = "appinsightskey", - DeveloperAppInsightsApiKey = "appinsightsapikey", - DeveloperAppInsightsApplicationId = "appinsightsappid", - LuisAppIds = { "luisappid1", "luisappid2" }, - LuisKey = "luiskey", - IsCmekEnabled = true, - CmekKeyVaultUri = new Uri("https://myCmekKey"), - PublicNetworkAccess = BotServicePublicNetworkAccess.Enabled, - IsLocalAuthDisabled = true, - SchemaTransformationVersion = "1.0", - }, - Sku = new BotServiceSku(BotServiceSkuName.S1), - Kind = BotServiceKind.Sdk, - ETag = new ETag("etag1"), - Tags = -{ -["tag1"] = "value1", -["tag2"] = "value2" -}, - }; + BotData data = new BotData(default); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, resourceName, data); BotResource result = lro.Value; @@ -84,8 +55,8 @@ public async Task CreateOrUpdate_CreateBot() [Ignore("Only validating compilation of examples")] public async Task Get_GetBot() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetBot.json - // this example is just showing the usage of "Bots_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetBot.json + // this example is just showing the usage of "Bot_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -117,8 +88,8 @@ public async Task Get_GetBot() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListBotsByResourceGroup() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsByResourceGroup.json - // this example is just showing the usage of "Bots_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/ListBotsByResourceGroup.json + // this example is just showing the usage of "Bot_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -152,8 +123,8 @@ public async Task GetAll_ListBotsByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetBot() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetBot.json - // this example is just showing the usage of "Bots_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetBot.json + // this example is just showing the usage of "Bot_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -181,8 +152,8 @@ public async Task Exists_GetBot() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetBot() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetBot.json - // this example is just showing the usage of "Bots_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetBot.json + // this example is just showing the usage of "Bot_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotResource.cs index 1432e581299b..c27bf1dbebf5 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotResource.cs @@ -20,8 +20,8 @@ public partial class Sample_BotResource [Ignore("Only validating compilation of examples")] public async Task Get_GetBot() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetBot.json - // this example is just showing the usage of "Bots_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetBot.json + // this example is just showing the usage of "Bot_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -50,8 +50,8 @@ public async Task Get_GetBot() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteBot() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeleteBot.json - // this example is just showing the usage of "Bots_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/DeleteBot.json + // this example is just showing the usage of "Bot_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -76,8 +76,8 @@ public async Task Delete_DeleteBot() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateBot() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/UpdateBot.json - // this example is just showing the usage of "Bots_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/UpdateBot.json + // this example is just showing the usage of "Bot_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -93,35 +93,7 @@ public async Task Update_UpdateBot() BotResource bot = client.GetBotResource(botResourceId); // invoke the operation - BotData data = new BotData(new AzureLocation("West US")) - { - Properties = new BotProperties("The Name of the bot", new Uri("http://mybot.coffee"), "msaappid") - { - Description = "The description of the bot", - IconUri = new Uri("http://myicon"), - MsaAppType = BotMsaAppType.UserAssignedMSI, - MsaAppTenantId = "msaapptenantid", - MsaAppMSIResourceId = new ResourceIdentifier("/subscriptions/foo/resourcegroups/bar/providers/microsoft.managedidentity/userassignedidentities/sampleId"), - DeveloperAppInsightKey = "appinsightskey", - DeveloperAppInsightsApiKey = "appinsightsapikey", - DeveloperAppInsightsApplicationId = "appinsightsappid", - LuisAppIds = { "luisappid1", "luisappid2" }, - LuisKey = "luiskey", - IsCmekEnabled = true, - CmekKeyVaultUri = new Uri("https://myCmekKey"), - PublicNetworkAccess = BotServicePublicNetworkAccess.Enabled, - IsLocalAuthDisabled = true, - SchemaTransformationVersion = "1.0", - }, - Sku = new BotServiceSku(BotServiceSkuName.S1), - Kind = BotServiceKind.Sdk, - ETag = new ETag("etag1"), - Tags = -{ -["tag1"] = "value1", -["tag2"] = "value2" -}, - }; + BotData data = new BotData(default); BotResource result = await bot.UpdateAsync(data); // the variable result is a resource, you could call other operations on this instance as well @@ -133,74 +105,10 @@ public async Task Update_UpdateBot() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetBotChannelWithRegenerateKeys_RegenerateKeysForDirectLineChannelSite() - { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DirectlineRegenerateKeys.json - // this example is just showing the usage of "DirectLine_RegenerateKeys" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this BotResource created on azure - // for more information of creating BotResource, please refer to the document of BotResource - string subscriptionId = "subscription-id"; - string resourceGroupName = "OneResourceGroupName"; - string resourceName = "samplebotname"; - ResourceIdentifier botResourceId = BotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - BotResource bot = client.GetBotResource(botResourceId); - - // invoke the operation - RegenerateKeysBotChannelName channelName = RegenerateKeysBotChannelName.DirectLineChannel; - BotChannelRegenerateKeysContent content = new BotChannelRegenerateKeysContent("testSiteName", BotServiceKey.Key1); - BotChannelResource result = await bot.GetBotChannelWithRegenerateKeysAsync(channelName, content); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - BotChannelData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetBotChannelWithRegenerateKeys_RegenerateKeysForWebChatChannelSite() - { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/WebChatRegenerateKeys.json - // this example is just showing the usage of "DirectLine_RegenerateKeys" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this BotResource created on azure - // for more information of creating BotResource, please refer to the document of BotResource - string subscriptionId = "subscription-id"; - string resourceGroupName = "OneResourceGroupName"; - string resourceName = "samplebotname"; - ResourceIdentifier botResourceId = BotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); - BotResource bot = client.GetBotResource(botResourceId); - - // invoke the operation - RegenerateKeysBotChannelName channelName = RegenerateKeysBotChannelName.WebChatChannel; - BotChannelRegenerateKeysContent content = new BotChannelRegenerateKeysContent("testSiteName", BotServiceKey.Key1); - BotChannelResource result = await bot.GetBotChannelWithRegenerateKeysAsync(channelName, content); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - BotChannelData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CreateEmailSignInUri_CreateUrl() + public async Task CreateSignInUrl_CreateUrl() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CreateEmailSignInUrl.json - // this example is just showing the usage of "Email_CreateSignInUrl" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/CreateEmailSignInUrl.json + // this example is just showing the usage of "Bots_CreateSignInUrl" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -216,17 +124,17 @@ public async Task CreateEmailSignInUri_CreateUrl() BotResource bot = client.GetBotResource(botResourceId); // invoke the operation - BotCreateEmailSignInUriResult result = await bot.CreateEmailSignInUriAsync(); + CreateEmailSignInUrlResponse result = await bot.CreateSignInUrlAsync(); Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task GetPrivateLinkResourcesByBotResource_ListPrivateLinkResources() + public async Task GetByBotResource_ListPrivateLinkResources() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateLinkResources.json - // this example is just showing the usage of "PrivateLinkResources_ListByBotResource" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/ListPrivateLinkResources.json + // this example is just showing the usage of "Bots_ListByBotResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -242,7 +150,7 @@ public async Task GetPrivateLinkResourcesByBotResource_ListPrivateLinkResources( BotResource bot = client.GetBotResource(botResourceId); // invoke the operation and iterate over the result - await foreach (BotServicePrivateLinkResourceData item in bot.GetPrivateLinkResourcesByBotResourceAsync()) + await foreach (BotServicePrivateLinkResourceData item in bot.GetByBotResourceAsync()) { Console.WriteLine($"Succeeded: {item}"); } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotServicePrivateEndpointConnectionCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotServicePrivateEndpointConnectionCollection.cs index fb863af897c7..8493cfdafe35 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotServicePrivateEndpointConnectionCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotServicePrivateEndpointConnectionCollection.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.BotService.Models; using NUnit.Framework; namespace Azure.ResourceManager.BotService.Samples @@ -20,8 +19,8 @@ public partial class Sample_BotServicePrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutPrivateEndpointConnection() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutPrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Create" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/PutPrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -41,14 +40,7 @@ public async Task CreateOrUpdate_PutPrivateEndpointConnection() // invoke the operation string privateEndpointConnectionName = "{privateEndpointConnectionName}"; - BotServicePrivateEndpointConnectionData data = new BotServicePrivateEndpointConnectionData - { - ConnectionState = new BotServicePrivateLinkServiceConnectionState - { - Status = BotServicePrivateEndpointServiceConnectionStatus.Approved, - Description = "Auto-Approved", - }, - }; + BotServicePrivateEndpointConnectionData data = new BotServicePrivateEndpointConnectionData(); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data); BotServicePrivateEndpointConnectionResource result = lro.Value; @@ -63,8 +55,8 @@ public async Task CreateOrUpdate_PutPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Get_GetPrivateEndpointConnection() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetPrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetPrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -97,8 +89,8 @@ public async Task Get_GetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListPrivateEndpointConnections() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListPrivateEndpointConnections.json - // this example is just showing the usage of "PrivateEndpointConnections_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/ListPrivateEndpointConnections.json + // this example is just showing the usage of "PrivateEndpointConnection_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -133,8 +125,8 @@ public async Task GetAll_ListPrivateEndpointConnections() [Ignore("Only validating compilation of examples")] public async Task Exists_GetPrivateEndpointConnection() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetPrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetPrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -163,8 +155,8 @@ public async Task Exists_GetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetPrivateEndpointConnection() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetPrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetPrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotServicePrivateEndpointConnectionResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotServicePrivateEndpointConnectionResource.cs index 5b4f9901494d..d6b984780814 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotServicePrivateEndpointConnectionResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_BotServicePrivateEndpointConnectionResource.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.BotService.Models; using NUnit.Framework; namespace Azure.ResourceManager.BotService.Samples @@ -20,8 +19,8 @@ public partial class Sample_BotServicePrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetPrivateEndpointConnection() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetPrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetPrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -51,8 +50,8 @@ public async Task Get_GetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_DeletePrivateEndpointConnection() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/DeletePrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/DeletePrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -78,8 +77,8 @@ public async Task Delete_DeletePrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Update_PutPrivateEndpointConnection() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/PutPrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Create" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/PutPrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -96,14 +95,7 @@ public async Task Update_PutPrivateEndpointConnection() BotServicePrivateEndpointConnectionResource botServicePrivateEndpointConnection = client.GetBotServicePrivateEndpointConnectionResource(botServicePrivateEndpointConnectionResourceId); // invoke the operation - BotServicePrivateEndpointConnectionData data = new BotServicePrivateEndpointConnectionData - { - ConnectionState = new BotServicePrivateLinkServiceConnectionState - { - Status = BotServicePrivateEndpointServiceConnectionStatus.Approved, - Description = "Auto-Approved", - }, - }; + BotServicePrivateEndpointConnectionData data = new BotServicePrivateEndpointConnectionData(); ArmOperation lro = await botServicePrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); BotServicePrivateEndpointConnectionResource result = lro.Value; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_ConnectionSettingCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_ConnectionSettingCollection.cs new file mode 100644 index 000000000000..777225004bee --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_ConnectionSettingCollection.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.BotService.Samples +{ + public partial class Sample_ConnectionSettingCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateConnectionSetting() + { + // Generated from example definition: 2023-09-15-preview/PutConnection.json + // this example is just showing the usage of "ConnectionSetting_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BotResource created on azure + // for more information of creating BotResource, please refer to the document of BotResource + string subscriptionId = "subscription-id"; + string resourceGroupName = "OneResourceGroupName"; + string resourceName = "samplebotname"; + ResourceIdentifier botResourceId = BotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + BotResource bot = client.GetBotResource(botResourceId); + + // get the collection of this ConnectionSettingResource + ConnectionSettingCollection collection = bot.GetConnectionSettings(); + + // invoke the operation + string connectionName = "sampleConnection"; + ConnectionSettingData data = new ConnectionSettingData(default); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, connectionName, data); + ConnectionSettingResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectionSettingData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListConnectionSettings() + { + // Generated from example definition: 2023-09-15-preview/ListConnectionsByBotService.json + // this example is just showing the usage of "ConnectionSetting_ListByBotService" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BotResource created on azure + // for more information of creating BotResource, please refer to the document of BotResource + string subscriptionId = "subscription-id"; + string resourceGroupName = "OneResourceGroupName"; + string resourceName = "samplebotname"; + ResourceIdentifier botResourceId = BotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + BotResource bot = client.GetBotResource(botResourceId); + + // get the collection of this ConnectionSettingResource + ConnectionSettingCollection collection = bot.GetConnectionSettings(); + + // invoke the operation and iterate over the result + await foreach (ConnectionSettingResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectionSettingData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_ConnectionSettingResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_ConnectionSettingResource.cs new file mode 100644 index 000000000000..0bd2e4d07c66 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_ConnectionSettingResource.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.BotService.Samples +{ + public partial class Sample_ConnectionSettingResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeleteConnectionSetting() + { + // Generated from example definition: 2023-09-15-preview/DeleteConnection.json + // this example is just showing the usage of "ConnectionSetting_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectionSettingResource created on azure + // for more information of creating ConnectionSettingResource, please refer to the document of ConnectionSettingResource + string subscriptionId = "subscription-id"; + string resourceGroupName = "OneResourceGroupName"; + string resourceName = "samplebotname"; + string connectionName = "sampleConnection"; + ResourceIdentifier connectionSettingResourceId = ConnectionSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, connectionName); + ConnectionSettingResource connectionSetting = client.GetConnectionSettingResource(connectionSettingResourceId); + + // invoke the operation + await connectionSetting.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateConnectionSetting() + { + // Generated from example definition: 2023-09-15-preview/UpdateConnection.json + // this example is just showing the usage of "ConnectionSetting_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectionSettingResource created on azure + // for more information of creating ConnectionSettingResource, please refer to the document of ConnectionSettingResource + string subscriptionId = "subscription-id"; + string resourceGroupName = "OneResourceGroupName"; + string resourceName = "samplebotname"; + string connectionName = "sampleConnection"; + ResourceIdentifier connectionSettingResourceId = ConnectionSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, connectionName); + ConnectionSettingResource connectionSetting = client.GetConnectionSettingResource(connectionSettingResourceId); + + // invoke the operation + ConnectionSettingData data = new ConnectionSettingData(default); + ConnectionSettingResource result = await connectionSetting.UpdateAsync(data); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectionSettingData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetWithSecrets_ListConnectionSettingWithSecrets() + { + // Generated from example definition: 2023-09-15-preview/GetConnection.json + // this example is just showing the usage of "ConnectionSettings_ListWithSecrets" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ConnectionSettingResource created on azure + // for more information of creating ConnectionSettingResource, please refer to the document of ConnectionSettingResource + string subscriptionId = "subscription-id"; + string resourceGroupName = "OneResourceGroupName"; + string resourceName = "samplebotname"; + string connectionName = "sampleConnection"; + ResourceIdentifier connectionSettingResourceId = ConnectionSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, connectionName); + ConnectionSettingResource connectionSetting = client.GetConnectionSettingResource(connectionSettingResourceId); + + // invoke the operation + ConnectionSettingResource result = await connectionSetting.GetWithSecretsAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ConnectionSettingData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs new file mode 100644 index 000000000000..d71b59c0cd71 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.BotService.Samples +{ + public partial class Sample_NetworkSecurityPerimeterConfigurationCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetNetworkSecurityPerimeterConfiguration() + { + // Generated from example definition: 2023-09-15-preview/GetNetworkSecurityPerimeterConfiguration.json + // this example is just showing the usage of "NetworkSecurityPerimeterConfiguration_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BotResource created on azure + // for more information of creating BotResource, please refer to the document of BotResource + string subscriptionId = "subId"; + string resourceGroupName = "rgName"; + string resourceName = "botId"; + ResourceIdentifier botResourceId = BotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + BotResource bot = client.GetBotResource(botResourceId); + + // get the collection of this NetworkSecurityPerimeterConfigurationResource + NetworkSecurityPerimeterConfigurationCollection collection = bot.GetNetworkSecurityPerimeterConfigurations(); + + // invoke the operation + string networkSecurityPerimeterConfigurationName = "00000000-0000-0000-0000-000000000000.associationName"; + NetworkSecurityPerimeterConfigurationResource result = await collection.GetAsync(networkSecurityPerimeterConfigurationName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NetworkSecurityPerimeterConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListNetworkSecurityPerimeterConfigurations() + { + // Generated from example definition: 2023-09-15-preview/ListNetworkSecurityPerimeterConfigurations.json + // this example is just showing the usage of "NetworkSecurityPerimeterConfiguration_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BotResource created on azure + // for more information of creating BotResource, please refer to the document of BotResource + string subscriptionId = "subId"; + string resourceGroupName = "rgName"; + string resourceName = "botId"; + ResourceIdentifier botResourceId = BotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + BotResource bot = client.GetBotResource(botResourceId); + + // get the collection of this NetworkSecurityPerimeterConfigurationResource + NetworkSecurityPerimeterConfigurationCollection collection = bot.GetNetworkSecurityPerimeterConfigurations(); + + // invoke the operation and iterate over the result + await foreach (NetworkSecurityPerimeterConfigurationResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NetworkSecurityPerimeterConfigurationData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetNetworkSecurityPerimeterConfiguration() + { + // Generated from example definition: 2023-09-15-preview/GetNetworkSecurityPerimeterConfiguration.json + // this example is just showing the usage of "NetworkSecurityPerimeterConfiguration_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BotResource created on azure + // for more information of creating BotResource, please refer to the document of BotResource + string subscriptionId = "subId"; + string resourceGroupName = "rgName"; + string resourceName = "botId"; + ResourceIdentifier botResourceId = BotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + BotResource bot = client.GetBotResource(botResourceId); + + // get the collection of this NetworkSecurityPerimeterConfigurationResource + NetworkSecurityPerimeterConfigurationCollection collection = bot.GetNetworkSecurityPerimeterConfigurations(); + + // invoke the operation + string networkSecurityPerimeterConfigurationName = "00000000-0000-0000-0000-000000000000.associationName"; + bool result = await collection.ExistsAsync(networkSecurityPerimeterConfigurationName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetNetworkSecurityPerimeterConfiguration() + { + // Generated from example definition: 2023-09-15-preview/GetNetworkSecurityPerimeterConfiguration.json + // this example is just showing the usage of "NetworkSecurityPerimeterConfiguration_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BotResource created on azure + // for more information of creating BotResource, please refer to the document of BotResource + string subscriptionId = "subId"; + string resourceGroupName = "rgName"; + string resourceName = "botId"; + ResourceIdentifier botResourceId = BotResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName); + BotResource bot = client.GetBotResource(botResourceId); + + // get the collection of this NetworkSecurityPerimeterConfigurationResource + NetworkSecurityPerimeterConfigurationCollection collection = bot.GetNetworkSecurityPerimeterConfigurations(); + + // invoke the operation + string networkSecurityPerimeterConfigurationName = "00000000-0000-0000-0000-000000000000.associationName"; + NullableResponse response = await collection.GetIfExistsAsync(networkSecurityPerimeterConfigurationName); + NetworkSecurityPerimeterConfigurationResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NetworkSecurityPerimeterConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs new file mode 100644 index 000000000000..73481afaec8d --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.BotService.Samples +{ + public partial class Sample_NetworkSecurityPerimeterConfigurationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetNetworkSecurityPerimeterConfiguration() + { + // Generated from example definition: 2023-09-15-preview/GetNetworkSecurityPerimeterConfiguration.json + // this example is just showing the usage of "NetworkSecurityPerimeterConfiguration_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NetworkSecurityPerimeterConfigurationResource created on azure + // for more information of creating NetworkSecurityPerimeterConfigurationResource, please refer to the document of NetworkSecurityPerimeterConfigurationResource + string subscriptionId = "subId"; + string resourceGroupName = "rgName"; + string resourceName = "botId"; + string networkSecurityPerimeterConfigurationName = "00000000-0000-0000-0000-000000000000.associationName"; + ResourceIdentifier networkSecurityPerimeterConfigurationResourceId = NetworkSecurityPerimeterConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, networkSecurityPerimeterConfigurationName); + NetworkSecurityPerimeterConfigurationResource networkSecurityPerimeterConfiguration = client.GetNetworkSecurityPerimeterConfigurationResource(networkSecurityPerimeterConfigurationResourceId); + + // invoke the operation + NetworkSecurityPerimeterConfigurationResource result = await networkSecurityPerimeterConfiguration.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NetworkSecurityPerimeterConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Reconcile_ReconcileNetworkSecurityPerimeterConfiguration() + { + // Generated from example definition: 2023-09-15-preview/ReconcileNetworkSecurityPerimeterConfiguration.json + // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Reconcile" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this NetworkSecurityPerimeterConfigurationResource created on azure + // for more information of creating NetworkSecurityPerimeterConfigurationResource, please refer to the document of NetworkSecurityPerimeterConfigurationResource + string subscriptionId = "subId"; + string resourceGroupName = "rgName"; + string resourceName = "botId"; + string networkSecurityPerimeterConfigurationName = "00000000-0000-0000-0000-000000000000.associationName"; + ResourceIdentifier networkSecurityPerimeterConfigurationResourceId = NetworkSecurityPerimeterConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, resourceName, networkSecurityPerimeterConfigurationName); + NetworkSecurityPerimeterConfigurationResource networkSecurityPerimeterConfiguration = client.GetNetworkSecurityPerimeterConfigurationResource(networkSecurityPerimeterConfigurationResourceId); + + // invoke the operation + ArmOperation lro = await networkSecurityPerimeterConfiguration.ReconcileAsync(WaitUntil.Completed); + NetworkSecurityPerimeterConfigurationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + NetworkSecurityPerimeterConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index fba99f5674d0..c279ea6ca6ef 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,8 +21,8 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetBots_ListBotsBySubscription() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListBotsBySubscription.json - // this example is just showing the usage of "Bots_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/ListBotsBySubscription.json + // this example is just showing the usage of "Bot_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -50,10 +50,10 @@ public async Task GetBots_ListBotsBySubscription() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetBotConnectionServiceProviders_ListAuthServiceProviders() + public async Task GetServiceProvidersBotConnectionOperationGroups_ListAuthServiceProviders() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListServiceProviders.json - // this example is just showing the usage of "BotConnection_ListServiceProviders" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/ListServiceProviders.json + // this example is just showing the usage of "BotConnectionOperationGroup_ListServiceProviders" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -67,7 +67,7 @@ public async Task GetBotConnectionServiceProviders_ListAuthServiceProviders() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - await foreach (BotServiceProvider item in subscriptionResource.GetBotConnectionServiceProvidersAsync()) + await foreach (ServiceProvider item in subscriptionResource.GetServiceProvidersBotConnectionOperationGroupsAsync()) { Console.WriteLine($"Succeeded: {item}"); } @@ -77,10 +77,10 @@ public async Task GetBotConnectionServiceProviders_ListAuthServiceProviders() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetBotServiceQnAMakerEndpointKey_ListQnAMakerEndpointKeys() + public async Task GetQnAMakerEndpointKeysOperationGroup_ListQnAMakerEndpointKeys() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/ListQnAMakerEndpointKeys.json - // this example is just showing the usage of "QnAMakerEndpointKeys_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/ListQnAMakerEndpointKeys.json + // this example is just showing the usage of "QnAMakerEndpointKeysOperationGroup_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -94,22 +94,18 @@ public async Task GetBotServiceQnAMakerEndpointKey_ListQnAMakerEndpointKeys() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - GetBotServiceQnAMakerEndpointKeyContent content = new GetBotServiceQnAMakerEndpointKeyContent - { - Hostname = "https://xxx.cognitiveservices.azure.com/", - Authkey = "testAuthKey", - }; - GetBotServiceQnAMakerEndpointKeyResult result = await subscriptionResource.GetBotServiceQnAMakerEndpointKeyAsync(content); + QnAMakerEndpointKeysRequestBody qnAMakerEndpointKeysRequestBody = new QnAMakerEndpointKeysRequestBody(); + QnAMakerEndpointKeysResponse result = await subscriptionResource.GetQnAMakerEndpointKeysOperationGroupAsync(qnAMakerEndpointKeysRequestBody); Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task GetBotServiceHostSettings_GetBotHostSettings() + public async Task GetHostSettingsOperationGroup_GetBotHostSettings() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/GetHostSettings.json - // this example is just showing the usage of "HostSettings_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetHostSettings.json + // this example is just showing the usage of "HostSettingsOperationGroup_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -123,7 +119,33 @@ public async Task GetBotServiceHostSettings_GetBotHostSettings() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - BotServiceHostSettingsResult result = await subscriptionResource.GetBotServiceHostSettingsAsync(); + HostSettingsResponse result = await subscriptionResource.GetHostSettingsOperationGroupAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetOperationResultsOperationGroup_GetOperationResult() + { + // Generated from example definition: 2023-09-15-preview/OperationResultsGet.json + // this example is just showing the usage of "OperationResultsOperationGroup_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "subid"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string operationResultId = "exampleid"; + ArmOperation lro = await subscriptionResource.GetOperationResultsOperationGroupAsync(WaitUntil.Completed, operationResultId); + OperationResultsDescription result = lro.Value; Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_TenantResourceExtensions.cs b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_TenantResourceExtensions.cs index 5c443b382323..7a4158a61189 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_TenantResourceExtensions.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/samples/Generated/Samples/Sample_TenantResourceExtensions.cs @@ -19,10 +19,10 @@ public partial class Sample_TenantResourceExtensions { [Test] [Ignore("Only validating compilation of examples")] - public async Task CheckBotServiceNameAvailability_CheckNameAvailability() + public async Task GetOperations_GetOperations() { - // Generated from example definition: specification/botservice/resource-manager/Microsoft.BotService/stable/2022-09-15/examples/CheckNameAvailability.json - // this example is just showing the usage of "Bots_GetCheckNameAvailability" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2023-09-15-preview/GetOperations.json + // this example is just showing the usage of "Operations_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -31,13 +31,32 @@ public async Task CheckBotServiceNameAvailability_CheckNameAvailability() TenantResource tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; - // invoke the operation - BotServiceNameAvailabilityContent content = new BotServiceNameAvailabilityContent + // invoke the operation and iterate over the result + await foreach (OperationEntity item in tenantResource.GetOperationsAsync()) { - Name = "testbotname", - ResourceType = new ResourceType("string"), - }; - BotServiceNameAvailabilityResult result = await tenantResource.CheckBotServiceNameAvailabilityAsync(content); + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetCheckNameAvailabilityBotsOperationGroup_CheckNameAvailability() + { + // Generated from example definition: 2023-09-15-preview/CheckNameAvailability.json + // this example is just showing the usage of "BotsOperationGroup_GetCheckNameAvailability" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + TenantResource tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; + + // invoke the operation + CheckNameAvailabilityRequestBody checkNameAvailabilityRequestBody = new CheckNameAvailabilityRequestBody(); + CheckNameAvailabilityResponseBody result = await tenantResource.GetCheckNameAvailabilityBotsOperationGroupAsync(checkNameAvailabilityRequestBody); Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ArmBotServiceModelFactory.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ArmBotServiceModelFactory.cs index cfb71b347d72..1cf9fae7eef2 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ArmBotServiceModelFactory.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ArmBotServiceModelFactory.cs @@ -10,12 +10,35 @@ using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.BotService.Models { /// Model factory for models. public static partial class ArmBotServiceModelFactory { + /// Initializes a new instance of . + /// Operation name: {provider}/{resource}/{operation}. + /// The operation supported by Bot Service Management. + /// The origin of the operation. + /// Additional properties. + /// A new instance for mocking. + public static OperationEntity OperationEntity(string name = null, OperationDisplayInfo display = null, string origin = null, BinaryData properties = null) + { + return new OperationEntity(name, display, origin, properties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The description of the operation. + /// The action that users can perform, based on their permission level. + /// Service provider: Microsoft Bot Service. + /// Resource on which the operation is performed. + /// A new instance for mocking. + public static OperationDisplayInfo OperationDisplayInfo(string description = null, string operation = null, string provider = null, string resource = null) + { + return new OperationDisplayInfo(description, operation, provider, resource, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -29,7 +52,7 @@ public static partial class ArmBotServiceModelFactory /// Entity Tag. /// Entity zones. /// A new instance for mocking. - public static BotData BotData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, BotProperties properties = null, BotServiceSku sku = null, BotServiceKind? kind = null, ETag? etag = null, IEnumerable zones = null) + public static BotData BotData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, BotProperties properties = null, BotServiceSku sku = null, BotServiceKind? kind = null, string etag = null, IEnumerable zones = null) { tags ??= new Dictionary(); zones ??= new List(); @@ -77,16 +100,17 @@ public static BotData BotData(ResourceIdentifier id = null, string name = null, /// Whether the bot is streaming supported. /// Whether the bot is developerAppInsightsApiKey set. /// Token used to migrate non Azure bot to azure subscription. - /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. + /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The channel schema transformation version for the bot. /// The storage resourceId for the bot. /// List of Private Endpoint Connections configured for the bot. + /// List of Network Security Perimeter configurations for the bot. /// The hint to browser (e.g. protocol handler) on how to open the bot for authoring. /// The hint (e.g. keyVault secret resourceId) on how to fetch the app secret. /// Provisioning state of the resource. /// Publishing credentials of the resource. /// A new instance for mocking. - public static BotProperties BotProperties(string displayName = null, string description = null, Uri iconUri = null, Uri endpoint = null, string endpointVersion = null, IDictionary allSettings = null, IDictionary parameters = null, Uri manifestUri = null, BotMsaAppType? msaAppType = null, string msaAppId = null, string msaAppTenantId = null, ResourceIdentifier msaAppMSIResourceId = null, IEnumerable configuredChannels = null, IEnumerable enabledChannels = null, string developerAppInsightKey = null, string developerAppInsightsApiKey = null, string developerAppInsightsApplicationId = null, IEnumerable luisAppIds = null, string luisKey = null, bool? isCmekEnabled = null, Uri cmekKeyVaultUri = null, string cmekEncryptionStatus = null, Guid? tenantId = null, BotServicePublicNetworkAccess? publicNetworkAccess = null, bool? isStreamingSupported = null, bool? isDeveloperAppInsightsApiKeySet = null, string migrationToken = null, bool? isLocalAuthDisabled = null, string schemaTransformationVersion = null, ResourceIdentifier storageResourceId = null, IEnumerable privateEndpointConnections = null, string openWithHint = null, string appPasswordHint = null, string provisioningState = null, string publishingCredentials = null) + public static BotProperties BotProperties(string displayName = null, string description = null, string iconUri = null, string endpoint = null, string endpointVersion = null, IDictionary allSettings = null, IDictionary parameters = null, string manifestUri = null, MsaAppType? msaAppType = null, string msaAppId = null, string msaAppTenantId = null, string msaAppMSIResourceId = null, IEnumerable configuredChannels = null, IEnumerable enabledChannels = null, string developerAppInsightKey = null, string developerAppInsightsApiKey = null, string developerAppInsightsApplicationId = null, IEnumerable luisAppIds = null, string luisKey = null, bool? isCmekEnabled = null, string cmekKeyVaultUri = null, string cmekEncryptionStatus = null, string tenantId = null, PublicNetworkAccess? publicNetworkAccess = null, bool? isStreamingSupported = null, bool? isDeveloperAppInsightsApiKeySet = null, string migrationToken = null, bool? disableLocalAuth = null, string schemaTransformationVersion = null, string storageResourceId = null, IEnumerable privateEndpointConnections = null, IEnumerable networkSecurityPerimeterConfigurations = null, string openWithHint = null, string appPasswordHint = null, string provisioningState = null, string publishingCredentials = null) { allSettings ??= new Dictionary(); parameters ??= new Dictionary(); @@ -94,6 +118,7 @@ public static BotProperties BotProperties(string displayName = null, string desc enabledChannels ??= new List(); luisAppIds ??= new List(); privateEndpointConnections ??= new List(); + networkSecurityPerimeterConfigurations ??= new List(); return new BotProperties( displayName, @@ -123,10 +148,11 @@ public static BotProperties BotProperties(string displayName = null, string desc isStreamingSupported, isDeveloperAppInsightsApiKeySet, migrationToken, - isLocalAuthDisabled, + disableLocalAuth, schemaTransformationVersion, storageResourceId, privateEndpointConnections?.ToList(), + networkSecurityPerimeterConfigurations?.ToList(), openWithHint, appPasswordHint, provisioningState, @@ -140,11 +166,11 @@ public static BotProperties BotProperties(string displayName = null, string desc /// The resourceType. /// The systemData. /// The resource of private end point. - /// A collection of information about the state of the connection between service consumer and provider. + /// A collection of information about the state of the connection between service consumer and provider. /// The provisioning state of the private endpoint connection resource. /// Group ids. /// A new instance for mocking. - public static BotServicePrivateEndpointConnectionData BotServicePrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier privateEndpointId = null, BotServicePrivateLinkServiceConnectionState connectionState = null, BotServicePrivateEndpointConnectionProvisioningState? provisioningState = null, IEnumerable groupIds = null) + public static BotServicePrivateEndpointConnectionData BotServicePrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier privateEndpointId = null, BotServicePrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, BotServicePrivateEndpointConnectionProvisioningState? provisioningState = null, IEnumerable groupIds = null) { groupIds ??= new List(); @@ -154,332 +180,175 @@ public static BotServicePrivateEndpointConnectionData BotServicePrivateEndpointC resourceType, systemData, privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, - connectionState, + privateLinkServiceConnectionState, provisioningState, groupIds?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The sku name. - /// Gets the sku tier. This is based on the SKU name. - /// A new instance for mocking. - public static BotServiceSku BotServiceSku(BotServiceSkuName name = default, BotServiceSkuTier? tier = null) - { - return new BotServiceSku(name, tier, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The tags. - /// The location. - /// - /// The set of properties specific to bot channel resource - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , , , , , and . - /// - /// Gets or sets the SKU of the resource. - /// Required. Gets or sets the Kind of the resource. - /// Entity Tag. - /// Entity zones. - /// A new instance for mocking. - public static BotChannelData BotChannelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, BotChannelProperties properties = null, BotServiceSku sku = null, BotServiceKind? kind = null, ETag? etag = null, IEnumerable zones = null) + /// Properties of the Network Security Perimeter configuration. + /// A new instance for mocking. + public static NetworkSecurityPerimeterConfigurationData NetworkSecurityPerimeterConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NetworkSecurityPerimeterConfigurationProperties properties = null) { - tags ??= new Dictionary(); - zones ??= new List(); - - return new BotChannelData( + return new NetworkSecurityPerimeterConfigurationData( id, name, resourceType, systemData, - tags, - location, properties, - sku, - kind, - etag, - zones?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The channel name. - /// Entity Tag of the resource. - /// Provisioning state of the resource. - /// Specifies the location of the resource. - /// A new instance for mocking. - public static BotChannelProperties BotChannelProperties(string channelName = null, ETag? etag = null, string provisioningState = null, AzureLocation? location = null) - { - return new UnknownChannel(channelName, etag, provisioningState, location, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// - /// The set of properties specific to bot channel resource - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , , , , , and . - /// - /// Channel settings. - /// Provisioning state of the resource. - /// Entity tag of the resource. - /// Changed time of the resource. - /// - /// The set of properties specific to bot channel resource - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , , , , , and . - /// - /// Gets or sets the SKU of the resource. - /// Required. Gets or sets the Kind of the resource. - /// Entity Tag. - /// Entity zones. - /// A new instance for mocking. - public static BotChannelGetWithKeysResult BotChannelGetWithKeysResult(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, BotChannelProperties resource = null, BotChannelSettings setting = null, string provisioningState = null, string entityTag = null, string changedTime = null, BotChannelProperties properties = null, BotServiceSku sku = null, BotServiceKind? kind = null, ETag? etag = null, IEnumerable zones = null) + /// Initializes a new instance of . + /// + /// List of Provisioning Issues if any. + /// Information about Network Security Perimeter. + /// Information about resource association. + /// Information about profile. + /// A new instance for mocking. + public static NetworkSecurityPerimeterConfigurationProperties NetworkSecurityPerimeterConfigurationProperties(ProvisioningState? provisioningState = null, IEnumerable provisioningIssues = null, NetworkSecurityPerimeter networkSecurityPerimeter = null, ResourceAssociation resourceAssociation = null, Profile profile = null) { - tags ??= new Dictionary(); - zones ??= new List(); + provisioningIssues ??= new List(); - return new BotChannelGetWithKeysResult( - id, - name, - resourceType, - systemData, - tags, - location, - resource, - setting, + return new NetworkSecurityPerimeterConfigurationProperties( provisioningState, - entityTag, - changedTime, - properties, - sku, - kind, - etag, - zones?.ToList(), + provisioningIssues?.ToList(), + networkSecurityPerimeter, + resourceAssociation, + profile, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Tenant Id. - /// Site Id. - /// Site name. - /// Primary key. Value only returned through POST to the action Channel List API, otherwise empty. - /// Secondary key. Value only returned through POST to the action Channel List API, otherwise empty. - /// Whether this site is enabled for DirectLine channel. - /// Whether this site is token enabled for channel. - /// Whether this site is EndpointParameters enabled for channel. - /// Whether this site is disabled detailed logging for. - /// Whether this site is enabled for block user upload. - /// Whether this no-storage site is disabled detailed logging for. - /// Entity Tag. - /// DirectLine application id. - /// Whether this site is enabled for Bot Framework V1 protocol. - /// Whether this site is enabled for Bot Framework V3 protocol. - /// Whether this site is enabled for authentication with Bot Framework. - /// List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True. - /// Whether this site is enabled for Webchat Speech. - /// Whether this site is enabled for preview versions of Webchat. - /// A new instance for mocking. - public static BotChannelSite BotChannelSite(Guid? tenantId = null, string siteId = null, string siteName = null, string key = null, string key2 = null, bool isEnabled = default, bool? isTokenEnabled = null, bool? isEndpointParametersEnabled = null, bool? isDetailedLoggingEnabled = null, bool? isBlockUserUploadEnabled = null, bool? isNoStorageEnabled = null, ETag? etag = null, string appId = null, bool? isV1Enabled = null, bool? isV3Enabled = null, bool? isSecureSiteEnabled = null, IEnumerable trustedOrigins = null, bool? isWebChatSpeechEnabled = null, bool? isWebchatPreviewEnabled = null) + /// Initializes a new instance of . + /// Name of the issue. + /// Properties of Provisioning Issue. + /// A new instance for mocking. + public static ProvisioningIssue ProvisioningIssue(string name = null, ProvisioningIssueProperties properties = null) { - trustedOrigins ??= new List(); - - return new BotChannelSite( - tenantId, - siteId, - siteName, - key, - key2, - isEnabled, - isTokenEnabled, - isEndpointParametersEnabled, - isDetailedLoggingEnabled, - isBlockUserUploadEnabled, - isNoStorageEnabled, - etag, - appId, - isV1Enabled, - isV3Enabled, - isSecureSiteEnabled, - trustedOrigins?.ToList(), - isWebChatSpeechEnabled, - isWebchatPreviewEnabled, - serializedAdditionalRawData: null); + return new ProvisioningIssue(name, properties, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Specifies the resource ID. - /// Specifies the location of the resource. - /// The set of properties specific to sign in url. - /// A new instance for mocking. - public static BotCreateEmailSignInUriResult BotCreateEmailSignInUriResult(ResourceIdentifier id = null, AzureLocation? location = null, Uri createEmailSignInUrlResponseUri = null) + /// Initializes a new instance of . + /// Type of Issue. + /// Provisioning state of Network Security Perimeter configuration propagation. + /// Description of the issue. + /// ARM IDs of resources that can be associated to the same perimeter to remediate the issue. + /// Access rules that can be added to the same profile to remediate the issue. + /// A new instance for mocking. + public static ProvisioningIssueProperties ProvisioningIssueProperties(string issueType = null, BotServiceSeverity? severity = null, string description = null, IEnumerable suggestedResourceIds = null, IEnumerable suggestedAccessRules = null) { - return new BotCreateEmailSignInUriResult(id, location, createEmailSignInUrlResponseUri != null ? new CreateEmailSignInUrlResponseProperties(createEmailSignInUrlResponseUri, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); - } + suggestedResourceIds ??= new List(); + suggestedAccessRules ??= new List(); - /// Initializes a new instance of . - /// indicates if the bot name is valid. - /// additional message from the bot management api showing why a bot name is not available. - /// response code from ABS. - /// A new instance for mocking. - public static BotServiceNameAvailabilityResult BotServiceNameAvailabilityResult(bool? isValid = null, string message = null, string absCode = null) - { - return new BotServiceNameAvailabilityResult(isValid, message, absCode, serializedAdditionalRawData: null); + return new ProvisioningIssueProperties( + issueType, + severity, + description, + suggestedResourceIds?.ToList(), + suggestedAccessRules?.ToList(), + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The Properties of a Service Provider Object. - /// A new instance for mocking. - public static BotServiceProvider BotServiceProvider(BotServiceProviderProperties properties = null) + /// Initializes a new instance of . + /// Name of the access rule. + /// Properties of Access Rule. + /// A new instance for mocking. + public static NspAccessRule NspAccessRule(string name = null, NspAccessRuleProperties properties = null) { - return new BotServiceProvider(properties, serializedAdditionalRawData: null); + return new NspAccessRule(name, properties, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Id for Service Provider. - /// Display Name of the Service Provider. - /// Name of the Service Provider. - /// URL of Dev Portal. - /// The URL of icon. - /// The list of parameters for the Service Provider. - /// A new instance for mocking. - public static BotServiceProviderProperties BotServiceProviderProperties(string id = null, string displayName = null, string serviceProviderName = null, Uri devPortalUri = null, Uri iconUri = null, IEnumerable parameters = null) + /// Initializes a new instance of . + /// Direction of Access Rule. + /// Address prefixes in the CIDR format for inbound rules. + /// Subscriptions for inbound rules. + /// NetworkSecurityPerimeters for inbound rules. + /// FQDN for outbound rules. + /// Email addresses for outbound rules. + /// Phone numbers for outbound rules. + /// A new instance for mocking. + public static NspAccessRuleProperties NspAccessRuleProperties(NspAccessRuleDirection? direction = null, IEnumerable addressPrefixes = null, IEnumerable subscriptions = null, IEnumerable networkSecurityPerimeters = null, IEnumerable fullyQualifiedDomainNames = null, IEnumerable emailAddresses = null, IEnumerable phoneNumbers = null) { - parameters ??= new List(); + addressPrefixes ??= new List(); + subscriptions ??= new List(); + networkSecurityPerimeters ??= new List(); + fullyQualifiedDomainNames ??= new List(); + emailAddresses ??= new List(); + phoneNumbers ??= new List(); - return new BotServiceProviderProperties( - id, - displayName, - serviceProviderName, - devPortalUri, - iconUri, - parameters?.ToList(), + return new NspAccessRuleProperties( + direction, + addressPrefixes?.ToList(), + subscriptions?.ToList(), + networkSecurityPerimeters?.ToList(), + fullyQualifiedDomainNames?.ToList(), + emailAddresses?.ToList(), + phoneNumbers?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Name of the Service Provider. - /// Type of the Service Provider. - /// Display Name of the Service Provider. - /// Description of the Service Provider. - /// Help Url for the Service Provider. - /// Default Name for the Service Provider. - /// Meta data for the Service Provider. - /// A new instance for mocking. - public static BotServiceProviderParameter BotServiceProviderParameter(string name = null, string serviceProviderParameterType = null, string displayName = null, string description = null, Uri helpUri = null, string @default = null, bool? isRequired = null) + /// Initializes a new instance of . + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + /// Guid of the Network Security Perimeter. + /// Location of the Network Security Perimeter. + /// A new instance for mocking. + public static NetworkSecurityPerimeter NetworkSecurityPerimeter(ResourceIdentifier id = null, string perimeterGuid = null, string location = null) { - return new BotServiceProviderParameter( - name, - serviceProviderParameterType, - displayName, - description, - helpUri, - @default, - isRequired != null ? new ServiceProviderParameterMetadata(new ServiceProviderParameterMetadataConstraints(isRequired, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, - serializedAdditionalRawData: null); + return new NetworkSecurityPerimeter(id, perimeterGuid, location, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Primary Access Key. - /// Secondary Access Key. - /// Current version of runtime. - /// Latest version of runtime. - /// A new instance for mocking. - public static GetBotServiceQnAMakerEndpointKeyResult GetBotServiceQnAMakerEndpointKeyResult(string primaryEndpointKey = null, string secondaryEndpointKey = null, string installedVersion = null, string lastStableVersion = null) + /// Initializes a new instance of . + /// Name of the resource association. + /// Access Mode of the resource association. + /// A new instance for mocking. + public static ResourceAssociation ResourceAssociation(string name = null, AccessMode? accessMode = null) { - return new GetBotServiceQnAMakerEndpointKeyResult(primaryEndpointKey, secondaryEndpointKey, installedVersion, lastStableVersion, serializedAdditionalRawData: null); + return new ResourceAssociation(name, accessMode, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The set of properties specific to bot channel resource. - /// Gets or sets the SKU of the resource. - /// Required. Gets or sets the Kind of the resource. - /// Entity Tag. - /// Entity zones. - /// A new instance for mocking. - public static BotConnectionSettingData BotConnectionSettingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, BotConnectionSettingProperties properties = null, BotServiceSku sku = null, BotServiceKind? kind = null, ETag? etag = null, IEnumerable zones = null) + /// Initializes a new instance of . + /// Name of the profile. + /// Current access rules version. + /// List of Access Rules. + /// Current diagnostic settings version. + /// List of log categories. + /// A new instance for mocking. + public static Profile Profile(string name = null, long? accessRulesVersion = null, IEnumerable accessRules = null, long? diagnosticSettingsVersion = null, IEnumerable enabledLogCategories = null) { - tags ??= new Dictionary(); - zones ??= new List(); + accessRules ??= new List(); + enabledLogCategories ??= new List(); - return new BotConnectionSettingData( - id, + return new Profile( name, - resourceType, - systemData, - tags, - location, - properties, - sku, - kind, - etag, - zones?.ToList(), + accessRulesVersion, + accessRules?.ToList(), + diagnosticSettingsVersion, + enabledLogCategories?.ToList(), serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Client Id associated with the Connection Setting. - /// Setting Id set by the service for the Connection Setting. - /// Client Secret associated with the Connection Setting. - /// Scopes associated with the Connection Setting. - /// Service Provider Id associated with the Connection Setting. - /// Service Provider Display Name associated with the Connection Setting. - /// Service Provider Parameters associated with the Connection Setting. - /// Provisioning state of the resource. - /// A new instance for mocking. - public static BotConnectionSettingProperties BotConnectionSettingProperties(string clientId = null, string settingId = null, string clientSecret = null, string scopes = null, string serviceProviderId = null, string serviceProviderDisplayName = null, IEnumerable parameters = null, string provisioningState = null) + /// Initializes a new instance of . + /// The sku name. + /// Gets the sku tier. This is based on the SKU name. + /// A new instance for mocking. + public static BotServiceSku BotServiceSku(BotServiceSkuName name = default, BotServiceSkuTier? tier = null) { - parameters ??= new List(); - - return new BotConnectionSettingProperties( - clientId, - settingId, - clientSecret, - scopes, - serviceProviderId, - serviceProviderDisplayName, - parameters?.ToList(), - provisioningState, - serializedAdditionalRawData: null); + return new BotServiceSku(name, tier, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// For in-conversation bot user authentication. - /// For verifying incoming tokens from the channels. - /// For verifying incoming tokens from the channels. - /// For verifying incoming tokens from bot emulator. - /// For getting access token to channels from bot host. - /// For getting access token to channels from bot host. - /// Per cloud OAuth setting on whether authority is validated. - /// Same as toBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12. - /// A new instance for mocking. - public static BotServiceHostSettingsResult BotServiceHostSettingsResult(Uri oAuthUri = null, Uri toBotFromChannelOpenIdMetadataUri = null, string toBotFromChannelTokenIssuer = null, Uri toBotFromEmulatorOpenIdMetadataUri = null, Uri toChannelFromBotLoginUri = null, string toChannelFromBotOAuthScope = null, bool? validateAuthority = null, string botOpenIdMetadata = null) + /// Initializes a new instance of . + /// Specifies the resource ID. + /// Specifies the location of the resource. + /// The set of properties specific to sign in url. + /// A new instance for mocking. + public static CreateEmailSignInUrlResponse CreateEmailSignInUrlResponse(string id = null, string location = null, string createEmailSignInUrlResponseUri = null) { - return new BotServiceHostSettingsResult( - oAuthUri, - toBotFromChannelOpenIdMetadataUri, - toBotFromChannelTokenIssuer, - toBotFromEmulatorOpenIdMetadataUri, - toChannelFromBotLoginUri, - toChannelFromBotOAuthScope, - validateAuthority, - botOpenIdMetadata, - serializedAdditionalRawData: null); + return new CreateEmailSignInUrlResponse(id, location, createEmailSignInUrlResponseUri != null ? new CreateEmailSignInUrlResponseProperties(createEmailSignInUrlResponseUri, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -507,13 +376,61 @@ public static BotServicePrivateLinkResourceData BotServicePrivateLinkResourceDat serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// + /// The set of properties specific to bot channel resource + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , , , , , , , , and . + /// + /// Gets or sets the SKU of the resource. + /// Required. Gets or sets the Kind of the resource. + /// Entity Tag. + /// Entity zones. + /// A new instance for mocking. + public static BotChannelData BotChannelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, Channel properties = null, BotServiceSku sku = null, BotServiceKind? kind = null, string etag = null, IEnumerable zones = null) + { + tags ??= new Dictionary(); + zones ??= new List(); + + return new BotChannelData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + sku, + kind, + etag, + zones?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The channel name. + /// Entity Tag of the resource. + /// Provisioning state of the resource. + /// Specifies the location of the resource. + /// A new instance for mocking. + public static Channel Channel(string channelName = null, string etag = null, string provisioningState = null, string location = null) + { + return new UnknownChannel(channelName, etag, provisioningState, location, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Entity Tag of the resource. /// Provisioning state of the resource. /// Specifies the location of the resource. /// The set of properties specific to Alexa channel resource. /// A new instance for mocking. - public static AlexaChannel AlexaChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, AlexaChannelProperties properties = null) + public static AlexaChannel AlexaChannel(string etag = null, string provisioningState = null, string location = null, AlexaChannelProperties properties = null) { return new AlexaChannel( "AlexaChannel", @@ -526,13 +443,13 @@ public static AlexaChannel AlexaChannel(ETag? etag = null, string provisioningSt /// Initializes a new instance of . /// The Alexa skill Id. - /// Url fragment used in part of the Uri configured in Alexa. + /// Url fragment used in part of the Uri configured in Alexa. /// Full Uri used to configured the skill in Alexa. /// Whether this channel is enabled for the bot. /// A new instance for mocking. - public static AlexaChannelProperties AlexaChannelProperties(string alexaSkillId = null, string uriFragment = null, Uri serviceEndpointUri = null, bool isEnabled = default) + public static AlexaChannelProperties AlexaChannelProperties(string alexaSkillId = null, string urlFragment = null, string serviceEndpointUri = null, bool isEnabled = default) { - return new AlexaChannelProperties(alexaSkillId, uriFragment, serviceEndpointUri, isEnabled, serializedAdditionalRawData: null); + return new AlexaChannelProperties(alexaSkillId, urlFragment, serviceEndpointUri, isEnabled, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -541,7 +458,7 @@ public static AlexaChannelProperties AlexaChannelProperties(string alexaSkillId /// Specifies the location of the resource. /// The set of properties specific to bot facebook channel. /// A new instance for mocking. - public static FacebookChannel FacebookChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, FacebookChannelProperties properties = null) + public static FacebookChannel FacebookChannel(string etag = null, string provisioningState = null, string location = null, FacebookChannelProperties properties = null) { return new FacebookChannel( "FacebookChannel", @@ -560,7 +477,7 @@ public static FacebookChannel FacebookChannel(ETag? etag = null, string provisio /// Callback Url. /// Whether this channel is enabled for the bot. /// A new instance for mocking. - public static FacebookChannelProperties FacebookChannelProperties(string verifyToken = null, IEnumerable pages = null, string appId = null, string appSecret = null, Uri callbackUri = null, bool isEnabled = default) + public static FacebookChannelProperties FacebookChannelProperties(string verifyToken = null, IEnumerable pages = null, string appId = null, string appSecret = null, string callbackUri = null, bool isEnabled = default) { pages ??= new List(); @@ -580,7 +497,7 @@ public static FacebookChannelProperties FacebookChannelProperties(string verifyT /// Specifies the location of the resource. /// The set of properties specific to email channel resource. /// A new instance for mocking. - public static EmailChannel EmailChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, EmailChannelProperties properties = null) + public static EmailChannel EmailChannel(string etag = null, string provisioningState = null, string location = null, EmailChannelProperties properties = null) { return new EmailChannel( "EmailChannel", @@ -596,7 +513,7 @@ public static EmailChannel EmailChannel(ETag? etag = null, string provisioningSt /// Provisioning state of the resource. /// Specifies the location of the resource. /// A new instance for mocking. - public static OutlookChannel OutlookChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null) + public static OutlookChannel OutlookChannel(string etag = null, string provisioningState = null, string location = null) { return new OutlookChannel("OutlookChannel", etag, provisioningState, location, serializedAdditionalRawData: null); } @@ -607,7 +524,7 @@ public static OutlookChannel OutlookChannel(ETag? etag = null, string provisioni /// Specifies the location of the resource. /// The set of properties specific to Microsoft Teams channel resource. /// A new instance for mocking. - public static MsTeamsChannel MsTeamsChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, MsTeamsChannelProperties properties = null) + public static MsTeamsChannel MsTeamsChannel(string etag = null, string provisioningState = null, string location = null, MsTeamsChannelProperties properties = null) { return new MsTeamsChannel( "MsTeamsChannel", @@ -624,7 +541,7 @@ public static MsTeamsChannel MsTeamsChannel(ETag? etag = null, string provisioni /// Specifies the location of the resource. /// The set of properties specific to Skype channel resource. /// A new instance for mocking. - public static SkypeChannel SkypeChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, SkypeChannelProperties properties = null) + public static SkypeChannel SkypeChannel(string etag = null, string provisioningState = null, string location = null, SkypeChannelProperties properties = null) { return new SkypeChannel( "SkypeChannel", @@ -641,7 +558,7 @@ public static SkypeChannel SkypeChannel(ETag? etag = null, string provisioningSt /// Specifies the location of the resource. /// The set of properties specific to Kik channel resource. /// A new instance for mocking. - public static KikChannel KikChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, KikChannelProperties properties = null) + public static KikChannel KikChannel(string etag = null, string provisioningState = null, string location = null, KikChannelProperties properties = null) { return new KikChannel( "KikChannel", @@ -658,7 +575,7 @@ public static KikChannel KikChannel(ETag? etag = null, string provisioningState /// Specifies the location of the resource. /// The set of properties specific to Web Chat channel resource. /// A new instance for mocking. - public static WebChatChannel WebChatChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, WebChatChannelProperties properties = null) + public static WebChatChannel WebChatChannel(string etag = null, string provisioningState = null, string location = null, WebChatChannelProperties properties = null) { return new WebChatChannel( "WebChatChannel", @@ -701,7 +618,7 @@ public static WebChatChannelProperties WebChatChannelProperties(string webChatEm /// Whether this site is enabled for Webchat Speech. /// Whether this site is enabled for preview versions of Webchat. /// A new instance for mocking. - public static WebChatSite WebChatSite(Guid? tenantId = null, string siteId = null, string siteName = null, string key = null, string key2 = null, bool isEnabled = default, bool? isTokenEnabled = null, bool? isEndpointParametersEnabled = null, bool? isDetailedLoggingEnabled = null, bool? isBlockUserUploadEnabled = null, bool? isNoStorageEnabled = null, ETag? etag = null, string appId = null, bool? isV1Enabled = null, bool? isV3Enabled = null, bool? isSecureSiteEnabled = null, IEnumerable trustedOrigins = null, bool? isWebChatSpeechEnabled = null, bool? isWebchatPreviewEnabled = null) + public static WebChatSite WebChatSite(string tenantId = null, string siteId = null, string siteName = null, string key = null, string key2 = null, bool isEnabled = default, bool? isTokenEnabled = null, bool? isEndpointParametersEnabled = null, bool? isDetailedLoggingEnabled = null, bool? isBlockUserUploadEnabled = null, bool? isNoStorageEnabled = null, string etag = null, string appId = null, bool? isV1Enabled = null, bool? isV3Enabled = null, bool? isSecureSiteEnabled = null, IEnumerable trustedOrigins = null, bool? isWebChatSpeechEnabled = null, bool? isWebchatPreviewEnabled = null) { trustedOrigins ??= new List(); @@ -728,13 +645,61 @@ public static WebChatSite WebChatSite(Guid? tenantId = null, string siteId = nul serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Tenant Id. + /// Site Id. + /// Site name. + /// Primary key. Value only returned through POST to the action Channel List API, otherwise empty. + /// Secondary key. Value only returned through POST to the action Channel List API, otherwise empty. + /// Whether this site is enabled for DirectLine channel. + /// Whether this site is token enabled for channel. + /// Whether this site is EndpointParameters enabled for channel. + /// Whether this site is disabled detailed logging for. + /// Whether this site is enabled for block user upload. + /// Whether this no-storage site is disabled detailed logging for. + /// Entity Tag. + /// DirectLine application id. + /// Whether this site is enabled for Bot Framework V1 protocol. + /// Whether this site is enabled for Bot Framework V3 protocol. + /// Whether this site is enabled for authentication with Bot Framework. + /// List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True. + /// Whether this site is enabled for Webchat Speech. + /// Whether this site is enabled for preview versions of Webchat. + /// A new instance for mocking. + public static Site Site(string tenantId = null, string siteId = null, string siteName = null, string key = null, string key2 = null, bool isEnabled = default, bool? isTokenEnabled = null, bool? isEndpointParametersEnabled = null, bool? isDetailedLoggingEnabled = null, bool? isBlockUserUploadEnabled = null, bool? isNoStorageEnabled = null, string etag = null, string appId = null, bool? isV1Enabled = null, bool? isV3Enabled = null, bool? isSecureSiteEnabled = null, IEnumerable trustedOrigins = null, bool? isWebChatSpeechEnabled = null, bool? isWebchatPreviewEnabled = null) + { + trustedOrigins ??= new List(); + + return new Site( + tenantId, + siteId, + siteName, + key, + key2, + isEnabled, + isTokenEnabled, + isEndpointParametersEnabled, + isDetailedLoggingEnabled, + isBlockUserUploadEnabled, + isNoStorageEnabled, + etag, + appId, + isV1Enabled, + isV3Enabled, + isSecureSiteEnabled, + trustedOrigins?.ToList(), + isWebChatSpeechEnabled, + isWebchatPreviewEnabled, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Entity Tag of the resource. /// Provisioning state of the resource. /// Specifies the location of the resource. /// The set of properties specific to Direct Line channel resource. /// A new instance for mocking. - public static DirectLineChannel DirectLineChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, DirectLineChannelProperties properties = null) + public static DirectLineChannel DirectLineChannel(string etag = null, string provisioningState = null, string location = null, DirectLineChannelProperties properties = null) { return new DirectLineChannel( "DirectLineChannel", @@ -766,7 +731,7 @@ public static DirectLineChannel DirectLineChannel(ETag? etag = null, string prov /// Whether this site is enabled for Webchat Speech. /// Whether this site is enabled for preview versions of Webchat. /// A new instance for mocking. - public static DirectLineSite DirectLineSite(Guid? tenantId = null, string siteId = null, string siteName = null, string key = null, string key2 = null, bool isEnabled = default, bool? isTokenEnabled = null, bool? isEndpointParametersEnabled = null, bool? isDetailedLoggingEnabled = null, bool? isBlockUserUploadEnabled = null, bool? isNoStorageEnabled = null, ETag? etag = null, string appId = null, bool? isV1Enabled = null, bool? isV3Enabled = null, bool? isSecureSiteEnabled = null, IEnumerable trustedOrigins = null, bool? isWebChatSpeechEnabled = null, bool? isWebchatPreviewEnabled = null) + public static DirectLineSite DirectLineSite(string tenantId = null, string siteId = null, string siteName = null, string key = null, string key2 = null, bool isEnabled = default, bool? isTokenEnabled = null, bool? isEndpointParametersEnabled = null, bool? isDetailedLoggingEnabled = null, bool? isBlockUserUploadEnabled = null, bool? isNoStorageEnabled = null, string etag = null, string appId = null, bool? isV1Enabled = null, bool? isV3Enabled = null, bool? isSecureSiteEnabled = null, IEnumerable trustedOrigins = null, bool? isWebChatSpeechEnabled = null, bool? isWebchatPreviewEnabled = null) { trustedOrigins ??= new List(); @@ -799,7 +764,7 @@ public static DirectLineSite DirectLineSite(Guid? tenantId = null, string siteId /// Specifies the location of the resource. /// The set of properties specific to Telegram channel resource. /// A new instance for mocking. - public static TelegramChannel TelegramChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, TelegramChannelProperties properties = null) + public static TelegramChannel TelegramChannel(string etag = null, string provisioningState = null, string location = null, TelegramChannelProperties properties = null) { return new TelegramChannel( "TelegramChannel", @@ -816,7 +781,7 @@ public static TelegramChannel TelegramChannel(ETag? etag = null, string provisio /// Specifies the location of the resource. /// The set of properties specific to Sms channel resource. /// A new instance for mocking. - public static SmsChannel SmsChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, SmsChannelProperties properties = null) + public static SmsChannel SmsChannel(string etag = null, string provisioningState = null, string location = null, SmsChannelProperties properties = null) { return new SmsChannel( "SmsChannel", @@ -833,7 +798,7 @@ public static SmsChannel SmsChannel(ETag? etag = null, string provisioningState /// Specifies the location of the resource. /// The set of properties specific to Slack channel resource. /// A new instance for mocking. - public static SlackChannel SlackChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, SlackChannelProperties properties = null) + public static SlackChannel SlackChannel(string etag = null, string provisioningState = null, string location = null, SlackChannelProperties properties = null) { return new SlackChannel( "SlackChannel", @@ -857,7 +822,7 @@ public static SlackChannel SlackChannel(ETag? etag = null, string provisioningSt /// The Slack signing secret. /// Whether this channel is enabled for the bot. /// A new instance for mocking. - public static SlackChannelProperties SlackChannelProperties(string clientId = null, string clientSecret = null, string verificationToken = null, string scopes = null, Uri landingPageUri = null, string redirectAction = null, string lastSubmissionId = null, bool? registerBeforeOAuthFlow = null, bool? isValidated = null, string signingSecret = null, bool isEnabled = default) + public static SlackChannelProperties SlackChannelProperties(string clientId = null, string clientSecret = null, string verificationToken = null, string scopes = null, string landingPageUri = null, string redirectAction = null, string lastSubmissionId = null, bool? registerBeforeOAuthFlow = null, bool? isValidated = null, string signingSecret = null, bool isEnabled = default) { return new SlackChannelProperties( clientId, @@ -880,7 +845,7 @@ public static SlackChannelProperties SlackChannelProperties(string clientId = nu /// Specifies the location of the resource. /// The set of properties specific to line channel resource. /// A new instance for mocking. - public static LineChannel LineChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, LineChannelProperties properties = null) + public static LineChannel LineChannel(string etag = null, string provisioningState = null, string location = null, LineChannelProperties properties = null) { return new LineChannel( "LineChannel", @@ -896,7 +861,7 @@ public static LineChannel LineChannel(ETag? etag = null, string provisioningStat /// Callback Url to enter in line registration. /// Whether this channel is validated for the bot. /// A new instance for mocking. - public static LineChannelProperties LineChannelProperties(IEnumerable lineRegistrations = null, Uri callbackUri = null, bool? isValidated = null) + public static LineChannelProperties LineChannelProperties(IEnumerable lineRegistrations = null, string callbackUri = null, bool? isValidated = null) { lineRegistrations ??= new List(); @@ -919,7 +884,7 @@ public static LineRegistration LineRegistration(string generatedId = null, strin /// Specifies the location of the resource. /// The set of properties specific to DirectLine Speech channel resource. /// A new instance for mocking. - public static DirectLineSpeechChannel DirectLineSpeechChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, DirectLineSpeechChannelProperties properties = null) + public static DirectLineSpeechChannel DirectLineSpeechChannel(string etag = null, string provisioningState = null, string location = null, DirectLineSpeechChannelProperties properties = null) { return new DirectLineSpeechChannel( "DirectLineSpeechChannel", @@ -935,7 +900,7 @@ public static DirectLineSpeechChannel DirectLineSpeechChannel(ETag? etag = null, /// Provisioning state of the resource. /// Specifies the location of the resource. /// A new instance for mocking. - public static Omnichannel Omnichannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null) + public static Omnichannel Omnichannel(string etag = null, string provisioningState = null, string location = null) { return new Omnichannel("Omnichannel", etag, provisioningState, location, serializedAdditionalRawData: null); } @@ -946,7 +911,7 @@ public static Omnichannel Omnichannel(ETag? etag = null, string provisioningStat /// Specifies the location of the resource. /// The set of properties specific to Telephony channel resource. /// A new instance for mocking. - public static TelephonyChannel TelephonyChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null, TelephonyChannelProperties properties = null) + public static TelephonyChannel TelephonyChannel(string etag = null, string provisioningState = null, string location = null, TelephonyChannelProperties properties = null) { return new TelephonyChannel( "TelephonyChannel", @@ -962,7 +927,7 @@ public static TelephonyChannel TelephonyChannel(ETag? etag = null, string provis /// Provisioning state of the resource. /// Specifies the location of the resource. /// A new instance for mocking. - public static AcsChatChannel AcsChatChannel(ETag? etag = null, string provisioningState = null, AzureLocation? location = null) + public static AcsChatChannel AcsChatChannel(string etag = null, string provisioningState = null, string location = null) { return new AcsChatChannel("AcsChatChannel", etag, provisioningState, location, serializedAdditionalRawData: null); } @@ -972,7 +937,7 @@ public static AcsChatChannel AcsChatChannel(ETag? etag = null, string provisioni /// Provisioning state of the resource. /// Specifies the location of the resource. /// A new instance for mocking. - public static SearchAssistant SearchAssistant(ETag? etag = null, string provisioningState = null, AzureLocation? location = null) + public static SearchAssistant SearchAssistant(string etag = null, string provisioningState = null, string location = null) { return new SearchAssistant("SearchAssistant", etag, provisioningState, location, serializedAdditionalRawData: null); } @@ -982,9 +947,261 @@ public static SearchAssistant SearchAssistant(ETag? etag = null, string provisio /// Provisioning state of the resource. /// Specifies the location of the resource. /// A new instance for mocking. - public static M365Extensions M365Extensions(ETag? etag = null, string provisioningState = null, AzureLocation? location = null) + public static M365Extensions M365Extensions(string etag = null, string provisioningState = null, string location = null) { return new M365Extensions("M365Extensions", etag, provisioningState, location, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// + /// The set of properties specific to bot channel resource + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , , , , , , , , and . + /// + /// Channel settings. + /// Provisioning state of the resource. + /// Entity tag of the resource. + /// Changed time of the resource. + /// + /// The set of properties specific to bot channel resource + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , , , , , , , , , , , , , , , and . + /// + /// Gets or sets the SKU of the resource. + /// Required. Gets or sets the Kind of the resource. + /// Entity Tag. + /// Entity zones. + /// Resource tags. + /// The geo-location where the resource lives. + /// A new instance for mocking. + public static ListChannelWithKeysResponse ListChannelWithKeysResponse(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Channel resource = null, ChannelSettings setting = null, string provisioningState = null, string entityTag = null, string changedTime = null, Channel properties = null, BotServiceSku sku = null, BotServiceKind? kind = null, string etag = null, IEnumerable zones = null, IReadOnlyDictionary tags = null, string location = null) + { + zones ??= new List(); + tags ??= new Dictionary(); + + return new ListChannelWithKeysResponse( + id, + name, + resourceType, + systemData, + resource, + setting, + provisioningState, + entityTag, + changedTime, + properties, + sku, + kind, + etag, + zones?.ToList(), + tags, + location, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The extensionKey1. + /// The extensionKey2. + /// The list of sites. + /// The channel id. + /// The channel display name. + /// The bot id. + /// The bot icon url. + /// Whether this channel is enabled for the bot. + /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. + /// Whether customer needs to agree to new terms. + /// A new instance for mocking. + public static ChannelSettings ChannelSettings(string extensionKey1 = null, string extensionKey2 = null, IEnumerable sites = null, string channelId = null, string channelDisplayName = null, string botId = null, string botIconUri = null, bool? isEnabled = null, bool? disableLocalAuth = null, bool? requireTermsAgreement = null) + { + sites ??= new List(); + + return new ChannelSettings( + extensionKey1, + extensionKey2, + sites?.ToList(), + channelId, + channelDisplayName, + botId, + botIconUri, + isEnabled, + disableLocalAuth, + requireTermsAgreement, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The set of properties specific to bot channel resource. + /// Gets or sets the SKU of the resource. + /// Required. Gets or sets the Kind of the resource. + /// Entity Tag. + /// Entity zones. + /// A new instance for mocking. + public static ConnectionSettingData ConnectionSettingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ConnectionSettingProperties properties = null, BotServiceSku sku = null, BotServiceKind? kind = null, string etag = null, IEnumerable zones = null) + { + tags ??= new Dictionary(); + zones ??= new List(); + + return new ConnectionSettingData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + sku, + kind, + etag, + zones?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Id of the Connection Setting. + /// Name of the Connection Setting. + /// Client Id associated with the Connection Setting. + /// Setting Id set by the service for the Connection Setting. + /// Client Secret associated with the Connection Setting. + /// Scopes associated with the Connection Setting. + /// Service Provider Id associated with the Connection Setting. + /// Service Provider Display Name associated with the Connection Setting. + /// Service Provider Parameters associated with the Connection Setting. + /// Provisioning state of the resource. + /// A new instance for mocking. + public static ConnectionSettingProperties ConnectionSettingProperties(string id = null, string name = null, string clientId = null, string settingId = null, string clientSecret = null, string scopes = null, string serviceProviderId = null, string serviceProviderDisplayName = null, IEnumerable parameters = null, string provisioningState = null) + { + parameters ??= new List(); + + return new ConnectionSettingProperties( + id, + name, + clientId, + settingId, + clientSecret, + scopes, + serviceProviderId, + serviceProviderDisplayName, + parameters?.ToList(), + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// indicates if the bot name is valid. + /// additional message from the bot management api showing why a bot name is not available. + /// response code from ABS. + /// A new instance for mocking. + public static CheckNameAvailabilityResponseBody CheckNameAvailabilityResponseBody(bool? valid = null, string message = null, string absCode = null) + { + return new CheckNameAvailabilityResponseBody(valid, message, absCode, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The Properties of a Service Provider Object. + /// A new instance for mocking. + public static ServiceProvider ServiceProvider(ServiceProviderProperties properties = null) + { + return new ServiceProvider(properties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Id for Service Provider. + /// Display Name of the Service Provider. + /// Name of the Service Provider. + /// URL of Dev Portal. + /// The URL of icon. + /// The list of parameters for the Service Provider. + /// A new instance for mocking. + public static ServiceProviderProperties ServiceProviderProperties(string id = null, string displayName = null, string serviceProviderName = null, string devPortalUri = null, string iconUri = null, IEnumerable parameters = null) + { + parameters ??= new List(); + + return new ServiceProviderProperties( + id, + displayName, + serviceProviderName, + devPortalUri, + iconUri, + parameters?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Name of the Service Provider. + /// Type of the Service Provider. + /// Display Name of the Service Provider. + /// Description of the Service Provider. + /// Help Url for the Service Provider. + /// Default Name for the Service Provider. + /// Meta data for the Service Provider. + /// A new instance for mocking. + public static ServiceProviderParameter ServiceProviderParameter(string name = null, string type = null, string displayName = null, string description = null, string helpUri = null, string @default = null, bool? required = null) + { + return new ServiceProviderParameter( + name, + type, + displayName, + description, + helpUri, + @default, + required != null ? new ServiceProviderParameterMetadata(new ServiceProviderParameterMetadataConstraints(required, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Primary Access Key. + /// Secondary Access Key. + /// Current version of runtime. + /// Latest version of runtime. + /// A new instance for mocking. + public static QnAMakerEndpointKeysResponse QnAMakerEndpointKeysResponse(string primaryEndpointKey = null, string secondaryEndpointKey = null, string installedVersion = null, string lastStableVersion = null) + { + return new QnAMakerEndpointKeysResponse(primaryEndpointKey, secondaryEndpointKey, installedVersion, lastStableVersion, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// For in-conversation bot user authentication. + /// For verifying incoming tokens from the channels. + /// For verifying incoming tokens from the channels. + /// For verifying incoming tokens from bot emulator. + /// For getting access token to channels from bot host. + /// For getting access token to channels from bot host. + /// Per cloud OAuth setting on whether authority is validated. + /// Same as toBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12. + /// A new instance for mocking. + public static HostSettingsResponse HostSettingsResponse(string oAuthUri = null, string toBotFromChannelOpenIdMetadataUri = null, string toBotFromChannelTokenIssuer = null, string toBotFromEmulatorOpenIdMetadataUri = null, string toChannelFromBotLoginUri = null, string toChannelFromBotOAuthScope = null, bool? validateAuthority = null, string botOpenIdMetadata = null) + { + return new HostSettingsResponse( + oAuthUri, + toBotFromChannelOpenIdMetadataUri, + toBotFromChannelTokenIssuer, + toBotFromEmulatorOpenIdMetadataUri, + toChannelFromBotLoginUri, + toChannelFromBotOAuthScope, + validateAuthority, + botOpenIdMetadata, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The ID of the operation returned. + /// The name of the operation result. + /// The status of the operation being performed. + /// The time that the operation was started. + /// A new instance for mocking. + public static OperationResultsDescription OperationResultsDescription(string id = null, string name = null, OperationResultStatus? status = null, DateTimeOffset? startOn = null) + { + return new OperationResultsDescription(id, name, status, startOn, serializedAdditionalRawData: null); + } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelCollection.cs index 34b0627e8819..5b2e8f663baf 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelCollection.cs @@ -14,7 +14,6 @@ using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.BotService.Models; namespace Azure.ResourceManager.BotService { @@ -25,8 +24,8 @@ namespace Azure.ResourceManager.BotService /// public partial class BotChannelCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _botChannelChannelsClientDiagnostics; - private readonly ChannelsRestOperations _botChannelChannelsRestClient; + private readonly ClientDiagnostics _botChannelClientDiagnostics; + private readonly BotChannelsRestOperations _botChannelRestClient; /// Initializes a new instance of the class for mocking. protected BotChannelCollection() @@ -38,9 +37,9 @@ protected BotChannelCollection() /// The identifier of the parent resource that is the target of operations. internal BotChannelCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _botChannelChannelsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", BotChannelResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(BotChannelResource.ResourceType, out string botChannelChannelsApiVersion); - _botChannelChannelsRestClient = new ChannelsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, botChannelChannelsApiVersion); + _botChannelClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", BotChannelResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(BotChannelResource.ResourceType, out string botChannelApiVersion); + _botChannelRestClient = new BotChannelsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, botChannelApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -61,11 +60,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Channels_Create + /// BotChannel_Create /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -74,20 +73,22 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the Channel resource. + /// The name of the Bot resource. /// The parameters to provide for the created bot. /// The cancellation token to use. - /// is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string channelName, BotChannelData data, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelCollection.CreateOrUpdate"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _botChannelChannelsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, data, cancellationToken).ConfigureAwait(false); - var uri = _botChannelChannelsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, data); + var response = await _botChannelRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, data, cancellationToken).ConfigureAwait(false); + var uri = _botChannelRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, data); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new BotServiceArmOperation(Response.FromValue(new BotChannelResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -110,11 +111,11 @@ public virtual async Task> CreateOrUpdateAsync( /// /// /// Operation Id - /// Channels_Create + /// BotChannel_Create /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -123,20 +124,22 @@ public virtual async Task> CreateOrUpdateAsync( /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the Channel resource. + /// The name of the Bot resource. /// The parameters to provide for the created bot. /// The cancellation token to use. - /// is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string channelName, BotChannelData data, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelCollection.CreateOrUpdate"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelCollection.CreateOrUpdate"); scope.Start(); try { - var response = _botChannelChannelsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, data, cancellationToken); - var uri = _botChannelChannelsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, data); + var response = _botChannelRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, data, cancellationToken); + var uri = _botChannelRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, data); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new BotServiceArmOperation(Response.FromValue(new BotChannelResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -159,11 +162,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnt /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -171,15 +174,19 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnt /// /// /// - /// The name of the Channel resource. + /// The name of the Bot resource. /// The cancellation token to use. - public virtual async Task> GetAsync(BotChannelName channelName, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string channelName, CancellationToken cancellationToken = default) { - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelCollection.Get"); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); + + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelCollection.Get"); scope.Start(); try { - var response = await _botChannelChannelsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, cancellationToken).ConfigureAwait(false); + var response = await _botChannelRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BotChannelResource(Client, response.Value), response.GetRawResponse()); @@ -200,11 +207,11 @@ public virtual async Task> GetAsync(BotChannelName /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -212,15 +219,19 @@ public virtual async Task> GetAsync(BotChannelName /// /// /// - /// The name of the Channel resource. + /// The name of the Bot resource. /// The cancellation token to use. - public virtual Response Get(BotChannelName channelName, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string channelName, CancellationToken cancellationToken = default) { - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelCollection.Get"); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); + + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelCollection.Get"); scope.Start(); try { - var response = _botChannelChannelsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, cancellationToken); + var response = _botChannelRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BotChannelResource(Client, response.Value), response.GetRawResponse()); @@ -241,11 +252,11 @@ public virtual Response Get(BotChannelName channelName, Canc /// /// /// Operation Id - /// Channels_ListByResourceGroup + /// BotChannel_ListByResourceGroup /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -257,9 +268,9 @@ public virtual Response Get(BotChannelName channelName, Canc /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _botChannelChannelsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _botChannelChannelsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BotChannelResource(Client, BotChannelData.DeserializeBotChannelData(e)), _botChannelChannelsClientDiagnostics, Pipeline, "BotChannelCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _botChannelRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _botChannelRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BotChannelResource(Client, BotChannelData.DeserializeBotChannelData(e)), _botChannelClientDiagnostics, Pipeline, "BotChannelCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -271,11 +282,11 @@ public virtual AsyncPageable GetAllAsync(CancellationToken c /// /// /// Operation Id - /// Channels_ListByResourceGroup + /// BotChannel_ListByResourceGroup /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -287,9 +298,9 @@ public virtual AsyncPageable GetAllAsync(CancellationToken c /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _botChannelChannelsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _botChannelChannelsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BotChannelResource(Client, BotChannelData.DeserializeBotChannelData(e)), _botChannelChannelsClientDiagnostics, Pipeline, "BotChannelCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _botChannelRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _botChannelRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BotChannelResource(Client, BotChannelData.DeserializeBotChannelData(e)), _botChannelClientDiagnostics, Pipeline, "BotChannelCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -301,11 +312,11 @@ public virtual Pageable GetAll(CancellationToken cancellatio /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -313,15 +324,19 @@ public virtual Pageable GetAll(CancellationToken cancellatio /// /// /// - /// The name of the Channel resource. + /// The name of the Bot resource. /// The cancellation token to use. - public virtual async Task> ExistsAsync(BotChannelName channelName, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string channelName, CancellationToken cancellationToken = default) { - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelCollection.Exists"); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); + + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelCollection.Exists"); scope.Start(); try { - var response = await _botChannelChannelsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _botChannelRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -340,11 +355,11 @@ public virtual async Task> ExistsAsync(BotChannelName channelName /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -352,15 +367,19 @@ public virtual async Task> ExistsAsync(BotChannelName channelName /// /// /// - /// The name of the Channel resource. + /// The name of the Bot resource. /// The cancellation token to use. - public virtual Response Exists(BotChannelName channelName, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string channelName, CancellationToken cancellationToken = default) { - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelCollection.Exists"); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); + + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelCollection.Exists"); scope.Start(); try { - var response = _botChannelChannelsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, cancellationToken: cancellationToken); + var response = _botChannelRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -379,11 +398,11 @@ public virtual Response Exists(BotChannelName channelName, CancellationTok /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -391,15 +410,19 @@ public virtual Response Exists(BotChannelName channelName, CancellationTok /// /// /// - /// The name of the Channel resource. + /// The name of the Bot resource. /// The cancellation token to use. - public virtual async Task> GetIfExistsAsync(BotChannelName channelName, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string channelName, CancellationToken cancellationToken = default) { - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelCollection.GetIfExists"); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); + + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelCollection.GetIfExists"); scope.Start(); try { - var response = await _botChannelChannelsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _botChannelRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new BotChannelResource(Client, response.Value), response.GetRawResponse()); @@ -420,11 +443,11 @@ public virtual async Task> GetIfExistsAsync /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -432,15 +455,19 @@ public virtual async Task> GetIfExistsAsync /// /// /// - /// The name of the Channel resource. + /// The name of the Bot resource. /// The cancellation token to use. - public virtual NullableResponse GetIfExists(BotChannelName channelName, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string channelName, CancellationToken cancellationToken = default) { - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelCollection.GetIfExists"); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); + + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelCollection.GetIfExists"); scope.Start(); try { - var response = _botChannelChannelsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, cancellationToken: cancellationToken); + var response = _botChannelRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new BotChannelResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelData.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelData.Serialization.cs index e63766ab4fb6..5121b05899d4 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelData.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelData.Serialization.cs @@ -49,20 +49,13 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } if (Optional.IsDefined(Kind)) { - if (Kind != null) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.Value.ToString()); - } - else - { - writer.WriteNull("kind"); - } + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); } if (Optional.IsDefined(ETag)) { writer.WritePropertyName("etag"u8); - writer.WriteStringValue(ETag.Value.ToString()); + writer.WriteStringValue(ETag); } if (options.Format != "W" && Optional.IsCollectionDefined(Zones)) { @@ -96,10 +89,10 @@ internal static BotChannelData DeserializeBotChannelData(JsonElement element, Mo { return null; } - BotChannelProperties properties = default; + Channel properties = default; BotServiceSku sku = default; BotServiceKind? kind = default; - ETag? etag = default; + string etag = default; IReadOnlyList zones = default; IDictionary tags = default; AzureLocation location = default; @@ -117,7 +110,7 @@ internal static BotChannelData DeserializeBotChannelData(JsonElement element, Mo { continue; } - properties = BotChannelProperties.DeserializeBotChannelProperties(property.Value, options); + properties = Channel.DeserializeChannel(property.Value, options); continue; } if (property.NameEquals("sku"u8)) @@ -133,7 +126,6 @@ internal static BotChannelData DeserializeBotChannelData(JsonElement element, Mo { if (property.Value.ValueKind == JsonValueKind.Null) { - kind = null; continue; } kind = new BotServiceKind(property.Value.GetString()); @@ -141,11 +133,7 @@ internal static BotChannelData DeserializeBotChannelData(JsonElement element, Mo } if (property.NameEquals("etag"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("zones"u8)) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelData.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelData.cs index e22c315448f4..ce2365986c05 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelData.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelData.cs @@ -67,7 +67,7 @@ public BotChannelData(AzureLocation location) : base(location) /// The location. /// /// The set of properties specific to bot channel resource - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , , , , , , , , , , , , , , , and . /// /// Gets or sets the SKU of the resource. @@ -75,7 +75,7 @@ public BotChannelData(AzureLocation location) : base(location) /// Entity Tag. /// Entity zones. /// Keeps track of any properties unknown to the library. - internal BotChannelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, BotChannelProperties properties, BotServiceSku sku, BotServiceKind? kind, ETag? etag, IReadOnlyList zones, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal BotChannelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, Channel properties, BotServiceSku sku, BotServiceKind? kind, string etag, IReadOnlyList zones, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Properties = properties; Sku = sku; @@ -92,16 +92,16 @@ internal BotChannelData() /// /// The set of properties specific to bot channel resource - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , , , , , , , , , , , , , , , and . /// - public BotChannelProperties Properties { get; set; } + public Channel Properties { get; set; } /// Gets or sets the SKU of the resource. public BotServiceSku Sku { get; set; } /// Required. Gets or sets the Kind of the resource. public BotServiceKind? Kind { get; set; } /// Entity Tag. - public ETag? ETag { get; set; } + public string ETag { get; set; } /// Entity zones. public IReadOnlyList Zones { get; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelResource.cs index fd3c52eaa023..662b097f42e2 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotChannelResource.cs @@ -29,14 +29,14 @@ public partial class BotChannelResource : ArmResource /// The resourceGroupName. /// The resourceName. /// The channelName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string channelName) { var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _botChannelChannelsClientDiagnostics; - private readonly ChannelsRestOperations _botChannelChannelsRestClient; + private readonly ClientDiagnostics _botChannelClientDiagnostics; + private readonly BotChannelsRestOperations _botChannelRestClient; private readonly BotChannelData _data; /// Gets the resource type for the operations. @@ -61,9 +61,9 @@ internal BotChannelResource(ArmClient client, BotChannelData data) : this(client /// The identifier of the resource that is the target of operations. internal BotChannelResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _botChannelChannelsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string botChannelChannelsApiVersion); - _botChannelChannelsRestClient = new ChannelsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, botChannelChannelsApiVersion); + _botChannelClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string botChannelApiVersion); + _botChannelRestClient = new BotChannelsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, botChannelApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -99,11 +99,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -114,11 +114,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.Get"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.Get"); scope.Start(); try { - var response = await _botChannelChannelsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _botChannelRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BotChannelResource(Client, response.Value), response.GetRawResponse()); @@ -139,11 +139,11 @@ public virtual async Task> GetAsync(CancellationTok /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -154,11 +154,11 @@ public virtual async Task> GetAsync(CancellationTok /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.Get"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.Get"); scope.Start(); try { - var response = _botChannelChannelsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _botChannelRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BotChannelResource(Client, response.Value), response.GetRawResponse()); @@ -179,11 +179,11 @@ public virtual Response Get(CancellationToken cancellationTo /// /// /// Operation Id - /// Channels_Delete + /// BotChannel_Delete /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -195,12 +195,12 @@ public virtual Response Get(CancellationToken cancellationTo /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.Delete"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.Delete"); scope.Start(); try { - var response = await _botChannelChannelsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _botChannelChannelsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var response = await _botChannelRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _botChannelRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new BotServiceArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -223,11 +223,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// Channels_Delete + /// BotChannel_Delete /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -239,12 +239,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.Delete"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.Delete"); scope.Start(); try { - var response = _botChannelChannelsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var uri = _botChannelChannelsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var response = _botChannelRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _botChannelRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new BotServiceArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -267,11 +267,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// Channels_Update + /// BotChannel_Update /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -286,11 +286,11 @@ public virtual async Task> UpdateAsync(BotChannelDa { Argument.AssertNotNull(data, nameof(data)); - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.Update"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.Update"); scope.Start(); try { - var response = await _botChannelChannelsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var response = await _botChannelRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); return Response.FromValue(new BotChannelResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -309,11 +309,11 @@ public virtual async Task> UpdateAsync(BotChannelDa /// /// /// Operation Id - /// Channels_Update + /// BotChannel_Update /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -328,11 +328,11 @@ public virtual Response Update(BotChannelData data, Cancella { Argument.AssertNotNull(data, nameof(data)); - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.Update"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.Update"); scope.Start(); try { - var response = _botChannelChannelsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var response = _botChannelRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); return Response.FromValue(new BotChannelResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -351,11 +351,11 @@ public virtual Response Update(BotChannelData data, Cancella /// /// /// Operation Id - /// Channels_ListWithKeys + /// BotChannels_ListWithKeys /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -364,13 +364,13 @@ public virtual Response Update(BotChannelData data, Cancella /// /// /// The cancellation token to use. - public virtual async Task> GetChannelWithKeysAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetWithKeysAsync(CancellationToken cancellationToken = default) { - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.GetChannelWithKeys"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.GetWithKeys"); scope.Start(); try { - var response = await _botChannelChannelsRestClient.ListWithKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _botChannelRestClient.ListWithKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -389,11 +389,11 @@ public virtual async Task> GetChannelWithK /// /// /// Operation Id - /// Channels_ListWithKeys + /// BotChannels_ListWithKeys /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -402,13 +402,13 @@ public virtual async Task> GetChannelWithK /// /// /// The cancellation token to use. - public virtual Response GetChannelWithKeys(CancellationToken cancellationToken = default) + public virtual Response GetWithKeys(CancellationToken cancellationToken = default) { - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.GetChannelWithKeys"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.GetWithKeys"); scope.Start(); try { - var response = _botChannelChannelsRestClient.ListWithKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _botChannelRestClient.ListWithKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -418,6 +418,90 @@ public virtual Response GetChannelWithKeys(Cancella } } + /// + /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys + /// + /// + /// Operation Id + /// BotChannels_RegenerateKeys + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters to provide for the created bot. + /// The cancellation token to use. + /// is null. + public virtual async Task> RegenerateKeysAsync(SiteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.RegenerateKeys"); + scope.Start(); + try + { + var response = await _botChannelRestClient.RegenerateKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new BotChannelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys + /// + /// + /// Operation Id + /// BotChannels_RegenerateKeys + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The parameters to provide for the created bot. + /// The cancellation token to use. + /// is null. + public virtual Response RegenerateKeys(SiteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.RegenerateKeys"); + scope.Start(); + try + { + var response = _botChannelRestClient.RegenerateKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + return Response.FromValue(new BotChannelResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Add a tag to the current resource. /// @@ -427,11 +511,11 @@ public virtual Response GetChannelWithKeys(Cancella /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -448,7 +532,7 @@ public virtual async Task> AddTagAsync(string key, Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.AddTag"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.AddTag"); scope.Start(); try { @@ -457,7 +541,7 @@ public virtual async Task> AddTagAsync(string key, var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _botChannelChannelsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _botChannelRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new BotChannelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -489,11 +573,11 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -510,7 +594,7 @@ public virtual Response AddTag(string key, string value, Can Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.AddTag"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.AddTag"); scope.Start(); try { @@ -519,7 +603,7 @@ public virtual Response AddTag(string key, string value, Can var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _botChannelChannelsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _botChannelRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new BotChannelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -551,11 +635,11 @@ public virtual Response AddTag(string key, string value, Can /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -570,7 +654,7 @@ public virtual async Task> SetTagsAsync(IDictionary { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.SetTags"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.SetTags"); scope.Start(); try { @@ -580,7 +664,7 @@ public virtual async Task> SetTagsAsync(IDictionary var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _botChannelChannelsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _botChannelRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new BotChannelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -608,11 +692,11 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -627,7 +711,7 @@ public virtual Response SetTags(IDictionary { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.SetTags"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.SetTags"); scope.Start(); try { @@ -637,7 +721,7 @@ public virtual Response SetTags(IDictionary var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _botChannelChannelsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _botChannelRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new BotChannelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -665,11 +749,11 @@ public virtual Response SetTags(IDictionary /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -684,7 +768,7 @@ public virtual async Task> RemoveTagAsync(string ke { Argument.AssertNotNull(key, nameof(key)); - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.RemoveTag"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.RemoveTag"); scope.Start(); try { @@ -693,7 +777,7 @@ public virtual async Task> RemoveTagAsync(string ke var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _botChannelChannelsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _botChannelRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new BotChannelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -725,11 +809,11 @@ public virtual async Task> RemoveTagAsync(string ke /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -744,7 +828,7 @@ public virtual Response RemoveTag(string key, CancellationTo { Argument.AssertNotNull(key, nameof(key)); - using var scope = _botChannelChannelsClientDiagnostics.CreateScope("BotChannelResource.RemoveTag"); + using var scope = _botChannelClientDiagnostics.CreateScope("BotChannelResource.RemoveTag"); scope.Start(); try { @@ -753,7 +837,7 @@ public virtual Response RemoveTag(string key, CancellationTo var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _botChannelChannelsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _botChannelRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new BotChannelResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotCollection.cs index 1b6c5155c078..8e3a179b6132 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotCollection.cs @@ -61,11 +61,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Bots_Create + /// Bot_Create /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -112,11 +112,11 @@ public virtual async Task> CreateOrUpdateAsync(WaitUnt /// /// /// Operation Id - /// Bots_Create + /// Bot_Create /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -163,11 +163,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, str /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -208,11 +208,11 @@ public virtual async Task> GetAsync(string resourceName, C /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -253,11 +253,11 @@ public virtual Response Get(string resourceName, CancellationToken /// /// /// Operation Id - /// Bots_ListByResourceGroup + /// Bot_ListByResourceGroup /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -283,11 +283,11 @@ public virtual AsyncPageable GetAllAsync(CancellationToken cancella /// /// /// Operation Id - /// Bots_ListByResourceGroup + /// Bot_ListByResourceGroup /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -313,11 +313,11 @@ public virtual Pageable GetAll(CancellationToken cancellationToken /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -356,11 +356,11 @@ public virtual async Task> ExistsAsync(string resourceName, Cance /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -399,11 +399,11 @@ public virtual Response Exists(string resourceName, CancellationToken canc /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -444,11 +444,11 @@ public virtual async Task> GetIfExistsAsync(string /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingResource.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingResource.Serialization.cs deleted file mode 100644 index f4b06977378d..000000000000 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.BotService -{ - public partial class BotConnectionSettingResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - BotConnectionSettingData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerBotServiceContext.Default); - - BotConnectionSettingData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerBotServiceContext.Default); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotData.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotData.Serialization.cs index afc9a530c1a6..b2654a940c70 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotData.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotData.Serialization.cs @@ -49,20 +49,13 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } if (Optional.IsDefined(Kind)) { - if (Kind != null) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.Value.ToString()); - } - else - { - writer.WriteNull("kind"); - } + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); } if (Optional.IsDefined(ETag)) { writer.WritePropertyName("etag"u8); - writer.WriteStringValue(ETag.Value.ToString()); + writer.WriteStringValue(ETag); } if (options.Format != "W" && Optional.IsCollectionDefined(Zones)) { @@ -99,7 +92,7 @@ internal static BotData DeserializeBotData(JsonElement element, ModelReaderWrite BotProperties properties = default; BotServiceSku sku = default; BotServiceKind? kind = default; - ETag? etag = default; + string etag = default; IReadOnlyList zones = default; IDictionary tags = default; AzureLocation location = default; @@ -133,7 +126,6 @@ internal static BotData DeserializeBotData(JsonElement element, ModelReaderWrite { if (property.Value.ValueKind == JsonValueKind.Null) { - kind = null; continue; } kind = new BotServiceKind(property.Value.GetString()); @@ -141,11 +133,7 @@ internal static BotData DeserializeBotData(JsonElement element, ModelReaderWrite } if (property.NameEquals("etag"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("zones"u8)) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotData.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotData.cs index fbc4e979dd46..6b5b9bcf9772 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotData.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotData.cs @@ -71,7 +71,7 @@ public BotData(AzureLocation location) : base(location) /// Entity Tag. /// Entity zones. /// Keeps track of any properties unknown to the library. - internal BotData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, BotProperties properties, BotServiceSku sku, BotServiceKind? kind, ETag? etag, IReadOnlyList zones, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal BotData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, BotProperties properties, BotServiceSku sku, BotServiceKind? kind, string etag, IReadOnlyList zones, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Properties = properties; Sku = sku; @@ -93,7 +93,7 @@ internal BotData() /// Required. Gets or sets the Kind of the resource. public BotServiceKind? Kind { get; set; } /// Entity Tag. - public ETag? ETag { get; set; } + public string ETag { get; set; } /// Entity zones. public IReadOnlyList Zones { get; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotResource.cs index 46239c8b13c4..afa93904348e 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotResource.cs @@ -38,12 +38,6 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _botClientDiagnostics; private readonly BotsRestOperations _botRestClient; - private readonly ClientDiagnostics _directLineClientDiagnostics; - private readonly DirectLineRestOperations _directLineRestClient; - private readonly ClientDiagnostics _emailClientDiagnostics; - private readonly EmailRestOperations _emailRestClient; - private readonly ClientDiagnostics _privateLinkResourcesClientDiagnostics; - private readonly PrivateLinkResourcesRestOperations _privateLinkResourcesRestClient; private readonly BotData _data; /// Gets the resource type for the operations. @@ -71,12 +65,6 @@ internal BotResource(ArmClient client, ResourceIdentifier id) : base(client, id) _botClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string botApiVersion); _botRestClient = new BotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, botApiVersion); - _directLineClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _directLineRestClient = new DirectLineRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _emailClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _emailRestClient = new EmailRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _privateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _privateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -119,11 +107,11 @@ public virtual BotChannelCollection GetBotChannels() /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -131,10 +119,12 @@ public virtual BotChannelCollection GetBotChannels() /// /// /// - /// The name of the Channel resource. + /// The name of the Bot resource. /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetBotChannelAsync(BotChannelName channelName, CancellationToken cancellationToken = default) + public virtual async Task> GetBotChannelAsync(string channelName, CancellationToken cancellationToken = default) { return await GetBotChannels().GetAsync(channelName, cancellationToken).ConfigureAwait(false); } @@ -148,11 +138,11 @@ public virtual async Task> GetBotChannelAsync(BotCh /// /// /// Operation Id - /// Channels_Get + /// BotChannel_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -160,19 +150,21 @@ public virtual async Task> GetBotChannelAsync(BotCh /// /// /// - /// The name of the Channel resource. + /// The name of the Bot resource. /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetBotChannel(BotChannelName channelName, CancellationToken cancellationToken = default) + public virtual Response GetBotChannel(string channelName, CancellationToken cancellationToken = default) { return GetBotChannels().Get(channelName, cancellationToken); } - /// Gets a collection of BotConnectionSettingResources in the Bot. - /// An object representing collection of BotConnectionSettingResources and their operations over a BotConnectionSettingResource. - public virtual BotConnectionSettingCollection GetBotConnectionSettings() + /// Gets a collection of ConnectionSettingResources in the Bot. + /// An object representing collection of ConnectionSettingResources and their operations over a ConnectionSettingResource. + public virtual ConnectionSettingCollection GetConnectionSettings() { - return GetCachedClient(client => new BotConnectionSettingCollection(client, Id)); + return GetCachedClient(client => new ConnectionSettingCollection(client, Id)); } /// @@ -184,15 +176,15 @@ public virtual BotConnectionSettingCollection GetBotConnectionSettings() /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -201,9 +193,9 @@ public virtual BotConnectionSettingCollection GetBotConnectionSettings() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetBotConnectionSettingAsync(string connectionName, CancellationToken cancellationToken = default) + public virtual async Task> GetConnectionSettingAsync(string connectionName, CancellationToken cancellationToken = default) { - return await GetBotConnectionSettings().GetAsync(connectionName, cancellationToken).ConfigureAwait(false); + return await GetConnectionSettings().GetAsync(connectionName, cancellationToken).ConfigureAwait(false); } /// @@ -215,15 +207,15 @@ public virtual async Task> GetBotConnecti /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -232,9 +224,9 @@ public virtual async Task> GetBotConnecti /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetBotConnectionSetting(string connectionName, CancellationToken cancellationToken = default) + public virtual Response GetConnectionSetting(string connectionName, CancellationToken cancellationToken = default) { - return GetBotConnectionSettings().Get(connectionName, cancellationToken); + return GetConnectionSettings().Get(connectionName, cancellationToken); } /// Gets a collection of BotServicePrivateEndpointConnectionResources in the Bot. @@ -253,11 +245,11 @@ public virtual BotServicePrivateEndpointConnectionCollection GetBotServicePrivat /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -284,11 +276,11 @@ public virtual async Task> /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -306,6 +298,75 @@ public virtual Response GetBotServi return GetBotServicePrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); } + /// Gets a collection of NetworkSecurityPerimeterConfigurationResources in the Bot. + /// An object representing collection of NetworkSecurityPerimeterConfigurationResources and their operations over a NetworkSecurityPerimeterConfigurationResource. + public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurityPerimeterConfigurations() + { + return GetCachedClient(client => new NetworkSecurityPerimeterConfigurationCollection(client, Id)); + } + + /// + /// Gets the specified Network Security Perimeter configuration associated with the Bot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfiguration_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource association Name. Composed of parameter guid and association name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkSecurityPerimeterConfigurationAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + return await GetNetworkSecurityPerimeterConfigurations().GetAsync(networkSecurityPerimeterConfigurationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified Network Security Perimeter configuration associated with the Bot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfiguration_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource association Name. Composed of parameter guid and association name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkSecurityPerimeterConfiguration(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + return GetNetworkSecurityPerimeterConfigurations().Get(networkSecurityPerimeterConfigurationName, cancellationToken); + } + /// /// Returns a BotService specified by the parameters. /// @@ -315,11 +376,11 @@ public virtual Response GetBotServi /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -355,11 +416,11 @@ public virtual async Task> GetAsync(CancellationToken canc /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -395,11 +456,11 @@ public virtual Response Get(CancellationToken cancellationToken = d /// /// /// Operation Id - /// Bots_Delete + /// Bot_Delete /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -439,11 +500,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// Bots_Delete + /// Bot_Delete /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -483,11 +544,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// Bots_Update + /// Bot_Update /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -525,11 +586,11 @@ public virtual async Task> UpdateAsync(BotData data, Cance /// /// /// Operation Id - /// Bots_Update + /// Bot_Update /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -559,75 +620,35 @@ public virtual Response Update(BotData data, CancellationToken canc } /// - /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource + /// Creates an email channel sign in url for a Bot Service /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/createEmailSignInUrl /// /// /// Operation Id - /// DirectLine_RegenerateKeys + /// Bots_CreateSignInUrl /// /// /// Default Api Version - /// 2022-09-15 - /// - /// - /// - /// The name of the Channel resource for which keys are to be regenerated. - /// The parameters to provide for the created bot. - /// The cancellation token to use. - /// is null. - public virtual async Task> GetBotChannelWithRegenerateKeysAsync(RegenerateKeysBotChannelName channelName, BotChannelRegenerateKeysContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _directLineClientDiagnostics.CreateScope("BotResource.GetBotChannelWithRegenerateKeys"); - scope.Start(); - try - { - var response = await _directLineRestClient.RegenerateKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, content, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new BotChannelResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/regeneratekeys - /// - /// - /// Operation Id - /// DirectLine_RegenerateKeys + /// 2023-09-15-preview /// /// - /// Default Api Version - /// 2022-09-15 + /// Resource + /// /// /// /// - /// The name of the Channel resource for which keys are to be regenerated. - /// The parameters to provide for the created bot. /// The cancellation token to use. - /// is null. - public virtual Response GetBotChannelWithRegenerateKeys(RegenerateKeysBotChannelName channelName, BotChannelRegenerateKeysContent content, CancellationToken cancellationToken = default) + public virtual async Task> CreateSignInUrlAsync(CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _directLineClientDiagnostics.CreateScope("BotResource.GetBotChannelWithRegenerateKeys"); + using var scope = _botClientDiagnostics.CreateScope("BotResource.CreateSignInUrl"); scope.Start(); try { - var response = _directLineRestClient.RegenerateKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, channelName, content, cancellationToken); - return Response.FromValue(new BotChannelResource(Client, response.Value), response.GetRawResponse()); + var response = await _botRestClient.CreateSignInUrlAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; } catch (Exception e) { @@ -645,56 +666,26 @@ public virtual Response GetBotChannelWithRegenerateKeys(Rege /// /// /// Operation Id - /// Email_CreateSignInUrl + /// Bots_CreateSignInUrl /// /// /// Default Api Version - /// 2022-09-15 - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> CreateEmailSignInUriAsync(CancellationToken cancellationToken = default) - { - using var scope = _emailClientDiagnostics.CreateScope("BotResource.CreateEmailSignInUri"); - scope.Start(); - try - { - var response = await _emailRestClient.CreateSignInUrlAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates an email channel sign in url for a Bot Service - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/createEmailSignInUrl + /// 2023-09-15-preview /// /// - /// Operation Id - /// Email_CreateSignInUrl - /// - /// - /// Default Api Version - /// 2022-09-15 + /// Resource + /// /// /// /// /// The cancellation token to use. - public virtual Response CreateEmailSignInUri(CancellationToken cancellationToken = default) + public virtual Response CreateSignInUrl(CancellationToken cancellationToken = default) { - using var scope = _emailClientDiagnostics.CreateScope("BotResource.CreateEmailSignInUri"); + using var scope = _botClientDiagnostics.CreateScope("BotResource.CreateSignInUrl"); scope.Start(); try { - var response = _emailRestClient.CreateSignInUrl(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _botRestClient.CreateSignInUrl(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -713,20 +704,24 @@ public virtual Response CreateEmailSignInUri(Canc /// /// /// Operation Id - /// PrivateLinkResources_ListByBotResource + /// Bots_ListByBotResource /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview + /// + /// + /// Resource + /// /// /// /// /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetPrivateLinkResourcesByBotResourceAsync(CancellationToken cancellationToken = default) + public virtual AsyncPageable GetByBotResourceAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListByBotResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => BotServicePrivateLinkResourceData.DeserializeBotServicePrivateLinkResourceData(e), _privateLinkResourcesClientDiagnostics, Pipeline, "BotResource.GetPrivateLinkResourcesByBotResource", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _botRestClient.CreateListByBotResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => BotServicePrivateLinkResourceData.DeserializeBotServicePrivateLinkResourceData(e), _botClientDiagnostics, Pipeline, "BotResource.GetByBotResource", "value", null, cancellationToken); } /// @@ -738,20 +733,24 @@ public virtual AsyncPageable GetPrivateLinkRe /// /// /// Operation Id - /// PrivateLinkResources_ListByBotResource + /// Bots_ListByBotResource /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview + /// + /// + /// Resource + /// /// /// /// /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetPrivateLinkResourcesByBotResource(CancellationToken cancellationToken = default) + public virtual Pageable GetByBotResource(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListByBotResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => BotServicePrivateLinkResourceData.DeserializeBotServicePrivateLinkResourceData(e), _privateLinkResourcesClientDiagnostics, Pipeline, "BotResource.GetPrivateLinkResourcesByBotResource", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _botRestClient.CreateListByBotResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => BotServicePrivateLinkResourceData.DeserializeBotServicePrivateLinkResourceData(e), _botClientDiagnostics, Pipeline, "BotResource.GetByBotResource", "value", null, cancellationToken); } /// @@ -763,11 +762,11 @@ public virtual Pageable GetPrivateLinkResourc /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -825,11 +824,11 @@ public virtual async Task> AddTagAsync(string key, string /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -887,11 +886,11 @@ public virtual Response AddTag(string key, string value, Cancellati /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -944,11 +943,11 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -1001,11 +1000,11 @@ public virtual Response SetTags(IDictionary tags, C /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -1061,11 +1060,11 @@ public virtual async Task> RemoveTagAsync(string key, Canc /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionCollection.cs index ff1151487764..70325599a3bb 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionCollection.cs @@ -60,11 +60,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// PrivateEndpointConnections_Create + /// PrivateEndpointConnection_Create /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -111,11 +111,11 @@ public virtual async Task /// /// Operation Id - /// PrivateEndpointConnections_Create + /// PrivateEndpointConnection_Create /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -162,11 +162,11 @@ public virtual ArmOperation CreateO /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -207,11 +207,11 @@ public virtual async Task> /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -252,11 +252,11 @@ public virtual Response Get(string /// /// /// Operation Id - /// PrivateEndpointConnections_List + /// PrivateEndpointConnection_List /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -269,7 +269,8 @@ public virtual Response Get(string public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => _botServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new BotServicePrivateEndpointConnectionResource(Client, BotServicePrivateEndpointConnectionData.DeserializeBotServicePrivateEndpointConnectionData(e)), _botServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "BotServicePrivateEndpointConnectionCollection.GetAll", "value", null, cancellationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _botServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BotServicePrivateEndpointConnectionResource(Client, BotServicePrivateEndpointConnectionData.DeserializeBotServicePrivateEndpointConnectionData(e)), _botServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "BotServicePrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -281,11 +282,11 @@ public virtual AsyncPageable GetAll /// /// /// Operation Id - /// PrivateEndpointConnections_List + /// PrivateEndpointConnection_List /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -298,7 +299,8 @@ public virtual AsyncPageable GetAll public virtual Pageable GetAll(CancellationToken cancellationToken = default) { HttpMessage FirstPageRequest(int? pageSizeHint) => _botServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new BotServicePrivateEndpointConnectionResource(Client, BotServicePrivateEndpointConnectionData.DeserializeBotServicePrivateEndpointConnectionData(e)), _botServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "BotServicePrivateEndpointConnectionCollection.GetAll", "value", null, cancellationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _botServicePrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BotServicePrivateEndpointConnectionResource(Client, BotServicePrivateEndpointConnectionData.DeserializeBotServicePrivateEndpointConnectionData(e)), _botServicePrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "BotServicePrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -310,11 +312,11 @@ public virtual Pageable GetAll(Canc /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -353,11 +355,11 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -396,11 +398,11 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -441,11 +443,11 @@ public virtual async Task /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionData.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionData.Serialization.cs index 82cca5de6d86..145c732a7005 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionData.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionData.Serialization.cs @@ -45,10 +45,10 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("privateEndpoint"u8); JsonSerializer.Serialize(writer, PrivateEndpoint); } - if (Optional.IsDefined(ConnectionState)) + if (Optional.IsDefined(PrivateLinkServiceConnectionState)) { writer.WritePropertyName("privateLinkServiceConnectionState"u8); - writer.WriteObjectValue(ConnectionState, options); + writer.WriteObjectValue(PrivateLinkServiceConnectionState, options); } if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionData.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionData.cs index c330ea088e32..2ba7536b2a9b 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionData.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionData.cs @@ -64,14 +64,14 @@ public BotServicePrivateEndpointConnectionData() /// The resourceType. /// The systemData. /// The resource of private end point. - /// A collection of information about the state of the connection between service consumer and provider. + /// A collection of information about the state of the connection between service consumer and provider. /// The provisioning state of the private endpoint connection resource. /// Group ids. /// Keeps track of any properties unknown to the library. - internal BotServicePrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SubResource privateEndpoint, BotServicePrivateLinkServiceConnectionState connectionState, BotServicePrivateEndpointConnectionProvisioningState? provisioningState, IList groupIds, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal BotServicePrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SubResource privateEndpoint, BotServicePrivateLinkServiceConnectionState privateLinkServiceConnectionState, BotServicePrivateEndpointConnectionProvisioningState? provisioningState, IList groupIds, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { PrivateEndpoint = privateEndpoint; - ConnectionState = connectionState; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; ProvisioningState = provisioningState; GroupIds = groupIds; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -86,7 +86,7 @@ public ResourceIdentifier PrivateEndpointId } /// A collection of information about the state of the connection between service consumer and provider. - public BotServicePrivateLinkServiceConnectionState ConnectionState { get; set; } + public BotServicePrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } /// The provisioning state of the private endpoint connection resource. public BotServicePrivateEndpointConnectionProvisioningState? ProvisioningState { get; } /// Group ids. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionResource.cs index f401e9c22ca5..2559c402dd51 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotServicePrivateEndpointConnectionResource.cs @@ -97,11 +97,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -137,11 +137,11 @@ public virtual async Task> /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -177,11 +177,11 @@ public virtual Response Get(Cancell /// /// /// Operation Id - /// PrivateEndpointConnections_Delete + /// PrivateEndpointConnection_Delete /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -221,11 +221,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// PrivateEndpointConnections_Delete + /// PrivateEndpointConnection_Delete /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -265,11 +265,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// PrivateEndpointConnections_Create + /// PrivateEndpointConnection_Create /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -313,11 +313,11 @@ public virtual async Task /// /// Operation Id - /// PrivateEndpointConnections_Create + /// PrivateEndpointConnection_Create /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingCollection.cs similarity index 62% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingCollection.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingCollection.cs index 53b4b881c2e2..6969fa4fbff0 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingCollection.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingCollection.cs @@ -18,28 +18,28 @@ namespace Azure.ResourceManager.BotService { /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetBotConnectionSettings method from an instance of . + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetConnectionSettings method from an instance of . /// - public partial class BotConnectionSettingCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class ConnectionSettingCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _botConnectionSettingBotConnectionClientDiagnostics; - private readonly BotConnectionRestOperations _botConnectionSettingBotConnectionRestClient; + private readonly ClientDiagnostics _connectionSettingClientDiagnostics; + private readonly ConnectionSettingsRestOperations _connectionSettingRestClient; - /// Initializes a new instance of the class for mocking. - protected BotConnectionSettingCollection() + /// Initializes a new instance of the class for mocking. + protected ConnectionSettingCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal BotConnectionSettingCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConnectionSettingCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _botConnectionSettingBotConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", BotConnectionSettingResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(BotConnectionSettingResource.ResourceType, out string botConnectionSettingBotConnectionApiVersion); - _botConnectionSettingBotConnectionRestClient = new BotConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, botConnectionSettingBotConnectionApiVersion); + _connectionSettingClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", ConnectionSettingResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ConnectionSettingResource.ResourceType, out string connectionSettingApiVersion); + _connectionSettingRestClient = new ConnectionSettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectionSettingApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -60,15 +60,15 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// BotConnection_Create + /// ConnectionSetting_Create /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -78,19 +78,19 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string connectionName, BotConnectionSettingData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string connectionName, ConnectionSettingData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingCollection.CreateOrUpdate"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _botConnectionSettingBotConnectionRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, data, cancellationToken).ConfigureAwait(false); - var uri = _botConnectionSettingBotConnectionRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, data); + var response = await _connectionSettingRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, data, cancellationToken).ConfigureAwait(false); + var uri = _connectionSettingRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, data); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new BotServiceArmOperation(Response.FromValue(new BotConnectionSettingResource(Client, response), response.GetRawResponse()), rehydrationToken); + var operation = new BotServiceArmOperation(Response.FromValue(new ConnectionSettingResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -111,15 +111,15 @@ public virtual async Task> CreateOrUp /// /// /// Operation Id - /// BotConnection_Create + /// ConnectionSetting_Create /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -129,19 +129,19 @@ public virtual async Task> CreateOrUp /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string connectionName, BotConnectionSettingData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string connectionName, ConnectionSettingData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingCollection.CreateOrUpdate"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingCollection.CreateOrUpdate"); scope.Start(); try { - var response = _botConnectionSettingBotConnectionRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, data, cancellationToken); - var uri = _botConnectionSettingBotConnectionRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, data); + var response = _connectionSettingRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, data, cancellationToken); + var uri = _connectionSettingRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, data); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new BotServiceArmOperation(Response.FromValue(new BotConnectionSettingResource(Client, response), response.GetRawResponse()), rehydrationToken); + var operation = new BotServiceArmOperation(Response.FromValue(new ConnectionSettingResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -162,15 +162,15 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -178,18 +178,18 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetAsync(string connectionName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string connectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingCollection.Get"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingCollection.Get"); scope.Start(); try { - var response = await _botConnectionSettingBotConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken).ConfigureAwait(false); + var response = await _connectionSettingRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new BotConnectionSettingResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectionSettingResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -207,15 +207,15 @@ public virtual async Task> GetAsync(strin /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -223,18 +223,18 @@ public virtual async Task> GetAsync(strin /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string connectionName, CancellationToken cancellationToken = default) + public virtual Response Get(string connectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingCollection.Get"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingCollection.Get"); scope.Start(); try { - var response = _botConnectionSettingBotConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken); + var response = _connectionSettingRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new BotConnectionSettingResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectionSettingResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -252,25 +252,25 @@ public virtual Response Get(string connectionName, /// /// /// Operation Id - /// BotConnection_ListByBotService + /// ConnectionSetting_ListByBotService /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _botConnectionSettingBotConnectionRestClient.CreateListByBotServiceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _botConnectionSettingBotConnectionRestClient.CreateListByBotServiceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BotConnectionSettingResource(Client, BotConnectionSettingData.DeserializeBotConnectionSettingData(e)), _botConnectionSettingBotConnectionClientDiagnostics, Pipeline, "BotConnectionSettingCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectionSettingRestClient.CreateListByBotServiceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectionSettingRestClient.CreateListByBotServiceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ConnectionSettingResource(Client, ConnectionSettingData.DeserializeConnectionSettingData(e)), _connectionSettingClientDiagnostics, Pipeline, "ConnectionSettingCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -282,25 +282,25 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Operation Id - /// BotConnection_ListByBotService + /// ConnectionSetting_ListByBotService /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _botConnectionSettingBotConnectionRestClient.CreateListByBotServiceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _botConnectionSettingBotConnectionRestClient.CreateListByBotServiceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BotConnectionSettingResource(Client, BotConnectionSettingData.DeserializeBotConnectionSettingData(e)), _botConnectionSettingBotConnectionClientDiagnostics, Pipeline, "BotConnectionSettingCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _connectionSettingRestClient.CreateListByBotServiceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _connectionSettingRestClient.CreateListByBotServiceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ConnectionSettingResource(Client, ConnectionSettingData.DeserializeConnectionSettingData(e)), _connectionSettingClientDiagnostics, Pipeline, "ConnectionSettingCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -312,15 +312,15 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -332,11 +332,11 @@ public virtual async Task> ExistsAsync(string connectionName, Can { Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingCollection.Exists"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingCollection.Exists"); scope.Start(); try { - var response = await _botConnectionSettingBotConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _connectionSettingRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -355,15 +355,15 @@ public virtual async Task> ExistsAsync(string connectionName, Can /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -375,11 +375,11 @@ public virtual Response Exists(string connectionName, CancellationToken ca { Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingCollection.Exists"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingCollection.Exists"); scope.Start(); try { - var response = _botConnectionSettingBotConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken: cancellationToken); + var response = _connectionSettingRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -398,15 +398,15 @@ public virtual Response Exists(string connectionName, CancellationToken ca /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -414,18 +414,18 @@ public virtual Response Exists(string connectionName, CancellationToken ca /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string connectionName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string connectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingCollection.GetIfExists"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingCollection.GetIfExists"); scope.Start(); try { - var response = await _botConnectionSettingBotConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _connectionSettingRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new BotConnectionSettingResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectionSettingResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -443,15 +443,15 @@ public virtual async Task> GetIfE /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -459,18 +459,18 @@ public virtual async Task> GetIfE /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string connectionName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string connectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingCollection.GetIfExists"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingCollection.GetIfExists"); scope.Start(); try { - var response = _botConnectionSettingBotConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken: cancellationToken); + var response = _connectionSettingRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, connectionName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new BotConnectionSettingResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ConnectionSettingResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -479,7 +479,7 @@ public virtual NullableResponse GetIfExists(string } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -489,7 +489,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingData.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingData.Serialization.cs similarity index 73% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingData.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingData.Serialization.cs index e9b6655c8110..0399a6df5c73 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingData.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingData.Serialization.cs @@ -15,11 +15,11 @@ namespace Azure.ResourceManager.BotService { - public partial class BotConnectionSettingData : IUtf8JsonSerializable, IJsonModel + public partial class ConnectionSettingData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -30,10 +30,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotConnectionSettingData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ConnectionSettingData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -49,20 +49,13 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } if (Optional.IsDefined(Kind)) { - if (Kind != null) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.Value.ToString()); - } - else - { - writer.WriteNull("kind"); - } + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); } if (Optional.IsDefined(ETag)) { writer.WritePropertyName("etag"u8); - writer.WriteStringValue(ETag.Value.ToString()); + writer.WriteStringValue(ETag); } if (options.Format != "W" && Optional.IsCollectionDefined(Zones)) { @@ -76,19 +69,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - BotConnectionSettingData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ConnectionSettingData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotConnectionSettingData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ConnectionSettingData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotConnectionSettingData(document.RootElement, options); + return DeserializeConnectionSettingData(document.RootElement, options); } - internal static BotConnectionSettingData DeserializeBotConnectionSettingData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ConnectionSettingData DeserializeConnectionSettingData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -96,10 +89,10 @@ internal static BotConnectionSettingData DeserializeBotConnectionSettingData(Jso { return null; } - BotConnectionSettingProperties properties = default; + ConnectionSettingProperties properties = default; BotServiceSku sku = default; BotServiceKind? kind = default; - ETag? etag = default; + string etag = default; IReadOnlyList zones = default; IDictionary tags = default; AzureLocation location = default; @@ -117,7 +110,7 @@ internal static BotConnectionSettingData DeserializeBotConnectionSettingData(Jso { continue; } - properties = BotConnectionSettingProperties.DeserializeBotConnectionSettingProperties(property.Value, options); + properties = ConnectionSettingProperties.DeserializeConnectionSettingProperties(property.Value, options); continue; } if (property.NameEquals("sku"u8)) @@ -133,7 +126,6 @@ internal static BotConnectionSettingData DeserializeBotConnectionSettingData(Jso { if (property.Value.ValueKind == JsonValueKind.Null) { - kind = null; continue; } kind = new BotServiceKind(property.Value.GetString()); @@ -141,11 +133,7 @@ internal static BotConnectionSettingData DeserializeBotConnectionSettingData(Jso } if (property.NameEquals("etag"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("zones"u8)) @@ -211,7 +199,7 @@ internal static BotConnectionSettingData DeserializeBotConnectionSettingData(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new BotConnectionSettingData( + return new ConnectionSettingData( id, name, type, @@ -226,35 +214,35 @@ internal static BotConnectionSettingData DeserializeBotConnectionSettingData(Jso serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotConnectionSettingData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectionSettingData)} does not support writing '{options.Format}' format."); } } - BotConnectionSettingData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ConnectionSettingData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotConnectionSettingData(document.RootElement, options); + return DeserializeConnectionSettingData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotConnectionSettingData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectionSettingData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingData.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingData.cs similarity index 75% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingData.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingData.cs index b0b37128b93d..0e8c8e941114 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingData.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.BotService { /// - /// A class representing the BotConnectionSetting data model. + /// A class representing the ConnectionSetting data model. /// Bot channel resource definition /// - public partial class BotConnectionSettingData : TrackedResourceData + public partial class ConnectionSettingData : TrackedResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,14 +51,14 @@ public partial class BotConnectionSettingData : TrackedResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The location. - public BotConnectionSettingData(AzureLocation location) : base(location) + public ConnectionSettingData(AzureLocation location) : base(location) { Zones = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -71,7 +71,7 @@ public BotConnectionSettingData(AzureLocation location) : base(location) /// Entity Tag. /// Entity zones. /// Keeps track of any properties unknown to the library. - internal BotConnectionSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, BotConnectionSettingProperties properties, BotServiceSku sku, BotServiceKind? kind, ETag? etag, IReadOnlyList zones, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ConnectionSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ConnectionSettingProperties properties, BotServiceSku sku, BotServiceKind? kind, string etag, IReadOnlyList zones, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { Properties = properties; Sku = sku; @@ -81,19 +81,19 @@ internal BotConnectionSettingData(ResourceIdentifier id, string name, ResourceTy _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal BotConnectionSettingData() + /// Initializes a new instance of for deserialization. + internal ConnectionSettingData() { } /// The set of properties specific to bot channel resource. - public BotConnectionSettingProperties Properties { get; set; } + public ConnectionSettingProperties Properties { get; set; } /// Gets or sets the SKU of the resource. public BotServiceSku Sku { get; set; } /// Required. Gets or sets the Kind of the resource. public BotServiceKind? Kind { get; set; } /// Entity Tag. - public ETag? ETag { get; set; } + public string ETag { get; set; } /// Entity zones. public IReadOnlyList Zones { get; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingResource.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingResource.Serialization.cs new file mode 100644 index 000000000000..d2c6c9621fe3 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.BotService +{ + public partial class ConnectionSettingResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ConnectionSettingData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerBotServiceContext.Default); + + ConnectionSettingData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerBotServiceContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingResource.cs similarity index 67% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingResource.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingResource.cs index 99bf5954c4cd..94154639bf9f 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/BotConnectionSettingResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/ConnectionSettingResource.cs @@ -16,14 +16,14 @@ namespace Azure.ResourceManager.BotService { /// - /// A Class representing a BotConnectionSetting along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetBotConnectionSettingResource method. - /// Otherwise you can get one from its parent resource using the GetBotConnectionSetting method. + /// A Class representing a ConnectionSetting along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetConnectionSettingResource method. + /// Otherwise you can get one from its parent resource using the GetConnectionSetting method. /// - public partial class BotConnectionSettingResource : ArmResource + public partial class ConnectionSettingResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. /// The resourceName. @@ -34,35 +34,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _botConnectionSettingBotConnectionClientDiagnostics; - private readonly BotConnectionRestOperations _botConnectionSettingBotConnectionRestClient; - private readonly BotConnectionSettingData _data; + private readonly ClientDiagnostics _connectionSettingClientDiagnostics; + private readonly ConnectionSettingsRestOperations _connectionSettingRestClient; + private readonly ConnectionSettingData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.BotService/botServices/connections"; - /// Initializes a new instance of the class for mocking. - protected BotConnectionSettingResource() + /// Initializes a new instance of the class for mocking. + protected ConnectionSettingResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal BotConnectionSettingResource(ArmClient client, BotConnectionSettingData data) : this(client, data.Id) + internal ConnectionSettingResource(ArmClient client, ConnectionSettingData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal BotConnectionSettingResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ConnectionSettingResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _botConnectionSettingBotConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string botConnectionSettingBotConnectionApiVersion); - _botConnectionSettingBotConnectionRestClient = new BotConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, botConnectionSettingBotConnectionApiVersion); + _connectionSettingClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string connectionSettingApiVersion); + _connectionSettingRestClient = new ConnectionSettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, connectionSettingApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -73,7 +73,7 @@ internal BotConnectionSettingResource(ArmClient client, ResourceIdentifier id) : /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual BotConnectionSettingData Data + public virtual ConnectionSettingData Data { get { @@ -98,29 +98,29 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.Get"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.Get"); scope.Start(); try { - var response = await _botConnectionSettingBotConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _connectionSettingRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new BotConnectionSettingResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectionSettingResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -138,29 +138,29 @@ public virtual async Task> GetAsync(Cance /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.Get"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.Get"); scope.Start(); try { - var response = _botConnectionSettingBotConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _connectionSettingRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new BotConnectionSettingResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ConnectionSettingResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -178,15 +178,15 @@ public virtual Response Get(CancellationToken canc /// /// /// Operation Id - /// BotConnection_Delete + /// ConnectionSetting_Delete /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -194,12 +194,12 @@ public virtual Response Get(CancellationToken canc /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.Delete"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.Delete"); scope.Start(); try { - var response = await _botConnectionSettingBotConnectionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var uri = _botConnectionSettingBotConnectionRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var response = await _connectionSettingRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _connectionSettingRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new BotServiceArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -222,15 +222,15 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// BotConnection_Delete + /// ConnectionSetting_Delete /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -238,12 +238,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.Delete"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.Delete"); scope.Start(); try { - var response = _botConnectionSettingBotConnectionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var uri = _botConnectionSettingBotConnectionRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var response = _connectionSettingRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _connectionSettingRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new BotServiceArmOperation(response, rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -266,31 +266,31 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// BotConnection_Update + /// ConnectionSetting_Update /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// /// The parameters to provide for updating the Connection Setting. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(BotConnectionSettingData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(ConnectionSettingData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.Update"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.Update"); scope.Start(); try { - var response = await _botConnectionSettingBotConnectionRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new BotConnectionSettingResource(Client, response.Value), response.GetRawResponse()); + var response = await _connectionSettingRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ConnectionSettingResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -308,31 +308,31 @@ public virtual async Task> UpdateAsync(Bo /// /// /// Operation Id - /// BotConnection_Update + /// ConnectionSetting_Update /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// /// The parameters to provide for updating the Connection Setting. /// The cancellation token to use. /// is null. - public virtual Response Update(BotConnectionSettingData data, CancellationToken cancellationToken = default) + public virtual Response Update(ConnectionSettingData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.Update"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.Update"); scope.Start(); try { - var response = _botConnectionSettingBotConnectionRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - return Response.FromValue(new BotConnectionSettingResource(Client, response.Value), response.GetRawResponse()); + var response = _connectionSettingRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + return Response.FromValue(new ConnectionSettingResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -350,27 +350,27 @@ public virtual Response Update(BotConnectionSettin /// /// /// Operation Id - /// BotConnection_ListWithSecrets + /// ConnectionSettings_ListWithSecrets /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetWithSecretsAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetWithSecretsAsync(CancellationToken cancellationToken = default) { - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.GetWithSecrets"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.GetWithSecrets"); scope.Start(); try { - var response = await _botConnectionSettingBotConnectionRestClient.ListWithSecretsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new BotConnectionSettingResource(Client, response.Value), response.GetRawResponse()); + var response = await _connectionSettingRestClient.ListWithSecretsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ConnectionSettingResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -388,27 +388,27 @@ public virtual async Task> GetWithSecrets /// /// /// Operation Id - /// BotConnection_ListWithSecrets + /// ConnectionSettings_ListWithSecrets /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response GetWithSecrets(CancellationToken cancellationToken = default) + public virtual Response GetWithSecrets(CancellationToken cancellationToken = default) { - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.GetWithSecrets"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.GetWithSecrets"); scope.Start(); try { - var response = _botConnectionSettingBotConnectionRestClient.ListWithSecrets(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new BotConnectionSettingResource(Client, response.Value), response.GetRawResponse()); + var response = _connectionSettingRestClient.ListWithSecrets(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ConnectionSettingResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -426,15 +426,15 @@ public virtual Response GetWithSecrets(Cancellatio /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -442,12 +442,12 @@ public virtual Response GetWithSecrets(Cancellatio /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.AddTag"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.AddTag"); scope.Start(); try { @@ -456,13 +456,13 @@ public virtual async Task> AddTagAsync(st var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _botConnectionSettingBotConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new BotConnectionSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _connectionSettingRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ConnectionSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new BotConnectionSettingData(current.Location); + var patch = new ConnectionSettingData(current.Location); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -488,15 +488,15 @@ public virtual async Task> AddTagAsync(st /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// @@ -504,12 +504,12 @@ public virtual async Task> AddTagAsync(st /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.AddTag"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.AddTag"); scope.Start(); try { @@ -518,13 +518,13 @@ public virtual Response AddTag(string key, string var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _botConnectionSettingBotConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new BotConnectionSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _connectionSettingRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ConnectionSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new BotConnectionSettingData(current.Location); + var patch = new ConnectionSettingData(current.Location); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -550,26 +550,26 @@ public virtual Response AddTag(string key, string /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.SetTags"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.SetTags"); scope.Start(); try { @@ -579,13 +579,13 @@ public virtual async Task> SetTagsAsync(I var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _botConnectionSettingBotConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new BotConnectionSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _connectionSettingRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ConnectionSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new BotConnectionSettingData(current.Location); + var patch = new ConnectionSettingData(current.Location); patch.Tags.ReplaceWith(tags); var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); return result; @@ -607,26 +607,26 @@ public virtual async Task> SetTagsAsync(I /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.SetTags"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.SetTags"); scope.Start(); try { @@ -636,13 +636,13 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.RemoveTag"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.RemoveTag"); scope.Start(); try { @@ -692,13 +692,13 @@ public virtual async Task> RemoveTagAsync var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _botConnectionSettingBotConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new BotConnectionSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _connectionSettingRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new ConnectionSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new BotConnectionSettingData(current.Location); + var patch = new ConnectionSettingData(current.Location); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -724,26 +724,26 @@ public virtual async Task> RemoveTagAsync /// /// /// Operation Id - /// BotConnection_Get + /// ConnectionSetting_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _botConnectionSettingBotConnectionClientDiagnostics.CreateScope("BotConnectionSettingResource.RemoveTag"); + using var scope = _connectionSettingClientDiagnostics.CreateScope("ConnectionSettingResource.RemoveTag"); scope.Start(); try { @@ -752,13 +752,13 @@ public virtual Response RemoveTag(string key, Canc var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _botConnectionSettingBotConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new BotConnectionSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _connectionSettingRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new ConnectionSettingResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new BotConnectionSettingData(current.Location); + var patch = new ConnectionSettingData(current.Location); foreach (var tag in current.Tags) { patch.Tags.Add(tag); diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceExtensions.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceExtensions.cs index b14ede76d989..d7e0cc203a16 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceExtensions.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/BotServiceExtensions.cs @@ -77,22 +77,22 @@ public static BotChannelResource GetBotChannelResource(this ArmClient client, Re } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static BotConnectionSettingResource GetBotConnectionSettingResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ConnectionSettingResource GetConnectionSettingResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableBotServiceArmClient(client).GetBotConnectionSettingResource(id); + return GetMockableBotServiceArmClient(client).GetConnectionSettingResource(id); } /// @@ -114,6 +114,25 @@ public static BotServicePrivateEndpointConnectionResource GetBotServicePrivateEn return GetMockableBotServiceArmClient(client).GetBotServicePrivateEndpointConnectionResource(id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableBotServiceArmClient(client).GetNetworkSecurityPerimeterConfigurationResource(id); + } + /// /// Gets a collection of BotResources in the ResourceGroupResource. /// @@ -140,11 +159,11 @@ public static BotCollection GetBots(this ResourceGroupResource resourceGroupReso /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -178,11 +197,11 @@ public static async Task> GetBotAsync(this ResourceGroupRe /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -216,11 +235,11 @@ public static Response GetBot(this ResourceGroupResource resourceGr /// /// /// Operation Id - /// Bots_List + /// Bot_List /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -252,11 +271,11 @@ public static AsyncPageable GetBotsAsync(this SubscriptionResource /// /// /// Operation Id - /// Bots_List + /// Bot_List /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -288,31 +307,27 @@ public static Pageable GetBots(this SubscriptionResource subscripti /// /// /// Operation Id - /// BotConnection_ListServiceProviders + /// BotConnectionOperationGroup_ListServiceProviders /// /// /// Default Api Version - /// 2022-09-15 - /// - /// - /// Resource - /// + /// 2023-09-15-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetBotConnectionServiceProvidersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetServiceProvidersBotConnectionOperationGroupsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotConnectionServiceProvidersAsync(cancellationToken); + return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetServiceProvidersBotConnectionOperationGroupsAsync(cancellationToken); } /// @@ -324,31 +339,27 @@ public static AsyncPageable GetBotConnectionServiceProviders /// /// /// Operation Id - /// BotConnection_ListServiceProviders + /// BotConnectionOperationGroup_ListServiceProviders /// /// /// Default Api Version - /// 2022-09-15 - /// - /// - /// Resource - /// + /// 2023-09-15-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetBotConnectionServiceProviders(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetServiceProvidersBotConnectionOperationGroups(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotConnectionServiceProviders(cancellationToken); + return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetServiceProvidersBotConnectionOperationGroups(cancellationToken); } /// @@ -360,27 +371,27 @@ public static Pageable GetBotConnectionServiceProviders(this /// /// /// Operation Id - /// QnAMakerEndpointKeys_Get + /// QnAMakerEndpointKeysOperationGroup_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The request body parameters to provide for the check name availability request. + /// The request body. /// The cancellation token to use. - /// or is null. - public static async Task> GetBotServiceQnAMakerEndpointKeyAsync(this SubscriptionResource subscriptionResource, GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) + /// or is null. + public static async Task> GetQnAMakerEndpointKeysOperationGroupAsync(this SubscriptionResource subscriptionResource, QnAMakerEndpointKeysRequestBody qnAMakerEndpointKeysRequestBody, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotServiceQnAMakerEndpointKeyAsync(content, cancellationToken).ConfigureAwait(false); + return await GetMockableBotServiceSubscriptionResource(subscriptionResource).GetQnAMakerEndpointKeysOperationGroupAsync(qnAMakerEndpointKeysRequestBody, cancellationToken).ConfigureAwait(false); } /// @@ -392,27 +403,27 @@ public static async Task> GetBo /// /// /// Operation Id - /// QnAMakerEndpointKeys_Get + /// QnAMakerEndpointKeysOperationGroup_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The request body parameters to provide for the check name availability request. + /// The request body. /// The cancellation token to use. - /// or is null. - public static Response GetBotServiceQnAMakerEndpointKey(this SubscriptionResource subscriptionResource, GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) + /// or is null. + public static Response GetQnAMakerEndpointKeysOperationGroup(this SubscriptionResource subscriptionResource, QnAMakerEndpointKeysRequestBody qnAMakerEndpointKeysRequestBody, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotServiceQnAMakerEndpointKey(content, cancellationToken); + return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetQnAMakerEndpointKeysOperationGroup(qnAMakerEndpointKeysRequestBody, cancellationToken); } /// @@ -424,26 +435,26 @@ public static Response GetBotServiceQnAM /// /// /// Operation Id - /// HostSettings_Get + /// HostSettingsOperationGroup_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - public static async Task> GetBotServiceHostSettingsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + public static async Task> GetHostSettingsOperationGroupAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotServiceHostSettingsAsync(cancellationToken).ConfigureAwait(false); + return await GetMockableBotServiceSubscriptionResource(subscriptionResource).GetHostSettingsOperationGroupAsync(cancellationToken).ConfigureAwait(false); } /// @@ -455,62 +466,158 @@ public static async Task> GetBotServiceHo /// /// /// Operation Id - /// HostSettings_Get + /// HostSettingsOperationGroup_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - public static Response GetBotServiceHostSettings(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + public static Response GetHostSettingsOperationGroup(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetBotServiceHostSettings(cancellationToken); + return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetHostSettingsOperationGroup(cancellationToken); } /// - /// Check whether a bot name is available. + /// Get the operation result for a long running operation. /// /// /// Request Path - /// /providers/Microsoft.BotService/checkNameAvailability + /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId} /// /// /// Operation Id - /// Bots_GetCheckNameAvailability + /// OperationResultsOperationGroup_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// + /// /// - /// Resource - /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The ID of the operation result to get. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static async Task> GetOperationResultsOperationGroupAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, string operationResultId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableBotServiceSubscriptionResource(subscriptionResource).GetOperationResultsOperationGroupAsync(waitUntil, operationResultId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the operation result for a long running operation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId} + /// + /// + /// Operation Id + /// OperationResultsOperationGroup_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The ID of the operation result to get. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static ArmOperation GetOperationResultsOperationGroup(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, string operationResultId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableBotServiceSubscriptionResource(subscriptionResource).GetOperationResultsOperationGroup(waitUntil, operationResultId, cancellationToken); + } + + /// + /// List the operations for the provider + /// + /// + /// Request Path + /// /providers/Microsoft.BotService/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The request body parameters to provide for the check name availability request. /// The cancellation token to use. - /// or is null. - public static async Task> CheckBotServiceNameAvailabilityAsync(this TenantResource tenantResource, BotServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetOperationsAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tenantResource, nameof(tenantResource)); - return await GetMockableBotServiceTenantResource(tenantResource).CheckBotServiceNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return GetMockableBotServiceTenantResource(tenantResource).GetOperationsAsync(cancellationToken); + } + + /// + /// List the operations for the provider + /// + /// + /// Request Path + /// /providers/Microsoft.BotService/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetOperations(this TenantResource tenantResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableBotServiceTenantResource(tenantResource).GetOperations(cancellationToken); } /// @@ -522,31 +629,59 @@ public static async Task> CheckBotSer /// /// /// Operation Id - /// Bots_GetCheckNameAvailability + /// BotsOperationGroup_GetCheckNameAvailability /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// + /// /// - /// Resource - /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The request body. + /// The cancellation token to use. + /// or is null. + public static async Task> GetCheckNameAvailabilityBotsOperationGroupAsync(this TenantResource tenantResource, CheckNameAvailabilityRequestBody checkNameAvailabilityRequestBody, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return await GetMockableBotServiceTenantResource(tenantResource).GetCheckNameAvailabilityBotsOperationGroupAsync(checkNameAvailabilityRequestBody, cancellationToken).ConfigureAwait(false); + } + + /// + /// Check whether a bot name is available. + /// + /// + /// Request Path + /// /providers/Microsoft.BotService/checkNameAvailability + /// + /// + /// Operation Id + /// BotsOperationGroup_GetCheckNameAvailability + /// + /// + /// Default Api Version + /// 2023-09-15-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The request body parameters to provide for the check name availability request. + /// The request body. /// The cancellation token to use. - /// or is null. - public static Response CheckBotServiceNameAvailability(this TenantResource tenantResource, BotServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// or is null. + public static Response GetCheckNameAvailabilityBotsOperationGroup(this TenantResource tenantResource, CheckNameAvailabilityRequestBody checkNameAvailabilityRequestBody, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tenantResource, nameof(tenantResource)); - return GetMockableBotServiceTenantResource(tenantResource).CheckBotServiceNameAvailability(content, cancellationToken); + return GetMockableBotServiceTenantResource(tenantResource).GetCheckNameAvailabilityBotsOperationGroup(checkNameAvailabilityRequestBody, cancellationToken); } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceArmClient.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceArmClient.cs index ca1e2010df63..8e2cabd815e9 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceArmClient.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceArmClient.cs @@ -59,15 +59,15 @@ public virtual BotChannelResource GetBotChannelResource(ResourceIdentifier id) } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual BotConnectionSettingResource GetBotConnectionSettingResource(ResourceIdentifier id) + /// Returns a object. + public virtual ConnectionSettingResource GetConnectionSettingResource(ResourceIdentifier id) { - BotConnectionSettingResource.ValidateResourceId(id); - return new BotConnectionSettingResource(Client, id); + ConnectionSettingResource.ValidateResourceId(id); + return new ConnectionSettingResource(Client, id); } /// @@ -81,5 +81,17 @@ public virtual BotServicePrivateEndpointConnectionResource GetBotServicePrivateE BotServicePrivateEndpointConnectionResource.ValidateResourceId(id); return new BotServicePrivateEndpointConnectionResource(Client, id); } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(ResourceIdentifier id) + { + NetworkSecurityPerimeterConfigurationResource.ValidateResourceId(id); + return new NetworkSecurityPerimeterConfigurationResource(Client, id); + } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceResourceGroupResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceResourceGroupResource.cs index b3cfa9bccaef..07b2b1980772 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceResourceGroupResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceResourceGroupResource.cs @@ -49,11 +49,11 @@ public virtual BotCollection GetBots() /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -80,11 +80,11 @@ public virtual async Task> GetBotAsync(string resourceName /// /// /// Operation Id - /// Bots_Get + /// Bot_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceSubscriptionResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceSubscriptionResource.cs index ec75a63e4927..f0b265e45887 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceSubscriptionResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceSubscriptionResource.cs @@ -20,12 +20,14 @@ public partial class MockableBotServiceSubscriptionResource : ArmResource { private ClientDiagnostics _botClientDiagnostics; private BotsRestOperations _botRestClient; - private ClientDiagnostics _botConnectionSettingBotConnectionClientDiagnostics; - private BotConnectionRestOperations _botConnectionSettingBotConnectionRestClient; - private ClientDiagnostics _qnAMakerEndpointKeysClientDiagnostics; - private QnAMakerEndpointKeysRestOperations _qnAMakerEndpointKeysRestClient; - private ClientDiagnostics _hostSettingsClientDiagnostics; - private HostSettingsRestOperations _hostSettingsRestClient; + private ClientDiagnostics _botConnectionOperationGroupClientDiagnostics; + private BotConnectionOperationGroupRestOperations _botConnectionOperationGroupRestClient; + private ClientDiagnostics _qnAMakerEndpointKeysOperationGroupClientDiagnostics; + private QnAMakerEndpointKeysOperationGroupRestOperations _qnAMakerEndpointKeysOperationGroupRestClient; + private ClientDiagnostics _hostSettingsOperationGroupClientDiagnostics; + private HostSettingsOperationGroupRestOperations _hostSettingsOperationGroupRestClient; + private ClientDiagnostics _operationResultsOperationGroupClientDiagnostics; + private OperationResultsOperationGroupRestOperations _operationResultsOperationGroupRestClient; /// Initializes a new instance of the class for mocking. protected MockableBotServiceSubscriptionResource() @@ -41,12 +43,14 @@ internal MockableBotServiceSubscriptionResource(ArmClient client, ResourceIdenti private ClientDiagnostics BotClientDiagnostics => _botClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.BotService", BotResource.ResourceType.Namespace, Diagnostics); private BotsRestOperations BotRestClient => _botRestClient ??= new BotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(BotResource.ResourceType)); - private ClientDiagnostics BotConnectionSettingBotConnectionClientDiagnostics => _botConnectionSettingBotConnectionClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.BotService", BotConnectionSettingResource.ResourceType.Namespace, Diagnostics); - private BotConnectionRestOperations BotConnectionSettingBotConnectionRestClient => _botConnectionSettingBotConnectionRestClient ??= new BotConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(BotConnectionSettingResource.ResourceType)); - private ClientDiagnostics QnAMakerEndpointKeysClientDiagnostics => _qnAMakerEndpointKeysClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.BotService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private QnAMakerEndpointKeysRestOperations QnAMakerEndpointKeysRestClient => _qnAMakerEndpointKeysRestClient ??= new QnAMakerEndpointKeysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics HostSettingsClientDiagnostics => _hostSettingsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.BotService", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private HostSettingsRestOperations HostSettingsRestClient => _hostSettingsRestClient ??= new HostSettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics BotConnectionOperationGroupClientDiagnostics => _botConnectionOperationGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.BotService", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private BotConnectionOperationGroupRestOperations BotConnectionOperationGroupRestClient => _botConnectionOperationGroupRestClient ??= new BotConnectionOperationGroupRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics QnAMakerEndpointKeysOperationGroupClientDiagnostics => _qnAMakerEndpointKeysOperationGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.BotService", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private QnAMakerEndpointKeysOperationGroupRestOperations QnAMakerEndpointKeysOperationGroupRestClient => _qnAMakerEndpointKeysOperationGroupRestClient ??= new QnAMakerEndpointKeysOperationGroupRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics HostSettingsOperationGroupClientDiagnostics => _hostSettingsOperationGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.BotService", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private HostSettingsOperationGroupRestOperations HostSettingsOperationGroupRestClient => _hostSettingsOperationGroupRestClient ??= new HostSettingsOperationGroupRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics OperationResultsOperationGroupClientDiagnostics => _operationResultsOperationGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.BotService", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private OperationResultsOperationGroupRestOperations OperationResultsOperationGroupRestClient => _operationResultsOperationGroupRestClient ??= new OperationResultsOperationGroupRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -63,11 +67,11 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Operation Id - /// Bots_List + /// Bot_List /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -93,11 +97,11 @@ public virtual AsyncPageable GetBotsAsync(CancellationToken cancell /// /// /// Operation Id - /// Bots_List + /// Bot_List /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// Resource @@ -123,24 +127,20 @@ public virtual Pageable GetBots(CancellationToken cancellationToken /// /// /// Operation Id - /// BotConnection_ListServiceProviders + /// BotConnectionOperationGroup_ListServiceProviders /// /// /// Default Api Version - /// 2022-09-15 - /// - /// - /// Resource - /// + /// 2023-09-15-preview /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetBotConnectionServiceProvidersAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetServiceProvidersBotConnectionOperationGroupsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => BotConnectionSettingBotConnectionRestClient.CreateListServiceProvidersRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => BotServiceProvider.DeserializeBotServiceProvider(e), BotConnectionSettingBotConnectionClientDiagnostics, Pipeline, "MockableBotServiceSubscriptionResource.GetBotConnectionServiceProviders", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => BotConnectionOperationGroupRestClient.CreateListServiceProvidersRequest(Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => ServiceProvider.DeserializeServiceProvider(e), BotConnectionOperationGroupClientDiagnostics, Pipeline, "MockableBotServiceSubscriptionResource.GetServiceProvidersBotConnectionOperationGroups", "value", null, cancellationToken); } /// @@ -152,24 +152,20 @@ public virtual AsyncPageable GetBotConnectionServiceProvider /// /// /// Operation Id - /// BotConnection_ListServiceProviders + /// BotConnectionOperationGroup_ListServiceProviders /// /// /// Default Api Version - /// 2022-09-15 - /// - /// - /// Resource - /// + /// 2023-09-15-preview /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetBotConnectionServiceProviders(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetServiceProvidersBotConnectionOperationGroups(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => BotConnectionSettingBotConnectionRestClient.CreateListServiceProvidersRequest(Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => BotServiceProvider.DeserializeBotServiceProvider(e), BotConnectionSettingBotConnectionClientDiagnostics, Pipeline, "MockableBotServiceSubscriptionResource.GetBotConnectionServiceProviders", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => BotConnectionOperationGroupRestClient.CreateListServiceProvidersRequest(Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ServiceProvider.DeserializeServiceProvider(e), BotConnectionOperationGroupClientDiagnostics, Pipeline, "MockableBotServiceSubscriptionResource.GetServiceProvidersBotConnectionOperationGroups", "value", null, cancellationToken); } /// @@ -181,26 +177,26 @@ public virtual Pageable GetBotConnectionServiceProviders(Can /// /// /// Operation Id - /// QnAMakerEndpointKeys_Get + /// QnAMakerEndpointKeysOperationGroup_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// - /// The request body parameters to provide for the check name availability request. + /// The request body. /// The cancellation token to use. - /// is null. - public virtual async Task> GetBotServiceQnAMakerEndpointKeyAsync(GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> GetQnAMakerEndpointKeysOperationGroupAsync(QnAMakerEndpointKeysRequestBody qnAMakerEndpointKeysRequestBody, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(qnAMakerEndpointKeysRequestBody, nameof(qnAMakerEndpointKeysRequestBody)); - using var scope = QnAMakerEndpointKeysClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetBotServiceQnAMakerEndpointKey"); + using var scope = QnAMakerEndpointKeysOperationGroupClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetQnAMakerEndpointKeysOperationGroup"); scope.Start(); try { - var response = await QnAMakerEndpointKeysRestClient.GetAsync(Id.SubscriptionId, content, cancellationToken).ConfigureAwait(false); + var response = await QnAMakerEndpointKeysOperationGroupRestClient.GetAsync(Id.SubscriptionId, qnAMakerEndpointKeysRequestBody, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -219,26 +215,26 @@ public virtual async Task> GetB /// /// /// Operation Id - /// QnAMakerEndpointKeys_Get + /// QnAMakerEndpointKeysOperationGroup_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// - /// The request body parameters to provide for the check name availability request. + /// The request body. /// The cancellation token to use. - /// is null. - public virtual Response GetBotServiceQnAMakerEndpointKey(GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) + /// is null. + public virtual Response GetQnAMakerEndpointKeysOperationGroup(QnAMakerEndpointKeysRequestBody qnAMakerEndpointKeysRequestBody, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(qnAMakerEndpointKeysRequestBody, nameof(qnAMakerEndpointKeysRequestBody)); - using var scope = QnAMakerEndpointKeysClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetBotServiceQnAMakerEndpointKey"); + using var scope = QnAMakerEndpointKeysOperationGroupClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetQnAMakerEndpointKeysOperationGroup"); scope.Start(); try { - var response = QnAMakerEndpointKeysRestClient.Get(Id.SubscriptionId, content, cancellationToken); + var response = QnAMakerEndpointKeysOperationGroupRestClient.Get(Id.SubscriptionId, qnAMakerEndpointKeysRequestBody, cancellationToken); return response; } catch (Exception e) @@ -257,22 +253,22 @@ public virtual Response GetBotServiceQnA /// /// /// Operation Id - /// HostSettings_Get + /// HostSettingsOperationGroup_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// /// The cancellation token to use. - public virtual async Task> GetBotServiceHostSettingsAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetHostSettingsOperationGroupAsync(CancellationToken cancellationToken = default) { - using var scope = HostSettingsClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetBotServiceHostSettings"); + using var scope = HostSettingsOperationGroupClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetHostSettingsOperationGroup"); scope.Start(); try { - var response = await HostSettingsRestClient.GetAsync(Id.SubscriptionId, cancellationToken).ConfigureAwait(false); + var response = await HostSettingsOperationGroupRestClient.GetAsync(Id.SubscriptionId, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -291,22 +287,22 @@ public virtual async Task> GetBotServiceH /// /// /// Operation Id - /// HostSettings_Get + /// HostSettingsOperationGroup_Get /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// /// /// /// The cancellation token to use. - public virtual Response GetBotServiceHostSettings(CancellationToken cancellationToken = default) + public virtual Response GetHostSettingsOperationGroup(CancellationToken cancellationToken = default) { - using var scope = HostSettingsClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetBotServiceHostSettings"); + using var scope = HostSettingsOperationGroupClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetHostSettingsOperationGroup"); scope.Start(); try { - var response = HostSettingsRestClient.Get(Id.SubscriptionId, cancellationToken); + var response = HostSettingsOperationGroupRestClient.Get(Id.SubscriptionId, cancellationToken); return response; } catch (Exception e) @@ -315,5 +311,91 @@ public virtual Response GetBotServiceHostSettings( throw; } } + + /// + /// Get the operation result for a long running operation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId} + /// + /// + /// Operation Id + /// OperationResultsOperationGroup_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The ID of the operation result to get. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetOperationResultsOperationGroupAsync(WaitUntil waitUntil, string operationResultId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationResultId, nameof(operationResultId)); + + using var scope = OperationResultsOperationGroupClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetOperationResultsOperationGroup"); + scope.Start(); + try + { + var response = await OperationResultsOperationGroupRestClient.GetAsync(Id.SubscriptionId, operationResultId, cancellationToken).ConfigureAwait(false); + var operation = new BotServiceArmOperation(new OperationResultsDescriptionOperationSource(), OperationResultsOperationGroupClientDiagnostics, Pipeline, OperationResultsOperationGroupRestClient.CreateGetRequest(Id.SubscriptionId, operationResultId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the operation result for a long running operation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId} + /// + /// + /// Operation Id + /// OperationResultsOperationGroup_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The ID of the operation result to get. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual ArmOperation GetOperationResultsOperationGroup(WaitUntil waitUntil, string operationResultId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(operationResultId, nameof(operationResultId)); + + using var scope = OperationResultsOperationGroupClientDiagnostics.CreateScope("MockableBotServiceSubscriptionResource.GetOperationResultsOperationGroup"); + scope.Start(); + try + { + var response = OperationResultsOperationGroupRestClient.Get(Id.SubscriptionId, operationResultId, cancellationToken); + var operation = new BotServiceArmOperation(new OperationResultsDescriptionOperationSource(), OperationResultsOperationGroupClientDiagnostics, Pipeline, OperationResultsOperationGroupRestClient.CreateGetRequest(Id.SubscriptionId, operationResultId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceTenantResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceTenantResource.cs index 3f3e81f37315..bf03e76f81db 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceTenantResource.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Extensions/MockableBotServiceTenantResource.cs @@ -8,6 +8,7 @@ using System; using System.Threading; using System.Threading.Tasks; +using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.BotService.Models; @@ -17,8 +18,10 @@ namespace Azure.ResourceManager.BotService.Mocking /// A class to add extension methods to TenantResource. public partial class MockableBotServiceTenantResource : ArmResource { - private ClientDiagnostics _botClientDiagnostics; - private BotsRestOperations _botRestClient; + private ClientDiagnostics _operationsClientDiagnostics; + private OperationsRestOperations _operationsRestClient; + private ClientDiagnostics _botsOperationGroupClientDiagnostics; + private BotsOperationGroupRestOperations _botsOperationGroupRestClient; /// Initializes a new instance of the class for mocking. protected MockableBotServiceTenantResource() @@ -32,8 +35,10 @@ internal MockableBotServiceTenantResource(ArmClient client, ResourceIdentifier i { } - private ClientDiagnostics BotClientDiagnostics => _botClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.BotService", BotResource.ResourceType.Namespace, Diagnostics); - private BotsRestOperations BotRestClient => _botRestClient ??= new BotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(BotResource.ResourceType)); + private ClientDiagnostics OperationsClientDiagnostics => _operationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.BotService", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private OperationsRestOperations OperationsRestClient => _operationsRestClient ??= new OperationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics BotsOperationGroupClientDiagnostics => _botsOperationGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.BotService", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private BotsOperationGroupRestOperations BotsOperationGroupRestClient => _botsOperationGroupRestClient ??= new BotsOperationGroupRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -42,38 +47,86 @@ private string GetApiVersionOrNull(ResourceType resourceType) } /// - /// Check whether a bot name is available. + /// List the operations for the provider /// /// /// Request Path - /// /providers/Microsoft.BotService/checkNameAvailability + /// /providers/Microsoft.BotService/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetOperationsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsRestClient.CreateListRequest(); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationsRestClient.CreateListNextPageRequest(nextLink); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => OperationEntity.DeserializeOperationEntity(e), OperationsClientDiagnostics, Pipeline, "MockableBotServiceTenantResource.GetOperations", "value", "nextLink", cancellationToken); + } + + /// + /// List the operations for the provider + /// + /// + /// Request Path + /// /providers/Microsoft.BotService/operations /// /// /// Operation Id - /// Bots_GetCheckNameAvailability + /// Operations_List /// /// /// Default Api Version - /// 2022-09-15 + /// 2023-09-15-preview /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetOperations(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsRestClient.CreateListRequest(); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationsRestClient.CreateListNextPageRequest(nextLink); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => OperationEntity.DeserializeOperationEntity(e), OperationsClientDiagnostics, Pipeline, "MockableBotServiceTenantResource.GetOperations", "value", "nextLink", cancellationToken); + } + + /// + /// Check whether a bot name is available. + /// /// - /// Resource - /// + /// Request Path + /// /providers/Microsoft.BotService/checkNameAvailability + /// + /// + /// Operation Id + /// BotsOperationGroup_GetCheckNameAvailability + /// + /// + /// Default Api Version + /// 2023-09-15-preview /// /// /// - /// The request body parameters to provide for the check name availability request. + /// The request body. /// The cancellation token to use. - /// is null. - public virtual async Task> CheckBotServiceNameAvailabilityAsync(BotServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> GetCheckNameAvailabilityBotsOperationGroupAsync(CheckNameAvailabilityRequestBody checkNameAvailabilityRequestBody, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(checkNameAvailabilityRequestBody, nameof(checkNameAvailabilityRequestBody)); - using var scope = BotClientDiagnostics.CreateScope("MockableBotServiceTenantResource.CheckBotServiceNameAvailability"); + using var scope = BotsOperationGroupClientDiagnostics.CreateScope("MockableBotServiceTenantResource.GetCheckNameAvailabilityBotsOperationGroup"); scope.Start(); try { - var response = await BotRestClient.GetCheckNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + var response = await BotsOperationGroupRestClient.GetCheckNameAvailabilityAsync(checkNameAvailabilityRequestBody, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -92,30 +145,26 @@ public virtual async Task> CheckBotSe /// /// /// Operation Id - /// Bots_GetCheckNameAvailability + /// BotsOperationGroup_GetCheckNameAvailability /// /// /// Default Api Version - /// 2022-09-15 - /// - /// - /// Resource - /// + /// 2023-09-15-preview /// /// /// - /// The request body parameters to provide for the check name availability request. + /// The request body. /// The cancellation token to use. - /// is null. - public virtual Response CheckBotServiceNameAvailability(BotServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// is null. + public virtual Response GetCheckNameAvailabilityBotsOperationGroup(CheckNameAvailabilityRequestBody checkNameAvailabilityRequestBody, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(checkNameAvailabilityRequestBody, nameof(checkNameAvailabilityRequestBody)); - using var scope = BotClientDiagnostics.CreateScope("MockableBotServiceTenantResource.CheckBotServiceNameAvailability"); + using var scope = BotsOperationGroupClientDiagnostics.CreateScope("MockableBotServiceTenantResource.GetCheckNameAvailabilityBotsOperationGroup"); scope.Start(); try { - var response = BotRestClient.GetCheckNameAvailability(content, cancellationToken); + var response = BotsOperationGroupRestClient.GetCheckNameAvailability(checkNameAvailabilityRequestBody, cancellationToken); return response; } catch (Exception e) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/LongRunningOperation/NetworkSecurityPerimeterConfigurationOperationSource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/LongRunningOperation/NetworkSecurityPerimeterConfigurationOperationSource.cs new file mode 100644 index 000000000000..c70ecf7983ea --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/LongRunningOperation/NetworkSecurityPerimeterConfigurationOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.BotService +{ + internal class NetworkSecurityPerimeterConfigurationOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal NetworkSecurityPerimeterConfigurationOperationSource(ArmClient client) + { + _client = client; + } + + NetworkSecurityPerimeterConfigurationResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerBotServiceContext.Default); + return new NetworkSecurityPerimeterConfigurationResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerBotServiceContext.Default); + return await Task.FromResult(new NetworkSecurityPerimeterConfigurationResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/LongRunningOperation/OperationResultsDescriptionOperationSource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/LongRunningOperation/OperationResultsDescriptionOperationSource.cs new file mode 100644 index 000000000000..6bae399913f2 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/LongRunningOperation/OperationResultsDescriptionOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.BotService.Models; + +namespace Azure.ResourceManager.BotService +{ + internal class OperationResultsDescriptionOperationSource : IOperationSource + { + OperationResultsDescription IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return OperationResultsDescription.DeserializeOperationResultsDescription(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return OperationResultsDescription.DeserializeOperationResultsDescription(document.RootElement); + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/.Serialization.cs new file mode 100644 index 000000000000..1326071597ab --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/.Serialization.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => (System.ClientModel.Primitives.IJsonModel < Models.>this).Write(writer, global::Azure.ResourceManager.BotService.ModelSerializationExtensions.WireOptions); + +void global::System.ClientModel.Primitives.IJsonModel.Write(global::System.Text.Json.Utf8JsonWriter writer,global::System.ClientModel.Primitives.ModelReaderWriterOptions options) +{ + writer.WriteStartObject(); + this.JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + +/// The JSON writer. +/// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? (System.ClientModel.Primitives.IPersistableModel < Models.>this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Models.)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Models.global::System.ClientModel.Primitives.IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) +{ +var format = options.Format == "W" ? (System.ClientModel.Primitives.IPersistableModel < Models.>this).GetFormatFromOptions(options) : options.Format; +if ((format != "J")) +{ +throw new FormatException($"The model {nameof(global::Azure.ResourceManager.BotService.Models.)} does not support reading '{format}' format."); +} + +using JsonDocument document = JsonDocument.ParseValue(ref reader); +return Azure.ResourceManager.BotService.Models..Deserialize(document.RootElement, options); +} + +internal static Azure.ResourceManager.BotService.Models.Deserialize(JsonElement element, System.ClientModel.Primitives.ModelReaderWriterOptions options = (ModelReaderWriterOptions)null) +{ + options ??= Azure.ResourceManager.BotService.ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == global::System.Text.Json.JsonValueKind.Null) + { + return null; + } + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, global::System.BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Azure.ResourceManager.BotService.Models.(serializedAdditionalRawData); +} + +BinaryData System.ClientModel.Primitives.IPersistableModel.Write(ModelReaderWriterOptions options) +{ + var format = options.Format == "W" ? (System.ClientModel.Primitives.IPersistableModel < Azure.ResourceManager.BotService.Models.>this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(Azure.ResourceManager.BotService.Models.)} does not support writing '{options.Format}' format."); + } +} + +Azure.ResourceManager.BotService.Models.global::System.ClientModel.Primitives.IPersistableModel < Azure.ResourceManager.BotService.Models.>.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) +{ + var format = options.Format == "W" ? (System.ClientModel.Primitives.IPersistableModel < Azure.ResourceManager.BotService.Models.>this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, Azure.ResourceManager.BotService.ModelSerializationExtensions.JsonDocumentOptions); + return Azure.ResourceManager.BotService.Models..Deserialize(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Azure.ResourceManager.BotService.Models.)} does not support reading '{options.Format}' format."); + } +} + +string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; +} +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/.cs new file mode 100644 index 000000000000..48a0f87688ae --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.BotService.Models +{ + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal () +{ +} + +/// Initializes a new instance of . +/// Keeps track of any properties unknown to the library. +internal (IDictionary serializedAdditionalRawData) +{ + _serializedAdditionalRawData = serializedAdditionalRawData; +} +} +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AccessMode.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AccessMode.cs new file mode 100644 index 000000000000..f5889082be41 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AccessMode.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.BotService.Models +{ + /// Access Mode of the resource association. + public readonly partial struct AccessMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AccessMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnforcedValue = "Enforced"; + private const string LearningValue = "Learning"; + private const string AuditValue = "Audit"; + + /// Enforced. + public static AccessMode Enforced { get; } = new AccessMode(EnforcedValue); + /// Learning. + public static AccessMode Learning { get; } = new AccessMode(LearningValue); + /// Audit. + public static AccessMode Audit { get; } = new AccessMode(AuditValue); + /// Determines if two values are the same. + public static bool operator ==(AccessMode left, AccessMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AccessMode left, AccessMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AccessMode(string value) => new AccessMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AccessMode other && Equals(other); + /// + public bool Equals(AccessMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AcsChatChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AcsChatChannel.Serialization.cs index 61511ffa2254..daa9271db05f 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AcsChatChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AcsChatChannel.Serialization.cs @@ -58,9 +58,9 @@ internal static AcsChatChannel DeserializeAcsChatChannel(JsonElement element, Mo return null; } string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -77,7 +77,7 @@ internal static AcsChatChannel DeserializeAcsChatChannel(JsonElement element, Mo etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -87,11 +87,7 @@ internal static AcsChatChannel DeserializeAcsChatChannel(JsonElement element, Mo } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AcsChatChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AcsChatChannel.cs index e1d4e2c72198..f9e59b046cfb 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AcsChatChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AcsChatChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// AcsChat channel definition. - public partial class AcsChatChannel : BotChannelProperties + public partial class AcsChatChannel : Channel { /// Initializes a new instance of . public AcsChatChannel() @@ -26,7 +25,7 @@ public AcsChatChannel() /// Provisioning state of the resource. /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. - internal AcsChatChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal AcsChatChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { ChannelName = channelName ?? "AcsChatChannel"; } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannel.Serialization.cs index 534d822ff98e..6969cf302bad 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static AlexaChannel DeserializeAlexaChannel(JsonElement element, ModelR } AlexaChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static AlexaChannel DeserializeAlexaChannel(JsonElement element, ModelR etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static AlexaChannel DeserializeAlexaChannel(JsonElement element, ModelR } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannel.cs index 8e93787d3174..eab7c64ad148 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Alexa channel definition. - public partial class AlexaChannel : BotChannelProperties + public partial class AlexaChannel : Channel { /// Initializes a new instance of . public AlexaChannel() @@ -27,7 +26,7 @@ public AlexaChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to Alexa channel resource. - internal AlexaChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, AlexaChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal AlexaChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, AlexaChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "AlexaChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannelProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannelProperties.Serialization.cs index f96af0b66dfe..21b742b96aa6 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannelProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannelProperties.Serialization.cs @@ -36,15 +36,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("alexaSkillId"u8); writer.WriteStringValue(AlexaSkillId); - if (options.Format != "W" && Optional.IsDefined(UriFragment)) + if (options.Format != "W" && Optional.IsDefined(UrlFragment)) { writer.WritePropertyName("urlFragment"u8); - writer.WriteStringValue(UriFragment); + writer.WriteStringValue(UrlFragment); } if (options.Format != "W" && Optional.IsDefined(ServiceEndpointUri)) { writer.WritePropertyName("serviceEndpointUri"u8); - writer.WriteStringValue(ServiceEndpointUri.AbsoluteUri); + writer.WriteStringValue(ServiceEndpointUri); } writer.WritePropertyName("isEnabled"u8); writer.WriteBooleanValue(IsEnabled); @@ -87,7 +87,7 @@ internal static AlexaChannelProperties DeserializeAlexaChannelProperties(JsonEle } string alexaSkillId = default; string urlFragment = default; - Uri serviceEndpointUri = default; + string serviceEndpointUri = default; bool isEnabled = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -105,11 +105,7 @@ internal static AlexaChannelProperties DeserializeAlexaChannelProperties(JsonEle } if (property.NameEquals("serviceEndpointUri"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - serviceEndpointUri = new Uri(property.Value.GetString()); + serviceEndpointUri = property.Value.GetString(); continue; } if (property.NameEquals("isEnabled"u8)) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannelProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannelProperties.cs index ec8398269909..8e5184f64be1 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannelProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/AlexaChannelProperties.cs @@ -59,14 +59,14 @@ public AlexaChannelProperties(string alexaSkillId, bool isEnabled) /// Initializes a new instance of . /// The Alexa skill Id. - /// Url fragment used in part of the Uri configured in Alexa. + /// Url fragment used in part of the Uri configured in Alexa. /// Full Uri used to configured the skill in Alexa. /// Whether this channel is enabled for the bot. /// Keeps track of any properties unknown to the library. - internal AlexaChannelProperties(string alexaSkillId, string uriFragment, Uri serviceEndpointUri, bool isEnabled, IDictionary serializedAdditionalRawData) + internal AlexaChannelProperties(string alexaSkillId, string urlFragment, string serviceEndpointUri, bool isEnabled, IDictionary serializedAdditionalRawData) { AlexaSkillId = alexaSkillId; - UriFragment = uriFragment; + UrlFragment = urlFragment; ServiceEndpointUri = serviceEndpointUri; IsEnabled = isEnabled; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -80,9 +80,9 @@ internal AlexaChannelProperties() /// The Alexa skill Id. public string AlexaSkillId { get; set; } /// Url fragment used in part of the Uri configured in Alexa. - public string UriFragment { get; } + public string UrlFragment { get; } /// Full Uri used to configured the skill in Alexa. - public Uri ServiceEndpointUri { get; } + public string ServiceEndpointUri { get; } /// Whether this channel is enabled for the bot. public bool IsEnabled { get; set; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelName.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelName.cs deleted file mode 100644 index 3c650a317e96..000000000000 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelName.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.BotService.Models -{ - /// The BotChannelName. - public readonly partial struct BotChannelName : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public BotChannelName(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AlexaChannelValue = "AlexaChannel"; - private const string FacebookChannelValue = "FacebookChannel"; - private const string EmailChannelValue = "EmailChannel"; - private const string KikChannelValue = "KikChannel"; - private const string TelegramChannelValue = "TelegramChannel"; - private const string SlackChannelValue = "SlackChannel"; - private const string MsTeamsChannelValue = "MsTeamsChannel"; - private const string SkypeChannelValue = "SkypeChannel"; - private const string WebChatChannelValue = "WebChatChannel"; - private const string DirectLineChannelValue = "DirectLineChannel"; - private const string SmsChannelValue = "SmsChannel"; - private const string LineChannelValue = "LineChannel"; - private const string DirectLineSpeechChannelValue = "DirectLineSpeechChannel"; - private const string OutlookChannelValue = "OutlookChannel"; - private const string OmnichannelValue = "Omnichannel"; - private const string TelephonyChannelValue = "TelephonyChannel"; - private const string AcsChatChannelValue = "AcsChatChannel"; - private const string SearchAssistantValue = "SearchAssistant"; - private const string M365ExtensionsValue = "M365Extensions"; - - /// AlexaChannel. - public static BotChannelName AlexaChannel { get; } = new BotChannelName(AlexaChannelValue); - /// FacebookChannel. - public static BotChannelName FacebookChannel { get; } = new BotChannelName(FacebookChannelValue); - /// EmailChannel. - public static BotChannelName EmailChannel { get; } = new BotChannelName(EmailChannelValue); - /// KikChannel. - public static BotChannelName KikChannel { get; } = new BotChannelName(KikChannelValue); - /// TelegramChannel. - public static BotChannelName TelegramChannel { get; } = new BotChannelName(TelegramChannelValue); - /// SlackChannel. - public static BotChannelName SlackChannel { get; } = new BotChannelName(SlackChannelValue); - /// MsTeamsChannel. - public static BotChannelName MsTeamsChannel { get; } = new BotChannelName(MsTeamsChannelValue); - /// SkypeChannel. - public static BotChannelName SkypeChannel { get; } = new BotChannelName(SkypeChannelValue); - /// WebChatChannel. - public static BotChannelName WebChatChannel { get; } = new BotChannelName(WebChatChannelValue); - /// DirectLineChannel. - public static BotChannelName DirectLineChannel { get; } = new BotChannelName(DirectLineChannelValue); - /// SmsChannel. - public static BotChannelName SmsChannel { get; } = new BotChannelName(SmsChannelValue); - /// LineChannel. - public static BotChannelName LineChannel { get; } = new BotChannelName(LineChannelValue); - /// DirectLineSpeechChannel. - public static BotChannelName DirectLineSpeechChannel { get; } = new BotChannelName(DirectLineSpeechChannelValue); - /// OutlookChannel. - public static BotChannelName OutlookChannel { get; } = new BotChannelName(OutlookChannelValue); - /// Omnichannel. - public static BotChannelName Omnichannel { get; } = new BotChannelName(OmnichannelValue); - /// TelephonyChannel. - public static BotChannelName TelephonyChannel { get; } = new BotChannelName(TelephonyChannelValue); - /// AcsChatChannel. - public static BotChannelName AcsChatChannel { get; } = new BotChannelName(AcsChatChannelValue); - /// SearchAssistant. - public static BotChannelName SearchAssistant { get; } = new BotChannelName(SearchAssistantValue); - /// M365Extensions. - public static BotChannelName M365Extensions { get; } = new BotChannelName(M365ExtensionsValue); - /// Determines if two values are the same. - public static bool operator ==(BotChannelName left, BotChannelName right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(BotChannelName left, BotChannelName right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator BotChannelName(string value) => new BotChannelName(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is BotChannelName other && Equals(other); - /// - public bool Equals(BotChannelName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotProperties.Serialization.cs index e8f1c705de27..47fda9c72ffc 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotProperties.Serialization.cs @@ -44,12 +44,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(IconUri)) { writer.WritePropertyName("iconUrl"u8); - writer.WriteStringValue(IconUri.AbsoluteUri); + writer.WriteStringValue(IconUri); } if (Endpoint != null) { writer.WritePropertyName("endpoint"u8); - writer.WriteStringValue(Endpoint.AbsoluteUri); + writer.WriteStringValue(Endpoint); } else { @@ -85,7 +85,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(ManifestUri)) { writer.WritePropertyName("manifestUrl"u8); - writer.WriteStringValue(ManifestUri.AbsoluteUri); + writer.WriteStringValue(ManifestUri); } if (Optional.IsDefined(MsaAppType)) { @@ -162,7 +162,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(CmekKeyVaultUri)) { writer.WritePropertyName("cmekKeyVaultUrl"u8); - writer.WriteStringValue(CmekKeyVaultUri.AbsoluteUri); + writer.WriteStringValue(CmekKeyVaultUri); } if (options.Format != "W" && Optional.IsDefined(CmekEncryptionStatus)) { @@ -172,7 +172,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); - writer.WriteStringValue(TenantId.Value); + writer.WriteStringValue(TenantId); } if (Optional.IsDefined(PublicNetworkAccess)) { @@ -194,10 +194,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("migrationToken"u8); writer.WriteStringValue(MigrationToken); } - if (Optional.IsDefined(IsLocalAuthDisabled)) + if (Optional.IsDefined(DisableLocalAuth)) { writer.WritePropertyName("disableLocalAuth"u8); - writer.WriteBooleanValue(IsLocalAuthDisabled.Value); + writer.WriteBooleanValue(DisableLocalAuth.Value); } if (Optional.IsDefined(SchemaTransformationVersion)) { @@ -226,6 +226,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (options.Format != "W" && Optional.IsCollectionDefined(NetworkSecurityPerimeterConfigurations)) + { + writer.WritePropertyName("networkSecurityPerimeterConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in NetworkSecurityPerimeterConfigurations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (Optional.IsDefined(OpenWithHint)) { writer.WritePropertyName("openWithHint"u8); @@ -285,16 +295,16 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode } string displayName = default; string description = default; - Uri iconUrl = default; - Uri endpoint = default; + string iconUrl = default; + string endpoint = default; string endpointVersion = default; IDictionary allSettings = default; IDictionary parameters = default; - Uri manifestUrl = default; - BotMsaAppType? msaAppType = default; + string manifestUrl = default; + MsaAppType? msaAppType = default; string msaAppId = default; string msaAppTenantId = default; - ResourceIdentifier msaAppMSIResourceId = default; + string msaAppMSIResourceId = default; IReadOnlyList configuredChannels = default; IReadOnlyList enabledChannels = default; string developerAppInsightKey = default; @@ -303,17 +313,18 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode IList luisAppIds = default; string luisKey = default; bool? isCmekEnabled = default; - Uri cmekKeyVaultUrl = default; + string cmekKeyVaultUrl = default; string cmekEncryptionStatus = default; - Guid? tenantId = default; - BotServicePublicNetworkAccess? publicNetworkAccess = default; + string tenantId = default; + PublicNetworkAccess? publicNetworkAccess = default; bool? isStreamingSupported = default; bool? isDeveloperAppInsightsApiKeySet = default; string migrationToken = default; bool? disableLocalAuth = default; string schemaTransformationVersion = default; - ResourceIdentifier storageResourceId = default; + string storageResourceId = default; IReadOnlyList privateEndpointConnections = default; + IReadOnlyList networkSecurityPerimeterConfigurations = default; string openWithHint = default; string appPasswordHint = default; string provisioningState = default; @@ -334,11 +345,7 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode } if (property.NameEquals("iconUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - iconUrl = new Uri(property.Value.GetString()); + iconUrl = property.Value.GetString(); continue; } if (property.NameEquals("endpoint"u8)) @@ -348,7 +355,7 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode endpoint = null; continue; } - endpoint = new Uri(property.Value.GetString()); + endpoint = property.Value.GetString(); continue; } if (property.NameEquals("endpointVersion"u8)) @@ -386,11 +393,7 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode } if (property.NameEquals("manifestUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - manifestUrl = new Uri(property.Value.GetString()); + manifestUrl = property.Value.GetString(); continue; } if (property.NameEquals("msaAppType"u8)) @@ -399,7 +402,7 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode { continue; } - msaAppType = new BotMsaAppType(property.Value.GetString()); + msaAppType = new MsaAppType(property.Value.GetString()); continue; } if (property.NameEquals("msaAppId"u8)) @@ -414,11 +417,7 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode } if (property.NameEquals("msaAppMSIResourceId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - msaAppMSIResourceId = new ResourceIdentifier(property.Value.GetString()); + msaAppMSIResourceId = property.Value.GetString(); continue; } if (property.NameEquals("configuredChannels"u8)) @@ -494,11 +493,7 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode } if (property.NameEquals("cmekKeyVaultUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - cmekKeyVaultUrl = new Uri(property.Value.GetString()); + cmekKeyVaultUrl = property.Value.GetString(); continue; } if (property.NameEquals("cmekEncryptionStatus"u8)) @@ -508,11 +503,7 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode } if (property.NameEquals("tenantId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - tenantId = property.Value.GetGuid(); + tenantId = property.Value.GetString(); continue; } if (property.NameEquals("publicNetworkAccess"u8)) @@ -521,7 +512,7 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode { continue; } - publicNetworkAccess = new BotServicePublicNetworkAccess(property.Value.GetString()); + publicNetworkAccess = new PublicNetworkAccess(property.Value.GetString()); continue; } if (property.NameEquals("isStreamingSupported"u8)) @@ -568,11 +559,7 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode } if (property.NameEquals("storageResourceId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - storageResourceId = new ResourceIdentifier(property.Value.GetString()); + storageResourceId = property.Value.GetString(); continue; } if (property.NameEquals("privateEndpointConnections"u8)) @@ -589,6 +576,20 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode privateEndpointConnections = array; continue; } + if (property.NameEquals("networkSecurityPerimeterConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(item, options)); + } + networkSecurityPerimeterConfigurations = array; + continue; + } if (property.NameEquals("openWithHint"u8)) { openWithHint = property.Value.GetString(); @@ -647,6 +648,7 @@ internal static BotProperties DeserializeBotProperties(JsonElement element, Mode schemaTransformationVersion, storageResourceId, privateEndpointConnections ?? new ChangeTrackingList(), + networkSecurityPerimeterConfigurations ?? new ChangeTrackingList(), openWithHint, appPasswordHint, provisioningState, diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotProperties.cs index a30913a988b1..e2c97c6f5b4b 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotProperties.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { @@ -51,7 +50,7 @@ public partial class BotProperties /// The bot's endpoint. /// Microsoft App Id for the bot. /// or is null. - public BotProperties(string displayName, Uri endpoint, string msaAppId) + public BotProperties(string displayName, string endpoint, string msaAppId) { Argument.AssertNotNull(displayName, nameof(displayName)); Argument.AssertNotNull(msaAppId, nameof(msaAppId)); @@ -65,6 +64,7 @@ public BotProperties(string displayName, Uri endpoint, string msaAppId) EnabledChannels = new ChangeTrackingList(); LuisAppIds = new ChangeTrackingList(); PrivateEndpointConnections = new ChangeTrackingList(); + NetworkSecurityPerimeterConfigurations = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -95,16 +95,17 @@ public BotProperties(string displayName, Uri endpoint, string msaAppId) /// Whether the bot is streaming supported. /// Whether the bot is developerAppInsightsApiKey set. /// Token used to migrate non Azure bot to azure subscription. - /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. + /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// The channel schema transformation version for the bot. /// The storage resourceId for the bot. /// List of Private Endpoint Connections configured for the bot. + /// List of Network Security Perimeter configurations for the bot. /// The hint to browser (e.g. protocol handler) on how to open the bot for authoring. /// The hint (e.g. keyVault secret resourceId) on how to fetch the app secret. /// Provisioning state of the resource. /// Publishing credentials of the resource. /// Keeps track of any properties unknown to the library. - internal BotProperties(string displayName, string description, Uri iconUri, Uri endpoint, string endpointVersion, IDictionary allSettings, IDictionary parameters, Uri manifestUri, BotMsaAppType? msaAppType, string msaAppId, string msaAppTenantId, ResourceIdentifier msaAppMSIResourceId, IReadOnlyList configuredChannels, IReadOnlyList enabledChannels, string developerAppInsightKey, string developerAppInsightsApiKey, string developerAppInsightsApplicationId, IList luisAppIds, string luisKey, bool? isCmekEnabled, Uri cmekKeyVaultUri, string cmekEncryptionStatus, Guid? tenantId, BotServicePublicNetworkAccess? publicNetworkAccess, bool? isStreamingSupported, bool? isDeveloperAppInsightsApiKeySet, string migrationToken, bool? isLocalAuthDisabled, string schemaTransformationVersion, ResourceIdentifier storageResourceId, IReadOnlyList privateEndpointConnections, string openWithHint, string appPasswordHint, string provisioningState, string publishingCredentials, IDictionary serializedAdditionalRawData) + internal BotProperties(string displayName, string description, string iconUri, string endpoint, string endpointVersion, IDictionary allSettings, IDictionary parameters, string manifestUri, MsaAppType? msaAppType, string msaAppId, string msaAppTenantId, string msaAppMSIResourceId, IReadOnlyList configuredChannels, IReadOnlyList enabledChannels, string developerAppInsightKey, string developerAppInsightsApiKey, string developerAppInsightsApplicationId, IList luisAppIds, string luisKey, bool? isCmekEnabled, string cmekKeyVaultUri, string cmekEncryptionStatus, string tenantId, PublicNetworkAccess? publicNetworkAccess, bool? isStreamingSupported, bool? isDeveloperAppInsightsApiKeySet, string migrationToken, bool? disableLocalAuth, string schemaTransformationVersion, string storageResourceId, IReadOnlyList privateEndpointConnections, IReadOnlyList networkSecurityPerimeterConfigurations, string openWithHint, string appPasswordHint, string provisioningState, string publishingCredentials, IDictionary serializedAdditionalRawData) { DisplayName = displayName; Description = description; @@ -133,10 +134,11 @@ internal BotProperties(string displayName, string description, Uri iconUri, Uri IsStreamingSupported = isStreamingSupported; IsDeveloperAppInsightsApiKeySet = isDeveloperAppInsightsApiKeySet; MigrationToken = migrationToken; - IsLocalAuthDisabled = isLocalAuthDisabled; + DisableLocalAuth = disableLocalAuth; SchemaTransformationVersion = schemaTransformationVersion; StorageResourceId = storageResourceId; PrivateEndpointConnections = privateEndpointConnections; + NetworkSecurityPerimeterConfigurations = networkSecurityPerimeterConfigurations; OpenWithHint = openWithHint; AppPasswordHint = appPasswordHint; ProvisioningState = provisioningState; @@ -154,9 +156,9 @@ internal BotProperties() /// The description of the bot. public string Description { get; set; } /// The Icon Url of the bot. - public Uri IconUri { get; set; } + public string IconUri { get; set; } /// The bot's endpoint. - public Uri Endpoint { get; set; } + public string Endpoint { get; set; } /// The bot's endpoint version. public string EndpointVersion { get; } /// Contains resource all settings defined as key/value pairs. @@ -164,15 +166,15 @@ internal BotProperties() /// Contains resource parameters defined as key/value pairs. public IDictionary Parameters { get; } /// The bot's manifest url. - public Uri ManifestUri { get; set; } + public string ManifestUri { get; set; } /// Microsoft App Type for the bot. - public BotMsaAppType? MsaAppType { get; set; } + public MsaAppType? MsaAppType { get; set; } /// Microsoft App Id for the bot. public string MsaAppId { get; set; } /// Microsoft App Tenant Id for the bot. public string MsaAppTenantId { get; set; } /// Microsoft App Managed Identity Resource Id for the bot. - public ResourceIdentifier MsaAppMSIResourceId { get; set; } + public string MsaAppMSIResourceId { get; set; } /// Collection of channels for which the bot is configured. public IReadOnlyList ConfiguredChannels { get; } /// Collection of channels for which the bot is enabled. @@ -190,13 +192,13 @@ internal BotProperties() /// Whether Cmek is enabled. public bool? IsCmekEnabled { get; set; } /// The CMK Url. - public Uri CmekKeyVaultUri { get; set; } + public string CmekKeyVaultUri { get; set; } /// The CMK encryption status. public string CmekEncryptionStatus { get; } /// The Tenant Id for the bot. - public Guid? TenantId { get; set; } + public string TenantId { get; set; } /// Whether the bot is in an isolated network. - public BotServicePublicNetworkAccess? PublicNetworkAccess { get; set; } + public PublicNetworkAccess? PublicNetworkAccess { get; set; } /// Whether the bot is streaming supported. public bool? IsStreamingSupported { get; set; } /// Whether the bot is developerAppInsightsApiKey set. @@ -204,13 +206,15 @@ internal BotProperties() /// Token used to migrate non Azure bot to azure subscription. public string MigrationToken { get; } /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. - public bool? IsLocalAuthDisabled { get; set; } + public bool? DisableLocalAuth { get; set; } /// The channel schema transformation version for the bot. public string SchemaTransformationVersion { get; set; } /// The storage resourceId for the bot. - public ResourceIdentifier StorageResourceId { get; set; } + public string StorageResourceId { get; set; } /// List of Private Endpoint Connections configured for the bot. public IReadOnlyList PrivateEndpointConnections { get; } + /// List of Network Security Perimeter configurations for the bot. + public IReadOnlyList NetworkSecurityPerimeterConfigurations { get; } /// The hint to browser (e.g. protocol handler) on how to open the bot for authoring. public string OpenWithHint { get; set; } /// The hint (e.g. keyVault secret resourceId) on how to fetch the app secret. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotResponseList.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotResponseList.Serialization.cs index 2bf3bc551407..9e0708bbdd28 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotResponseList.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotResponseList.Serialization.cs @@ -34,12 +34,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(BotResponseList)} does not support writing '{format}' format."); } - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + if (options.Format != "W") { writer.WritePropertyName("value"u8); writer.WriteStartArray(); @@ -49,6 +44,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -86,23 +86,14 @@ internal static BotResponseList DeserializeBotResponseList(JsonElement element, { return null; } - string nextLink = default; IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -111,13 +102,22 @@ internal static BotResponseList DeserializeBotResponseList(JsonElement element, value = array; continue; } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new BotResponseList(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new BotResponseList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotResponseList.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotResponseList.cs index 06a2d1f5e482..c55df1cb3047 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotResponseList.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotResponseList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.BotService.Models { @@ -46,25 +47,31 @@ internal partial class BotResponseList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal BotResponseList() + /// The Bot items on this page. + internal BotResponseList(IEnumerable value) { - Value = new ChangeTrackingList(); + Value = value.ToList(); } /// Initializes a new instance of . - /// The link used to get the next page of bot service resources. - /// Gets the list of bot service results and their properties. + /// The Bot items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal BotResponseList(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal BotResponseList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { - NextLink = nextLink; Value = value; + NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The link used to get the next page of bot service resources. - public string NextLink { get; } - /// Gets the list of bot service results and their properties. + /// Initializes a new instance of for deserialization. + internal BotResponseList() + { + } + + /// The Bot items on this page. public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateEndpointConnectionListResult.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateEndpointConnectionListResult.Serialization.cs index 0e583e944c2f..74bf70e0f7e8 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateEndpointConnectionListResult.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateEndpointConnectionListResult.Serialization.cs @@ -44,6 +44,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -82,6 +87,7 @@ internal static BotServicePrivateEndpointConnectionListResult DeserializeBotServ return null; } IReadOnlyList value = default; + string nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -100,13 +106,18 @@ internal static BotServicePrivateEndpointConnectionListResult DeserializeBotServ value = array; continue; } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new BotServicePrivateEndpointConnectionListResult(value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new BotServicePrivateEndpointConnectionListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateEndpointConnectionListResult.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateEndpointConnectionListResult.cs index c9090a927ebf..5b4de789c274 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateEndpointConnectionListResult.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateEndpointConnectionListResult.cs @@ -53,14 +53,18 @@ internal BotServicePrivateEndpointConnectionListResult() /// Initializes a new instance of . /// Array of private endpoint connections. + /// The link used to get the next page of private endpoint connections. /// Keeps track of any properties unknown to the library. - internal BotServicePrivateEndpointConnectionListResult(IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal BotServicePrivateEndpointConnectionListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) { Value = value; + NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Array of private endpoint connections. public IReadOnlyList Value { get; } + /// The link used to get the next page of private endpoint connections. + public string NextLink { get; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateLinkResourceData.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateLinkResourceData.Serialization.cs index 6085fa9268ac..afb1bb6b7da5 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateLinkResourceData.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateLinkResourceData.Serialization.cs @@ -92,7 +92,7 @@ internal static BotServicePrivateLinkResourceData DeserializeBotServicePrivateLi SystemData systemData = default; string groupId = default; IReadOnlyList requiredMembers = default; - IList requiredZoneNames = default; + IReadOnlyList requiredZoneNames = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateLinkResourceData.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateLinkResourceData.cs index 14ff6c65f59b..26cd4578dde2 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateLinkResourceData.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePrivateLinkResourceData.cs @@ -48,7 +48,7 @@ public partial class BotServicePrivateLinkResourceData : ResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public BotServicePrivateLinkResourceData() + internal BotServicePrivateLinkResourceData() { RequiredMembers = new ChangeTrackingList(); RequiredZoneNames = new ChangeTrackingList(); @@ -63,7 +63,7 @@ public BotServicePrivateLinkResourceData() /// The private link resource required member names. /// The private link resource Private link DNS zone name. /// Keeps track of any properties unknown to the library. - internal BotServicePrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string groupId, IReadOnlyList requiredMembers, IList requiredZoneNames, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal BotServicePrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string groupId, IReadOnlyList requiredMembers, IReadOnlyList requiredZoneNames, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { GroupId = groupId; RequiredMembers = requiredMembers; @@ -76,6 +76,6 @@ internal BotServicePrivateLinkResourceData(ResourceIdentifier id, string name, R /// The private link resource required member names. public IReadOnlyList RequiredMembers { get; } /// The private link resource Private link DNS zone name. - public IList RequiredZoneNames { get; } + public IReadOnlyList RequiredZoneNames { get; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePublicNetworkAccess.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePublicNetworkAccess.cs deleted file mode 100644 index 26b2b4a2bd65..000000000000 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServicePublicNetworkAccess.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.BotService.Models -{ - /// Whether the bot is in an isolated network. - public readonly partial struct BotServicePublicNetworkAccess : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public BotServicePublicNetworkAccess(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static BotServicePublicNetworkAccess Enabled { get; } = new BotServicePublicNetworkAccess(EnabledValue); - /// Disabled. - public static BotServicePublicNetworkAccess Disabled { get; } = new BotServicePublicNetworkAccess(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(BotServicePublicNetworkAccess left, BotServicePublicNetworkAccess right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(BotServicePublicNetworkAccess left, BotServicePublicNetworkAccess right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator BotServicePublicNetworkAccess(string value) => new BotServicePublicNetworkAccess(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is BotServicePublicNetworkAccess other && Equals(other); - /// - public bool Equals(BotServicePublicNetworkAccess other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceSeverity.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceSeverity.cs new file mode 100644 index 000000000000..014a5eff409f --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceSeverity.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.BotService.Models +{ + /// Provisioning state of Network Security Perimeter configuration propagation. + public readonly partial struct BotServiceSeverity : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BotServiceSeverity(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WarningValue = "Warning"; + private const string ErrorValue = "Error"; + + /// Warning. + public static BotServiceSeverity Warning { get; } = new BotServiceSeverity(WarningValue); + /// Error. + public static BotServiceSeverity Error { get; } = new BotServiceSeverity(ErrorValue); + /// Determines if two values are the same. + public static bool operator ==(BotServiceSeverity left, BotServiceSeverity right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BotServiceSeverity left, BotServiceSeverity right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BotServiceSeverity(string value) => new BotServiceSeverity(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BotServiceSeverity other && Equals(other); + /// + public bool Equals(BotServiceSeverity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Channel.Serialization.cs similarity index 74% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelProperties.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Channel.Serialization.cs index 2939f53a617c..b13603487052 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Channel.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { [PersistableModelProxy(typeof(UnknownChannel))] - public partial class BotChannelProperties : IUtf8JsonSerializable, IJsonModel + public partial class Channel : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotChannelProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(Channel)} does not support writing '{format}' format."); } writer.WritePropertyName("channelName"u8); @@ -41,7 +41,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (ETag != null) { writer.WritePropertyName("etag"u8); - writer.WriteStringValue(ETag.Value.ToString()); + writer.WriteStringValue(ETag); } else { @@ -56,7 +56,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); + writer.WriteStringValue(Location); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -75,19 +75,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BotChannelProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + Channel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotChannelProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(Channel)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotChannelProperties(document.RootElement, options); + return DeserializeChannel(document.RootElement, options); } - internal static BotChannelProperties DeserializeBotChannelProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static Channel DeserializeChannel(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -123,35 +123,35 @@ internal static BotChannelProperties DeserializeBotChannelProperties(JsonElement return UnknownChannel.DeserializeUnknownChannel(element, options); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotChannelProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(Channel)} does not support writing '{options.Format}' format."); } } - BotChannelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + Channel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotChannelProperties(document.RootElement, options); + return DeserializeChannel(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotChannelProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(Channel)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Channel.cs similarity index 80% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelProperties.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Channel.cs index e80bfc007220..fb83cefb8091 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Channel.cs @@ -7,16 +7,15 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// /// Channel definition - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , , , , , , , , , , , , , , , and . /// - public abstract partial class BotChannelProperties + public abstract partial class Channel { /// /// Keeps track of any properties unknown to the library. @@ -50,18 +49,18 @@ public abstract partial class BotChannelProperties /// private protected IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - protected BotChannelProperties() + /// Initializes a new instance of . + protected Channel() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The channel name. /// Entity Tag of the resource. /// Provisioning state of the resource. /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. - internal BotChannelProperties(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData) + internal Channel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData) { ChannelName = channelName; ETag = etag; @@ -73,10 +72,10 @@ internal BotChannelProperties(string channelName, ETag? etag, string provisionin /// The channel name. internal string ChannelName { get; set; } /// Entity Tag of the resource. - public ETag? ETag { get; set; } + public string ETag { get; set; } /// Provisioning state of the resource. public string ProvisioningState { get; } /// Specifies the location of the resource. - public AzureLocation? Location { get; set; } + public string Location { get; set; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelResponseList.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelResponseList.Serialization.cs index ee2e2da3b6c6..243eefa60987 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelResponseList.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelResponseList.Serialization.cs @@ -34,12 +34,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ChannelResponseList)} does not support writing '{format}' format."); } - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + if (options.Format != "W") { writer.WritePropertyName("value"u8); writer.WriteStartArray(); @@ -49,6 +44,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -86,23 +86,14 @@ internal static ChannelResponseList DeserializeChannelResponseList(JsonElement e { return null; } - string nextLink = default; IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -111,13 +102,22 @@ internal static ChannelResponseList DeserializeChannelResponseList(JsonElement e value = array; continue; } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ChannelResponseList(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new ChannelResponseList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelResponseList.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelResponseList.cs index 1792dfe22432..61b19e63363d 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelResponseList.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelResponseList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.BotService.Models { @@ -46,25 +47,31 @@ internal partial class ChannelResponseList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ChannelResponseList() + /// The BotChannel items on this page. + internal ChannelResponseList(IEnumerable value) { - Value = new ChangeTrackingList(); + Value = value.ToList(); } /// Initializes a new instance of . - /// The link used to get the next page of bot service channel resources. - /// Gets the list of bot service channel results and their properties. + /// The BotChannel items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ChannelResponseList(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal ChannelResponseList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { - NextLink = nextLink; Value = value; + NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The link used to get the next page of bot service channel resources. - public string NextLink { get; } - /// Gets the list of bot service channel results and their properties. + /// Initializes a new instance of for deserialization. + internal ChannelResponseList() + { + } + + /// The BotChannel items on this page. public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelSettings.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelSettings.Serialization.cs similarity index 77% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelSettings.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelSettings.Serialization.cs index 2973d75294ed..e03c2010df5c 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelSettings.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelSettings.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class BotChannelSettings : IUtf8JsonSerializable, IJsonModel + public partial class ChannelSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotChannelSettings)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChannelSettings)} does not support writing '{format}' format."); } if (Optional.IsDefined(ExtensionKey1)) @@ -72,7 +72,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(BotIconUri)) { writer.WritePropertyName("botIconUrl"u8); - writer.WriteStringValue(BotIconUri.AbsoluteUri); + writer.WriteStringValue(BotIconUri); } if (Optional.IsDefined(IsEnabled)) { @@ -106,19 +106,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BotChannelSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChannelSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotChannelSettings)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChannelSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotChannelSettings(document.RootElement, options); + return DeserializeChannelSettings(document.RootElement, options); } - internal static BotChannelSettings DeserializeBotChannelSettings(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChannelSettings DeserializeChannelSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -128,11 +128,11 @@ internal static BotChannelSettings DeserializeBotChannelSettings(JsonElement ele } string extensionKey1 = default; string extensionKey2 = default; - IList sites = default; + IReadOnlyList sites = default; string channelId = default; string channelDisplayName = default; string botId = default; - Uri botIconUrl = default; + string botIconUrl = default; bool? isEnabled = default; bool? disableLocalAuth = default; bool? requireTermsAgreement = default; @@ -156,10 +156,10 @@ internal static BotChannelSettings DeserializeBotChannelSettings(JsonElement ele { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(BotChannelSite.DeserializeBotChannelSite(item, options)); + array.Add(Site.DeserializeSite(item, options)); } sites = array; continue; @@ -181,11 +181,7 @@ internal static BotChannelSettings DeserializeBotChannelSettings(JsonElement ele } if (property.NameEquals("botIconUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - botIconUrl = new Uri(property.Value.GetString()); + botIconUrl = property.Value.GetString(); continue; } if (property.NameEquals("isEnabled"u8)) @@ -221,10 +217,10 @@ internal static BotChannelSettings DeserializeBotChannelSettings(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new BotChannelSettings( + return new ChannelSettings( extensionKey1, extensionKey2, - sites ?? new ChangeTrackingList(), + sites ?? new ChangeTrackingList(), channelId, channelDisplayName, botId, @@ -235,35 +231,35 @@ internal static BotChannelSettings DeserializeBotChannelSettings(JsonElement ele serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotChannelSettings)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChannelSettings)} does not support writing '{options.Format}' format."); } } - BotChannelSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChannelSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotChannelSettings(document.RootElement, options); + return DeserializeChannelSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotChannelSettings)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChannelSettings)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelSettings.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelSettings.cs similarity index 76% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelSettings.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelSettings.cs index 12949fbcfd9e..08b6125b2e5e 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelSettings.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ChannelSettings.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// Channel settings definition. - public partial class BotChannelSettings + public partial class ChannelSettings { /// /// Keeps track of any properties unknown to the library. @@ -45,13 +45,13 @@ public partial class BotChannelSettings /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public BotChannelSettings() + /// Initializes a new instance of . + internal ChannelSettings() { - Sites = new ChangeTrackingList(); + Sites = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The extensionKey1. /// The extensionKey2. /// The list of sites. @@ -63,7 +63,7 @@ public BotChannelSettings() /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. /// Whether customer needs to agree to new terms. /// Keeps track of any properties unknown to the library. - internal BotChannelSettings(string extensionKey1, string extensionKey2, IList sites, string channelId, string channelDisplayName, string botId, Uri botIconUri, bool? isEnabled, bool? disableLocalAuth, bool? requireTermsAgreement, IDictionary serializedAdditionalRawData) + internal ChannelSettings(string extensionKey1, string extensionKey2, IReadOnlyList sites, string channelId, string channelDisplayName, string botId, string botIconUri, bool? isEnabled, bool? disableLocalAuth, bool? requireTermsAgreement, IDictionary serializedAdditionalRawData) { ExtensionKey1 = extensionKey1; ExtensionKey2 = extensionKey2; @@ -79,24 +79,24 @@ internal BotChannelSettings(string extensionKey1, string extensionKey2, IList The extensionKey1. - public string ExtensionKey1 { get; set; } + public string ExtensionKey1 { get; } /// The extensionKey2. - public string ExtensionKey2 { get; set; } + public string ExtensionKey2 { get; } /// The list of sites. - public IList Sites { get; } + public IReadOnlyList Sites { get; } /// The channel id. - public string ChannelId { get; set; } + public string ChannelId { get; } /// The channel display name. - public string ChannelDisplayName { get; set; } + public string ChannelDisplayName { get; } /// The bot id. - public string BotId { get; set; } + public string BotId { get; } /// The bot icon url. - public Uri BotIconUri { get; set; } + public string BotIconUri { get; } /// Whether this channel is enabled for the bot. - public bool? IsEnabled { get; set; } + public bool? IsEnabled { get; } /// Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. - public bool? DisableLocalAuth { get; set; } + public bool? DisableLocalAuth { get; } /// Whether customer needs to agree to new terms. - public bool? RequireTermsAgreement { get; set; } + public bool? RequireTermsAgreement { get; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CheckNameAvailabilityRequestBody.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CheckNameAvailabilityRequestBody.Serialization.cs new file mode 100644 index 000000000000..e07ed1063b36 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CheckNameAvailabilityRequestBody.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + public partial class CheckNameAvailabilityRequestBody : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CheckNameAvailabilityRequestBody)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CheckNameAvailabilityRequestBody IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CheckNameAvailabilityRequestBody)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCheckNameAvailabilityRequestBody(document.RootElement, options); + } + + internal static CheckNameAvailabilityRequestBody DeserializeCheckNameAvailabilityRequestBody(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CheckNameAvailabilityRequestBody(name, type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(CheckNameAvailabilityRequestBody)} does not support writing '{options.Format}' format."); + } + } + + CheckNameAvailabilityRequestBody IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCheckNameAvailabilityRequestBody(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CheckNameAvailabilityRequestBody)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceNameAvailabilityContent.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CheckNameAvailabilityRequestBody.cs similarity index 76% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceNameAvailabilityContent.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CheckNameAvailabilityRequestBody.cs index c46ec28d6ea0..6d418ff02285 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceNameAvailabilityContent.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CheckNameAvailabilityRequestBody.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// The request body for a request to Bot Service Management to check availability of a bot name. - public partial class BotServiceNameAvailabilityContent + public partial class CheckNameAvailabilityRequestBody { /// /// Keeps track of any properties unknown to the library. @@ -46,25 +45,25 @@ public partial class BotServiceNameAvailabilityContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public BotServiceNameAvailabilityContent() + /// Initializes a new instance of . + public CheckNameAvailabilityRequestBody() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// the name of the bot for which availability needs to be checked. - /// the type of the bot for which availability needs to be checked. + /// the type of the bot for which availability needs to be checked. /// Keeps track of any properties unknown to the library. - internal BotServiceNameAvailabilityContent(string name, ResourceType? resourceType, IDictionary serializedAdditionalRawData) + internal CheckNameAvailabilityRequestBody(string name, string type, IDictionary serializedAdditionalRawData) { Name = name; - ResourceType = resourceType; + Type = type; _serializedAdditionalRawData = serializedAdditionalRawData; } /// the name of the bot for which availability needs to be checked. public string Name { get; set; } /// the type of the bot for which availability needs to be checked. - public ResourceType? ResourceType { get; set; } + public string Type { get; set; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceNameAvailabilityResult.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CheckNameAvailabilityResponseBody.Serialization.cs similarity index 65% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceNameAvailabilityResult.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CheckNameAvailabilityResponseBody.Serialization.cs index 283528cdaa05..822ab852fa8a 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceNameAvailabilityResult.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CheckNameAvailabilityResponseBody.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class BotServiceNameAvailabilityResult : IUtf8JsonSerializable, IJsonModel + public partial class CheckNameAvailabilityResponseBody : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,16 +28,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, M /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotServiceNameAvailabilityResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(CheckNameAvailabilityResponseBody)} does not support writing '{format}' format."); } - if (Optional.IsDefined(IsValid)) + if (Optional.IsDefined(Valid)) { writer.WritePropertyName("valid"u8); - writer.WriteBooleanValue(IsValid.Value); + writer.WriteBooleanValue(Valid.Value); } if (Optional.IsDefined(Message)) { @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BotServiceNameAvailabilityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + CheckNameAvailabilityResponseBody IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotServiceNameAvailabilityResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(CheckNameAvailabilityResponseBody)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotServiceNameAvailabilityResult(document.RootElement, options); + return DeserializeCheckNameAvailabilityResponseBody(document.RootElement, options); } - internal static BotServiceNameAvailabilityResult DeserializeBotServiceNameAvailabilityResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static CheckNameAvailabilityResponseBody DeserializeCheckNameAvailabilityResponseBody(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -118,38 +118,38 @@ internal static BotServiceNameAvailabilityResult DeserializeBotServiceNameAvaila } } serializedAdditionalRawData = rawDataDictionary; - return new BotServiceNameAvailabilityResult(valid, message, absCode, serializedAdditionalRawData); + return new CheckNameAvailabilityResponseBody(valid, message, absCode, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotServiceNameAvailabilityResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(CheckNameAvailabilityResponseBody)} does not support writing '{options.Format}' format."); } } - BotServiceNameAvailabilityResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + CheckNameAvailabilityResponseBody IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotServiceNameAvailabilityResult(document.RootElement, options); + return DeserializeCheckNameAvailabilityResponseBody(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotServiceNameAvailabilityResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(CheckNameAvailabilityResponseBody)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceNameAvailabilityResult.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CheckNameAvailabilityResponseBody.cs similarity index 80% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceNameAvailabilityResult.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CheckNameAvailabilityResponseBody.cs index 42d4eea4eb1c..1bb8a7c3275d 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceNameAvailabilityResult.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CheckNameAvailabilityResponseBody.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// The response body returned for a request to Bot Service Management to check availability of a bot name. - public partial class BotServiceNameAvailabilityResult + public partial class CheckNameAvailabilityResponseBody { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +45,26 @@ public partial class BotServiceNameAvailabilityResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal BotServiceNameAvailabilityResult() + /// Initializes a new instance of . + internal CheckNameAvailabilityResponseBody() { } - /// Initializes a new instance of . - /// indicates if the bot name is valid. + /// Initializes a new instance of . + /// indicates if the bot name is valid. /// additional message from the bot management api showing why a bot name is not available. /// response code from ABS. /// Keeps track of any properties unknown to the library. - internal BotServiceNameAvailabilityResult(bool? isValid, string message, string absCode, IDictionary serializedAdditionalRawData) + internal CheckNameAvailabilityResponseBody(bool? valid, string message, string absCode, IDictionary serializedAdditionalRawData) { - IsValid = isValid; + Valid = valid; Message = message; AbsCode = absCode; _serializedAdditionalRawData = serializedAdditionalRawData; } /// indicates if the bot name is valid. - public bool? IsValid { get; } + public bool? Valid { get; } /// additional message from the bot management api showing why a bot name is not available. public string Message { get; } /// response code from ABS. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingParameter.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingParameter.Serialization.cs similarity index 67% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingParameter.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingParameter.Serialization.cs index 3ea7cf5e0c34..2fd40c8b30d4 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingParameter.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingParameter.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class BotConnectionSettingParameter : IUtf8JsonSerializable, IJsonModel + public partial class ConnectionSettingParameter : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotConnectionSettingParameter)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ConnectionSettingParameter)} does not support writing '{format}' format."); } if (Optional.IsDefined(Key)) @@ -68,19 +68,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BotConnectionSettingParameter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ConnectionSettingParameter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotConnectionSettingParameter)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ConnectionSettingParameter)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotConnectionSettingParameter(document.RootElement, options); + return DeserializeConnectionSettingParameter(document.RootElement, options); } - internal static BotConnectionSettingParameter DeserializeBotConnectionSettingParameter(JsonElement element, ModelReaderWriterOptions options = null) + internal static ConnectionSettingParameter DeserializeConnectionSettingParameter(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -115,38 +115,38 @@ internal static BotConnectionSettingParameter DeserializeBotConnectionSettingPar } } serializedAdditionalRawData = rawDataDictionary; - return new BotConnectionSettingParameter(key, value, serializedAdditionalRawData); + return new ConnectionSettingParameter(key, value, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotConnectionSettingParameter)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectionSettingParameter)} does not support writing '{options.Format}' format."); } } - BotConnectionSettingParameter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ConnectionSettingParameter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotConnectionSettingParameter(document.RootElement, options); + return DeserializeConnectionSettingParameter(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotConnectionSettingParameter)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectionSettingParameter)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingParameter.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingParameter.cs similarity index 84% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingParameter.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingParameter.cs index 4eaddac23c60..13089e8fa657 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingParameter.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingParameter.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// Extra Parameter in a Connection Setting Properties to indicate service provider specific properties. - public partial class BotConnectionSettingParameter + public partial class ConnectionSettingParameter { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ public partial class BotConnectionSettingParameter /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public BotConnectionSettingParameter() + /// Initializes a new instance of . + public ConnectionSettingParameter() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Key for the Connection Setting Parameter. /// Value associated with the Connection Setting Parameter. /// Keeps track of any properties unknown to the library. - internal BotConnectionSettingParameter(string key, string value, IDictionary serializedAdditionalRawData) + internal ConnectionSettingParameter(string key, string value, IDictionary serializedAdditionalRawData) { Key = key; Value = value; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingProperties.Serialization.cs similarity index 69% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingProperties.Serialization.cs index 5e266153cc15..297c8bb99630 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class BotConnectionSettingProperties : IUtf8JsonSerializable, IJsonModel + public partial class ConnectionSettingProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,12 +28,22 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotConnectionSettingProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ConnectionSettingProperties)} does not support writing '{format}' format."); } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } if (Optional.IsDefined(ClientId)) { writer.WritePropertyName("clientId"u8); @@ -96,19 +106,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BotConnectionSettingProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ConnectionSettingProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotConnectionSettingProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ConnectionSettingProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotConnectionSettingProperties(document.RootElement, options); + return DeserializeConnectionSettingProperties(document.RootElement, options); } - internal static BotConnectionSettingProperties DeserializeBotConnectionSettingProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static ConnectionSettingProperties DeserializeConnectionSettingProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -116,18 +126,30 @@ internal static BotConnectionSettingProperties DeserializeBotConnectionSettingPr { return null; } + string id = default; + string name = default; string clientId = default; string settingId = default; string clientSecret = default; string scopes = default; string serviceProviderId = default; string serviceProviderDisplayName = default; - IList parameters = default; + IList parameters = default; string provisioningState = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } if (property.NameEquals("clientId"u8)) { clientId = property.Value.GetString(); @@ -164,10 +186,10 @@ internal static BotConnectionSettingProperties DeserializeBotConnectionSettingPr { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(BotConnectionSettingParameter.DeserializeBotConnectionSettingParameter(item, options)); + array.Add(ConnectionSettingParameter.DeserializeConnectionSettingParameter(item, options)); } parameters = array; continue; @@ -183,47 +205,49 @@ internal static BotConnectionSettingProperties DeserializeBotConnectionSettingPr } } serializedAdditionalRawData = rawDataDictionary; - return new BotConnectionSettingProperties( + return new ConnectionSettingProperties( + id, + name, clientId, settingId, clientSecret, scopes, serviceProviderId, serviceProviderDisplayName, - parameters ?? new ChangeTrackingList(), + parameters ?? new ChangeTrackingList(), provisioningState, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotConnectionSettingProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectionSettingProperties)} does not support writing '{options.Format}' format."); } } - BotConnectionSettingProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ConnectionSettingProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotConnectionSettingProperties(document.RootElement, options); + return DeserializeConnectionSettingProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotConnectionSettingProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ConnectionSettingProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingProperties.cs similarity index 77% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingProperties.cs index 7e817b59db86..2d97288aade0 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotConnectionSettingProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// Properties for a Connection Setting Item. - public partial class BotConnectionSettingProperties + public partial class ConnectionSettingProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,13 +45,15 @@ public partial class BotConnectionSettingProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public BotConnectionSettingProperties() + /// Initializes a new instance of . + public ConnectionSettingProperties() { - Parameters = new ChangeTrackingList(); + Parameters = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . + /// Id of the Connection Setting. + /// Name of the Connection Setting. /// Client Id associated with the Connection Setting. /// Setting Id set by the service for the Connection Setting. /// Client Secret associated with the Connection Setting. @@ -61,8 +63,10 @@ public BotConnectionSettingProperties() /// Service Provider Parameters associated with the Connection Setting. /// Provisioning state of the resource. /// Keeps track of any properties unknown to the library. - internal BotConnectionSettingProperties(string clientId, string settingId, string clientSecret, string scopes, string serviceProviderId, string serviceProviderDisplayName, IList parameters, string provisioningState, IDictionary serializedAdditionalRawData) + internal ConnectionSettingProperties(string id, string name, string clientId, string settingId, string clientSecret, string scopes, string serviceProviderId, string serviceProviderDisplayName, IList parameters, string provisioningState, IDictionary serializedAdditionalRawData) { + Id = id; + Name = name; ClientId = clientId; SettingId = settingId; ClientSecret = clientSecret; @@ -74,6 +78,10 @@ internal BotConnectionSettingProperties(string clientId, string settingId, strin _serializedAdditionalRawData = serializedAdditionalRawData; } + /// Id of the Connection Setting. + public string Id { get; set; } + /// Name of the Connection Setting. + public string Name { get; set; } /// Client Id associated with the Connection Setting. public string ClientId { get; set; } /// Setting Id set by the service for the Connection Setting. @@ -87,7 +95,7 @@ internal BotConnectionSettingProperties(string clientId, string settingId, strin /// Service Provider Display Name associated with the Connection Setting. public string ServiceProviderDisplayName { get; set; } /// Service Provider Parameters associated with the Connection Setting. - public IList Parameters { get; } + public IList Parameters { get; } /// Provisioning state of the resource. public string ProvisioningState { get; set; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingResponseList.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingResponseList.Serialization.cs index 0ecf5db1ac8d..1907b0e45b9d 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingResponseList.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingResponseList.Serialization.cs @@ -34,12 +34,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ConnectionSettingResponseList)} does not support writing '{format}' format."); } - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + if (options.Format != "W") { writer.WritePropertyName("value"u8); writer.WriteStartArray(); @@ -49,6 +44,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -86,29 +86,29 @@ internal static ConnectionSettingResponseList DeserializeConnectionSettingRespon { return null; } - string nextLink = default; - IReadOnlyList value = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("nextLink"u8)) + if (property.NameEquals("value"u8)) { - nextLink = property.Value.GetString(); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ConnectionSettingData.DeserializeConnectionSettingData(item, options)); + } + value = array; continue; } - if (property.NameEquals("value"u8)) + if (property.NameEquals("nextLink"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BotConnectionSettingData.DeserializeBotConnectionSettingData(item, options)); - } - value = array; + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +117,7 @@ internal static ConnectionSettingResponseList DeserializeConnectionSettingRespon } } serializedAdditionalRawData = rawDataDictionary; - return new ConnectionSettingResponseList(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new ConnectionSettingResponseList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingResponseList.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingResponseList.cs index 874b7560598e..0ecd658fe774 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingResponseList.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ConnectionSettingResponseList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.BotService.Models { @@ -46,25 +47,31 @@ internal partial class ConnectionSettingResponseList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ConnectionSettingResponseList() + /// The ConnectionSetting items on this page. + internal ConnectionSettingResponseList(IEnumerable value) { - Value = new ChangeTrackingList(); + Value = value.ToList(); } /// Initializes a new instance of . - /// The link used to get the next page of bot service connection setting resources. - /// Gets the list of bot service connection settings and their properties. + /// The ConnectionSetting items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ConnectionSettingResponseList(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal ConnectionSettingResponseList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { - NextLink = nextLink; Value = value; + NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The link used to get the next page of bot service connection setting resources. - public string NextLink { get; } - /// Gets the list of bot service connection settings and their properties. - public IReadOnlyList Value { get; } + /// Initializes a new instance of for deserialization. + internal ConnectionSettingResponseList() + { + } + + /// The ConnectionSetting items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotCreateEmailSignInUriResult.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponse.Serialization.cs similarity index 62% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotCreateEmailSignInUriResult.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponse.Serialization.cs index 0ac31b6b2bb1..44e0a61d4c67 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotCreateEmailSignInUriResult.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponse.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class BotCreateEmailSignInUriResult : IUtf8JsonSerializable, IJsonModel + public partial class CreateEmailSignInUrlResponse : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotCreateEmailSignInUriResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(CreateEmailSignInUrlResponse)} does not support writing '{format}' format."); } if (options.Format != "W" && Optional.IsDefined(Id)) @@ -42,7 +42,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); + writer.WriteStringValue(Location); } if (Optional.IsDefined(Properties)) { @@ -66,19 +66,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BotCreateEmailSignInUriResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + CreateEmailSignInUrlResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotCreateEmailSignInUriResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(CreateEmailSignInUrlResponse)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotCreateEmailSignInUriResult(document.RootElement, options); + return DeserializeCreateEmailSignInUrlResponse(document.RootElement, options); } - internal static BotCreateEmailSignInUriResult DeserializeBotCreateEmailSignInUriResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static CreateEmailSignInUrlResponse DeserializeCreateEmailSignInUrlResponse(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -86,8 +86,8 @@ internal static BotCreateEmailSignInUriResult DeserializeBotCreateEmailSignInUri { return null; } - ResourceIdentifier id = default; - AzureLocation? location = default; + string id = default; + string location = default; CreateEmailSignInUrlResponseProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -95,20 +95,12 @@ internal static BotCreateEmailSignInUriResult DeserializeBotCreateEmailSignInUri { if (property.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - id = new ResourceIdentifier(property.Value.GetString()); + id = property.Value.GetString(); continue; } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (property.NameEquals("properties"u8)) @@ -126,38 +118,38 @@ internal static BotCreateEmailSignInUriResult DeserializeBotCreateEmailSignInUri } } serializedAdditionalRawData = rawDataDictionary; - return new BotCreateEmailSignInUriResult(id, location, properties, serializedAdditionalRawData); + return new CreateEmailSignInUrlResponse(id, location, properties, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotCreateEmailSignInUriResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(CreateEmailSignInUrlResponse)} does not support writing '{options.Format}' format."); } } - BotCreateEmailSignInUriResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + CreateEmailSignInUrlResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotCreateEmailSignInUriResult(document.RootElement, options); + return DeserializeCreateEmailSignInUrlResponse(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotCreateEmailSignInUriResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(CreateEmailSignInUrlResponse)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotCreateEmailSignInUriResult.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponse.cs similarity index 79% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotCreateEmailSignInUriResult.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponse.cs index 057ed147ca02..6aa0f6f1f243 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotCreateEmailSignInUriResult.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponse.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// The ARM create email sign in url operation response. - public partial class BotCreateEmailSignInUriResult + public partial class CreateEmailSignInUrlResponse { /// /// Keeps track of any properties unknown to the library. @@ -46,17 +45,17 @@ public partial class BotCreateEmailSignInUriResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal BotCreateEmailSignInUriResult() + /// Initializes a new instance of . + internal CreateEmailSignInUrlResponse() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Specifies the resource ID. /// Specifies the location of the resource. /// The set of properties specific to sign in url. /// Keeps track of any properties unknown to the library. - internal BotCreateEmailSignInUriResult(ResourceIdentifier id, AzureLocation? location, CreateEmailSignInUrlResponseProperties properties, IDictionary serializedAdditionalRawData) + internal CreateEmailSignInUrlResponse(string id, string location, CreateEmailSignInUrlResponseProperties properties, IDictionary serializedAdditionalRawData) { Id = id; Location = location; @@ -65,13 +64,13 @@ internal BotCreateEmailSignInUriResult(ResourceIdentifier id, AzureLocation? loc } /// Specifies the resource ID. - public ResourceIdentifier Id { get; } + public string Id { get; } /// Specifies the location of the resource. - public AzureLocation? Location { get; } + public string Location { get; } /// The set of properties specific to sign in url. internal CreateEmailSignInUrlResponseProperties Properties { get; } /// Sign in url. - public Uri CreateEmailSignInUrlResponseUri + public string CreateEmailSignInUrlResponseUri { get => Properties?.Uri; } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponseProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponseProperties.Serialization.cs index 47f220cabcfc..6cbf29a114fc 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponseProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponseProperties.Serialization.cs @@ -37,7 +37,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(Uri)) { writer.WritePropertyName("url"u8); - writer.WriteStringValue(Uri.AbsoluteUri); + writer.WriteStringValue(Uri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -76,18 +76,14 @@ internal static CreateEmailSignInUrlResponseProperties DeserializeCreateEmailSig { return null; } - Uri url = default; + string url = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("url"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - url = new Uri(property.Value.GetString()); + url = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponseProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponseProperties.cs index f22e4e4156a4..fcc5b6c9e298 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponseProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/CreateEmailSignInUrlResponseProperties.cs @@ -53,13 +53,13 @@ internal CreateEmailSignInUrlResponseProperties() /// Initializes a new instance of . /// Sign in url. /// Keeps track of any properties unknown to the library. - internal CreateEmailSignInUrlResponseProperties(Uri uri, IDictionary serializedAdditionalRawData) + internal CreateEmailSignInUrlResponseProperties(string uri, IDictionary serializedAdditionalRawData) { Uri = uri; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Sign in url. - public Uri Uri { get; } + public string Uri { get; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineChannel.Serialization.cs index e4c2e54a1412..a9428339f1ab 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static DirectLineChannel DeserializeDirectLineChannel(JsonElement eleme } DirectLineChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static DirectLineChannel DeserializeDirectLineChannel(JsonElement eleme etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static DirectLineChannel DeserializeDirectLineChannel(JsonElement eleme } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineChannel.cs index 9b50ca57e4f6..68c33040e908 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Direct Line channel definition. - public partial class DirectLineChannel : BotChannelProperties + public partial class DirectLineChannel : Channel { /// Initializes a new instance of . public DirectLineChannel() @@ -27,7 +26,7 @@ public DirectLineChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to Direct Line channel resource. - internal DirectLineChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, DirectLineChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal DirectLineChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, DirectLineChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "DirectLineChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSite.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSite.Serialization.cs index ddd9f4416364..6997785f50e9 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSite.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSite.Serialization.cs @@ -57,7 +57,7 @@ internal static DirectLineSite DeserializeDirectLineSite(JsonElement element, Mo { return null; } - Guid? tenantId = default; + string tenantId = default; string siteId = default; string siteName = default; string key = default; @@ -68,7 +68,7 @@ internal static DirectLineSite DeserializeDirectLineSite(JsonElement element, Mo bool? isDetailedLoggingEnabled = default; bool? isBlockUserUploadEnabled = default; bool? isNoStorageEnabled = default; - ETag? etag = default; + string etag = default; string appId = default; bool? isV1Enabled = default; bool? isV3Enabled = default; @@ -82,11 +82,7 @@ internal static DirectLineSite DeserializeDirectLineSite(JsonElement element, Mo { if (property.NameEquals("tenantId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - tenantId = property.Value.GetGuid(); + tenantId = property.Value.GetString(); continue; } if (property.NameEquals("siteId"u8)) @@ -162,11 +158,7 @@ internal static DirectLineSite DeserializeDirectLineSite(JsonElement element, Mo } if (property.NameEquals("eTag"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("appId"u8)) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSite.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSite.cs index 2fe4e89e4492..e5ed5a9dcb54 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSite.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSite.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// A site for the Direct Line channel. - public partial class DirectLineSite : BotChannelSite + public partial class DirectLineSite : Site { /// Initializes a new instance of . /// Site name. @@ -43,7 +43,7 @@ public DirectLineSite(string siteName, bool isEnabled) : base(siteName, isEnable /// Whether this site is enabled for Webchat Speech. /// Whether this site is enabled for preview versions of Webchat. /// Keeps track of any properties unknown to the library. - internal DirectLineSite(Guid? tenantId, string siteId, string siteName, string key, string key2, bool isEnabled, bool? isTokenEnabled, bool? isEndpointParametersEnabled, bool? isDetailedLoggingEnabled, bool? isBlockUserUploadEnabled, bool? isNoStorageEnabled, ETag? etag, string appId, bool? isV1Enabled, bool? isV3Enabled, bool? isSecureSiteEnabled, IList trustedOrigins, bool? isWebChatSpeechEnabled, bool? isWebchatPreviewEnabled, IDictionary serializedAdditionalRawData) : base(tenantId, siteId, siteName, key, key2, isEnabled, isTokenEnabled, isEndpointParametersEnabled, isDetailedLoggingEnabled, isBlockUserUploadEnabled, isNoStorageEnabled, etag, appId, isV1Enabled, isV3Enabled, isSecureSiteEnabled, trustedOrigins, isWebChatSpeechEnabled, isWebchatPreviewEnabled, serializedAdditionalRawData) + internal DirectLineSite(string tenantId, string siteId, string siteName, string key, string key2, bool isEnabled, bool? isTokenEnabled, bool? isEndpointParametersEnabled, bool? isDetailedLoggingEnabled, bool? isBlockUserUploadEnabled, bool? isNoStorageEnabled, string etag, string appId, bool? isV1Enabled, bool? isV3Enabled, bool? isSecureSiteEnabled, IList trustedOrigins, bool? isWebChatSpeechEnabled, bool? isWebchatPreviewEnabled, IDictionary serializedAdditionalRawData) : base(tenantId, siteId, siteName, key, key2, isEnabled, isTokenEnabled, isEndpointParametersEnabled, isDetailedLoggingEnabled, isBlockUserUploadEnabled, isNoStorageEnabled, etag, appId, isV1Enabled, isV3Enabled, isSecureSiteEnabled, trustedOrigins, isWebChatSpeechEnabled, isWebchatPreviewEnabled, serializedAdditionalRawData) { } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannel.Serialization.cs index b8e755e2e003..8921bb0ad6a5 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static DirectLineSpeechChannel DeserializeDirectLineSpeechChannel(JsonE } DirectLineSpeechChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static DirectLineSpeechChannel DeserializeDirectLineSpeechChannel(JsonE etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static DirectLineSpeechChannel DeserializeDirectLineSpeechChannel(JsonE } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannel.cs index a1c3e738e368..9a5839638993 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// DirectLine Speech channel definition. - public partial class DirectLineSpeechChannel : BotChannelProperties + public partial class DirectLineSpeechChannel : Channel { /// Initializes a new instance of . public DirectLineSpeechChannel() @@ -27,7 +26,7 @@ public DirectLineSpeechChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to DirectLine Speech channel resource. - internal DirectLineSpeechChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, DirectLineSpeechChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal DirectLineSpeechChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, DirectLineSpeechChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "DirectLineSpeechChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannelProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannelProperties.Serialization.cs index 7104844c43c2..a121bd1f834b 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannelProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannelProperties.Serialization.cs @@ -120,7 +120,7 @@ internal static DirectLineSpeechChannelProperties DeserializeDirectLineSpeechCha { return null; } - ResourceIdentifier cognitiveServiceResourceId = default; + string cognitiveServiceResourceId = default; string cognitiveServiceRegion = default; string cognitiveServiceSubscriptionKey = default; bool? isEnabled = default; @@ -133,11 +133,7 @@ internal static DirectLineSpeechChannelProperties DeserializeDirectLineSpeechCha { if (property.NameEquals("cognitiveServiceResourceId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - cognitiveServiceResourceId = new ResourceIdentifier(property.Value.GetString()); + cognitiveServiceResourceId = property.Value.GetString(); continue; } if (property.NameEquals("cognitiveServiceRegion"u8)) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannelProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannelProperties.cs index 49d3206af6f2..a66f6249bc50 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannelProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/DirectLineSpeechChannelProperties.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { @@ -60,7 +59,7 @@ public DirectLineSpeechChannelProperties() /// Custom voice deployment id (optional). /// Make this a default bot for chosen cognitive service account. /// Keeps track of any properties unknown to the library. - internal DirectLineSpeechChannelProperties(ResourceIdentifier cognitiveServiceResourceId, string cognitiveServiceRegion, string cognitiveServiceSubscriptionKey, bool? isEnabled, string customVoiceDeploymentId, string customSpeechModelId, bool? isDefaultBotForCogSvcAccount, IDictionary serializedAdditionalRawData) + internal DirectLineSpeechChannelProperties(string cognitiveServiceResourceId, string cognitiveServiceRegion, string cognitiveServiceSubscriptionKey, bool? isEnabled, string customVoiceDeploymentId, string customSpeechModelId, bool? isDefaultBotForCogSvcAccount, IDictionary serializedAdditionalRawData) { CognitiveServiceResourceId = cognitiveServiceResourceId; CognitiveServiceRegion = cognitiveServiceRegion; @@ -73,7 +72,7 @@ internal DirectLineSpeechChannelProperties(ResourceIdentifier cognitiveServiceRe } /// The cognitive service id with this channel registration. - public ResourceIdentifier CognitiveServiceResourceId { get; set; } + public string CognitiveServiceResourceId { get; set; } /// The cognitive service region with this channel registration. public string CognitiveServiceRegion { get; set; } /// The cognitive service subscription key to use with this channel registration. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/EmailChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/EmailChannel.Serialization.cs index 9e1f07524aa5..60d6244f8ae3 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/EmailChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/EmailChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static EmailChannel DeserializeEmailChannel(JsonElement element, ModelR } EmailChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static EmailChannel DeserializeEmailChannel(JsonElement element, ModelR etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static EmailChannel DeserializeEmailChannel(JsonElement element, ModelR } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/EmailChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/EmailChannel.cs index f619cac75679..a1442f72fd86 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/EmailChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/EmailChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Email channel definition. - public partial class EmailChannel : BotChannelProperties + public partial class EmailChannel : Channel { /// Initializes a new instance of . public EmailChannel() @@ -27,7 +26,7 @@ public EmailChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to email channel resource. - internal EmailChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, EmailChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal EmailChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, EmailChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "EmailChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannel.Serialization.cs index b43d97c7ebcb..62b6fc348b4b 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static FacebookChannel DeserializeFacebookChannel(JsonElement element, } FacebookChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static FacebookChannel DeserializeFacebookChannel(JsonElement element, etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static FacebookChannel DeserializeFacebookChannel(JsonElement element, } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannel.cs index 655fb281ff7c..a62766a26dba 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Facebook channel definition. - public partial class FacebookChannel : BotChannelProperties + public partial class FacebookChannel : Channel { /// Initializes a new instance of . public FacebookChannel() @@ -27,7 +26,7 @@ public FacebookChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to bot facebook channel. - internal FacebookChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, FacebookChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal FacebookChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, FacebookChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "FacebookChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannelProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannelProperties.Serialization.cs index 17fc83847725..dbec6c506921 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannelProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannelProperties.Serialization.cs @@ -59,7 +59,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (options.Format != "W" && Optional.IsDefined(CallbackUri)) { writer.WritePropertyName("callbackUrl"u8); - writer.WriteStringValue(CallbackUri.AbsoluteUri); + writer.WriteStringValue(CallbackUri); } writer.WritePropertyName("isEnabled"u8); writer.WriteBooleanValue(IsEnabled); @@ -104,7 +104,7 @@ internal static FacebookChannelProperties DeserializeFacebookChannelProperties(J IList pages = default; string appId = default; string appSecret = default; - Uri callbackUrl = default; + string callbackUrl = default; bool isEnabled = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -141,11 +141,7 @@ internal static FacebookChannelProperties DeserializeFacebookChannelProperties(J } if (property.NameEquals("callbackUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - callbackUrl = new Uri(property.Value.GetString()); + callbackUrl = property.Value.GetString(); continue; } if (property.NameEquals("isEnabled"u8)) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannelProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannelProperties.cs index b45ac5fce711..548d7cb7cfe3 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannelProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/FacebookChannelProperties.cs @@ -66,7 +66,7 @@ public FacebookChannelProperties(string appId, bool isEnabled) /// Callback Url. /// Whether this channel is enabled for the bot. /// Keeps track of any properties unknown to the library. - internal FacebookChannelProperties(string verifyToken, IList pages, string appId, string appSecret, Uri callbackUri, bool isEnabled, IDictionary serializedAdditionalRawData) + internal FacebookChannelProperties(string verifyToken, IList pages, string appId, string appSecret, string callbackUri, bool isEnabled, IDictionary serializedAdditionalRawData) { VerifyToken = verifyToken; Pages = pages; @@ -91,7 +91,7 @@ internal FacebookChannelProperties() /// Facebook application secret. Value only returned through POST to the action Channel List API, otherwise empty. public string AppSecret { get; set; } /// Callback Url. - public Uri CallbackUri { get; } + public string CallbackUri { get; } /// Whether this channel is enabled for the bot. public bool IsEnabled { get; set; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceHostSettingsResult.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/HostSettingsResponse.Serialization.cs similarity index 68% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceHostSettingsResult.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/HostSettingsResponse.Serialization.cs index a8564d4f22ef..69fe6a5c6cff 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceHostSettingsResult.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/HostSettingsResponse.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class BotServiceHostSettingsResult : IUtf8JsonSerializable, IJsonModel + public partial class HostSettingsResponse : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,21 +28,21 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotServiceHostSettingsResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(HostSettingsResponse)} does not support writing '{format}' format."); } if (Optional.IsDefined(OAuthUri)) { writer.WritePropertyName("OAuthUrl"u8); - writer.WriteStringValue(OAuthUri.AbsoluteUri); + writer.WriteStringValue(OAuthUri); } if (Optional.IsDefined(ToBotFromChannelOpenIdMetadataUri)) { writer.WritePropertyName("ToBotFromChannelOpenIdMetadataUrl"u8); - writer.WriteStringValue(ToBotFromChannelOpenIdMetadataUri.AbsoluteUri); + writer.WriteStringValue(ToBotFromChannelOpenIdMetadataUri); } if (Optional.IsDefined(ToBotFromChannelTokenIssuer)) { @@ -52,12 +52,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(ToBotFromEmulatorOpenIdMetadataUri)) { writer.WritePropertyName("ToBotFromEmulatorOpenIdMetadataUrl"u8); - writer.WriteStringValue(ToBotFromEmulatorOpenIdMetadataUri.AbsoluteUri); + writer.WriteStringValue(ToBotFromEmulatorOpenIdMetadataUri); } if (Optional.IsDefined(ToChannelFromBotLoginUri)) { writer.WritePropertyName("ToChannelFromBotLoginUrl"u8); - writer.WriteStringValue(ToChannelFromBotLoginUri.AbsoluteUri); + writer.WriteStringValue(ToChannelFromBotLoginUri); } if (Optional.IsDefined(ToChannelFromBotOAuthScope)) { @@ -91,19 +91,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BotServiceHostSettingsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + HostSettingsResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotServiceHostSettingsResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(HostSettingsResponse)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotServiceHostSettingsResult(document.RootElement, options); + return DeserializeHostSettingsResponse(document.RootElement, options); } - internal static BotServiceHostSettingsResult DeserializeBotServiceHostSettingsResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static HostSettingsResponse DeserializeHostSettingsResponse(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -111,11 +111,11 @@ internal static BotServiceHostSettingsResult DeserializeBotServiceHostSettingsRe { return null; } - Uri oAuthUrl = default; - Uri toBotFromChannelOpenIdMetadataUrl = default; + string oAuthUrl = default; + string toBotFromChannelOpenIdMetadataUrl = default; string toBotFromChannelTokenIssuer = default; - Uri toBotFromEmulatorOpenIdMetadataUrl = default; - Uri toChannelFromBotLoginUrl = default; + string toBotFromEmulatorOpenIdMetadataUrl = default; + string toChannelFromBotLoginUrl = default; string toChannelFromBotOAuthScope = default; bool? validateAuthority = default; string botOpenIdMetadata = default; @@ -125,20 +125,12 @@ internal static BotServiceHostSettingsResult DeserializeBotServiceHostSettingsRe { if (property.NameEquals("OAuthUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - oAuthUrl = new Uri(property.Value.GetString()); + oAuthUrl = property.Value.GetString(); continue; } if (property.NameEquals("ToBotFromChannelOpenIdMetadataUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - toBotFromChannelOpenIdMetadataUrl = new Uri(property.Value.GetString()); + toBotFromChannelOpenIdMetadataUrl = property.Value.GetString(); continue; } if (property.NameEquals("ToBotFromChannelTokenIssuer"u8)) @@ -148,20 +140,12 @@ internal static BotServiceHostSettingsResult DeserializeBotServiceHostSettingsRe } if (property.NameEquals("ToBotFromEmulatorOpenIdMetadataUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - toBotFromEmulatorOpenIdMetadataUrl = new Uri(property.Value.GetString()); + toBotFromEmulatorOpenIdMetadataUrl = property.Value.GetString(); continue; } if (property.NameEquals("ToChannelFromBotLoginUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - toChannelFromBotLoginUrl = new Uri(property.Value.GetString()); + toChannelFromBotLoginUrl = property.Value.GetString(); continue; } if (property.NameEquals("ToChannelFromBotOAuthScope"u8)) @@ -189,7 +173,7 @@ internal static BotServiceHostSettingsResult DeserializeBotServiceHostSettingsRe } } serializedAdditionalRawData = rawDataDictionary; - return new BotServiceHostSettingsResult( + return new HostSettingsResponse( oAuthUrl, toBotFromChannelOpenIdMetadataUrl, toBotFromChannelTokenIssuer, @@ -201,35 +185,35 @@ internal static BotServiceHostSettingsResult DeserializeBotServiceHostSettingsRe serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotServiceHostSettingsResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(HostSettingsResponse)} does not support writing '{options.Format}' format."); } } - BotServiceHostSettingsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + HostSettingsResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotServiceHostSettingsResult(document.RootElement, options); + return DeserializeHostSettingsResponse(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotServiceHostSettingsResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(HostSettingsResponse)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceHostSettingsResult.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/HostSettingsResponse.cs similarity index 82% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceHostSettingsResult.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/HostSettingsResponse.cs index 9c1ed6c88d3b..1cb0b48067c9 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceHostSettingsResult.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/HostSettingsResponse.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// The response body returned for a request to Bot Service Management to check per subscription hostSettings. - public partial class BotServiceHostSettingsResult + public partial class HostSettingsResponse { /// /// Keeps track of any properties unknown to the library. @@ -45,12 +45,12 @@ public partial class BotServiceHostSettingsResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal BotServiceHostSettingsResult() + /// Initializes a new instance of . + internal HostSettingsResponse() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// For in-conversation bot user authentication. /// For verifying incoming tokens from the channels. /// For verifying incoming tokens from the channels. @@ -60,7 +60,7 @@ internal BotServiceHostSettingsResult() /// Per cloud OAuth setting on whether authority is validated. /// Same as toBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12. /// Keeps track of any properties unknown to the library. - internal BotServiceHostSettingsResult(Uri oAuthUri, Uri toBotFromChannelOpenIdMetadataUri, string toBotFromChannelTokenIssuer, Uri toBotFromEmulatorOpenIdMetadataUri, Uri toChannelFromBotLoginUri, string toChannelFromBotOAuthScope, bool? validateAuthority, string botOpenIdMetadata, IDictionary serializedAdditionalRawData) + internal HostSettingsResponse(string oAuthUri, string toBotFromChannelOpenIdMetadataUri, string toBotFromChannelTokenIssuer, string toBotFromEmulatorOpenIdMetadataUri, string toChannelFromBotLoginUri, string toChannelFromBotOAuthScope, bool? validateAuthority, string botOpenIdMetadata, IDictionary serializedAdditionalRawData) { OAuthUri = oAuthUri; ToBotFromChannelOpenIdMetadataUri = toBotFromChannelOpenIdMetadataUri; @@ -74,15 +74,15 @@ internal BotServiceHostSettingsResult(Uri oAuthUri, Uri toBotFromChannelOpenIdMe } /// For in-conversation bot user authentication. - public Uri OAuthUri { get; } + public string OAuthUri { get; } /// For verifying incoming tokens from the channels. - public Uri ToBotFromChannelOpenIdMetadataUri { get; } + public string ToBotFromChannelOpenIdMetadataUri { get; } /// For verifying incoming tokens from the channels. public string ToBotFromChannelTokenIssuer { get; } /// For verifying incoming tokens from bot emulator. - public Uri ToBotFromEmulatorOpenIdMetadataUri { get; } + public string ToBotFromEmulatorOpenIdMetadataUri { get; } /// For getting access token to channels from bot host. - public Uri ToChannelFromBotLoginUri { get; } + public string ToChannelFromBotLoginUri { get; } /// For getting access token to channels from bot host. public string ToChannelFromBotOAuthScope { get; } /// Per cloud OAuth setting on whether authority is validated. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceKey.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Key.Serialization.cs similarity index 53% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceKey.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Key.Serialization.cs index f72d69d5b034..aacfafe53149 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceKey.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Key.Serialization.cs @@ -9,20 +9,20 @@ namespace Azure.ResourceManager.BotService.Models { - internal static partial class BotServiceKeyExtensions + internal static partial class KeyExtensions { - public static string ToSerialString(this BotServiceKey value) => value switch + public static string ToSerialString(this Key value) => value switch { - BotServiceKey.Key1 => "key1", - BotServiceKey.Key2 => "key2", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BotServiceKey value.") + Key.Key1 => "key1", + Key.Key2 => "key2", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Key value.") }; - public static BotServiceKey ToBotServiceKey(this string value) + public static Key ToKey(this string value) { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "key1")) return BotServiceKey.Key1; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "key2")) return BotServiceKey.Key2; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown BotServiceKey value."); + if (StringComparer.OrdinalIgnoreCase.Equals(value, "key1")) return Key.Key1; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "key2")) return Key.Key2; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown Key value."); } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceKey.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Key.cs similarity index 92% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceKey.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Key.cs index 0487dc1172a9..0da98f38143f 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceKey.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Key.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.BotService.Models { /// Determines which key is to be regenerated. - public enum BotServiceKey + public enum Key { /// key1. Key1, diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/KikChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/KikChannel.Serialization.cs index eee09de16301..6bbc07c5e8b4 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/KikChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/KikChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static KikChannel DeserializeKikChannel(JsonElement element, ModelReade } KikChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static KikChannel DeserializeKikChannel(JsonElement element, ModelReade etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static KikChannel DeserializeKikChannel(JsonElement element, ModelReade } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/KikChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/KikChannel.cs index 76df5d102058..c484560c9162 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/KikChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/KikChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Kik channel definition. - public partial class KikChannel : BotChannelProperties + public partial class KikChannel : Channel { /// Initializes a new instance of . public KikChannel() @@ -27,7 +26,7 @@ public KikChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to Kik channel resource. - internal KikChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, KikChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal KikChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, KikChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "KikChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannel.Serialization.cs index b02abe0df806..b847f5cf314a 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static LineChannel DeserializeLineChannel(JsonElement element, ModelRea } LineChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static LineChannel DeserializeLineChannel(JsonElement element, ModelRea etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static LineChannel DeserializeLineChannel(JsonElement element, ModelRea } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannel.cs index 5e765860cd97..4e85b8823e1d 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Line channel definition. - public partial class LineChannel : BotChannelProperties + public partial class LineChannel : Channel { /// Initializes a new instance of . public LineChannel() @@ -27,7 +26,7 @@ public LineChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to line channel resource. - internal LineChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, LineChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal LineChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, LineChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "LineChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannelProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannelProperties.Serialization.cs index 044f32f17675..0471719e0f5a 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannelProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannelProperties.Serialization.cs @@ -44,7 +44,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (options.Format != "W" && Optional.IsDefined(CallbackUri)) { writer.WritePropertyName("callbackUrl"u8); - writer.WriteStringValue(CallbackUri.AbsoluteUri); + writer.WriteStringValue(CallbackUri); } if (options.Format != "W" && Optional.IsDefined(IsValidated)) { @@ -89,7 +89,7 @@ internal static LineChannelProperties DeserializeLineChannelProperties(JsonEleme return null; } IList lineRegistrations = default; - Uri callbackUrl = default; + string callbackUrl = default; bool? isValidated = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -107,11 +107,7 @@ internal static LineChannelProperties DeserializeLineChannelProperties(JsonEleme } if (property.NameEquals("callbackUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - callbackUrl = new Uri(property.Value.GetString()); + callbackUrl = property.Value.GetString(); continue; } if (property.NameEquals("isValidated"u8)) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannelProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannelProperties.cs index 04613b573020..d75d3b1dde20 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannelProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/LineChannelProperties.cs @@ -61,7 +61,7 @@ public LineChannelProperties(IEnumerable lineRegistrations) /// Callback Url to enter in line registration. /// Whether this channel is validated for the bot. /// Keeps track of any properties unknown to the library. - internal LineChannelProperties(IList lineRegistrations, Uri callbackUri, bool? isValidated, IDictionary serializedAdditionalRawData) + internal LineChannelProperties(IList lineRegistrations, string callbackUri, bool? isValidated, IDictionary serializedAdditionalRawData) { LineRegistrations = lineRegistrations; CallbackUri = callbackUri; @@ -77,7 +77,7 @@ internal LineChannelProperties() /// The list of line channel registrations. public IList LineRegistrations { get; } /// Callback Url to enter in line registration. - public Uri CallbackUri { get; } + public string CallbackUri { get; } /// Whether this channel is validated for the bot. public bool? IsValidated { get; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelGetWithKeysResult.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ListChannelWithKeysResponse.Serialization.cs similarity index 78% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelGetWithKeysResult.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ListChannelWithKeysResponse.Serialization.cs index 8649bc91627c..10c5f79090a3 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelGetWithKeysResult.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ListChannelWithKeysResponse.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class BotChannelGetWithKeysResult : IUtf8JsonSerializable, IJsonModel + public partial class ListChannelWithKeysResponse : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,10 +29,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotChannelGetWithKeysResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ListChannelWithKeysResponse)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -73,20 +73,13 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } if (Optional.IsDefined(Kind)) { - if (Kind != null) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.Value.ToString()); - } - else - { - writer.WriteNull("kind"); - } + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); } if (Optional.IsDefined(ETag)) { writer.WritePropertyName("etag"u8); - writer.WriteStringValue(ETag.Value.ToString()); + writer.WriteStringValue(ETag); } if (options.Format != "W" && Optional.IsCollectionDefined(Zones)) { @@ -98,21 +91,34 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); } - BotChannelGetWithKeysResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ListChannelWithKeysResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotChannelGetWithKeysResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ListChannelWithKeysResponse)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotChannelGetWithKeysResult(document.RootElement, options); + return DeserializeListChannelWithKeysResponse(document.RootElement, options); } - internal static BotChannelGetWithKeysResult DeserializeBotChannelGetWithKeysResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static ListChannelWithKeysResponse DeserializeListChannelWithKeysResponse(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -120,18 +126,18 @@ internal static BotChannelGetWithKeysResult DeserializeBotChannelGetWithKeysResu { return null; } - BotChannelProperties resource = default; - BotChannelSettings setting = default; + Channel resource = default; + ChannelSettings setting = default; string provisioningState = default; string entityTag = default; string changedTime = default; - BotChannelProperties properties = default; + Channel properties = default; BotServiceSku sku = default; BotServiceKind? kind = default; - ETag? etag = default; + string etag = default; IReadOnlyList zones = default; - IDictionary tags = default; - AzureLocation location = default; + IReadOnlyDictionary tags = default; + string location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -146,7 +152,7 @@ internal static BotChannelGetWithKeysResult DeserializeBotChannelGetWithKeysResu { continue; } - resource = BotChannelProperties.DeserializeBotChannelProperties(property.Value, options); + resource = Channel.DeserializeChannel(property.Value, options); continue; } if (property.NameEquals("setting"u8)) @@ -155,7 +161,7 @@ internal static BotChannelGetWithKeysResult DeserializeBotChannelGetWithKeysResu { continue; } - setting = BotChannelSettings.DeserializeBotChannelSettings(property.Value, options); + setting = ChannelSettings.DeserializeChannelSettings(property.Value, options); continue; } if (property.NameEquals("provisioningState"u8)) @@ -179,7 +185,7 @@ internal static BotChannelGetWithKeysResult DeserializeBotChannelGetWithKeysResu { continue; } - properties = BotChannelProperties.DeserializeBotChannelProperties(property.Value, options); + properties = Channel.DeserializeChannel(property.Value, options); continue; } if (property.NameEquals("sku"u8)) @@ -195,7 +201,6 @@ internal static BotChannelGetWithKeysResult DeserializeBotChannelGetWithKeysResu { if (property.Value.ValueKind == JsonValueKind.Null) { - kind = null; continue; } kind = new BotServiceKind(property.Value.GetString()); @@ -203,11 +208,7 @@ internal static BotChannelGetWithKeysResult DeserializeBotChannelGetWithKeysResu } if (property.NameEquals("etag"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("zones"u8)) @@ -240,7 +241,7 @@ internal static BotChannelGetWithKeysResult DeserializeBotChannelGetWithKeysResu } if (property.NameEquals("location"u8)) { - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (property.NameEquals("id"u8)) @@ -273,13 +274,11 @@ internal static BotChannelGetWithKeysResult DeserializeBotChannelGetWithKeysResu } } serializedAdditionalRawData = rawDataDictionary; - return new BotChannelGetWithKeysResult( + return new ListChannelWithKeysResponse( id, name, type, systemData, - tags ?? new ChangeTrackingDictionary(), - location, resource, setting, provisioningState, @@ -290,38 +289,40 @@ internal static BotChannelGetWithKeysResult DeserializeBotChannelGetWithKeysResu kind, etag, zones ?? new ChangeTrackingList(), + tags ?? new ChangeTrackingDictionary(), + location, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotChannelGetWithKeysResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ListChannelWithKeysResponse)} does not support writing '{options.Format}' format."); } } - BotChannelGetWithKeysResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ListChannelWithKeysResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotChannelGetWithKeysResult(document.RootElement, options); + return DeserializeListChannelWithKeysResponse(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotChannelGetWithKeysResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ListChannelWithKeysResponse)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelGetWithKeysResult.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ListChannelWithKeysResponse.cs similarity index 68% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelGetWithKeysResult.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ListChannelWithKeysResponse.cs index 41861665ad1d..e881a2333a1e 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelGetWithKeysResult.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ListChannelWithKeysResponse.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.BotService.Models { /// The ARM channel of list channel with keys operation response. - public partial class BotChannelGetWithKeysResult : TrackedResourceData + public partial class ListChannelWithKeysResponse : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -47,23 +47,26 @@ public partial class BotChannelGetWithKeysResult : TrackedResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The location. - public BotChannelGetWithKeysResult(AzureLocation location) : base(location) + /// Initializes a new instance of . + /// The geo-location where the resource lives. + /// is null. + internal ListChannelWithKeysResponse(string location) { + Argument.AssertNotNull(location, nameof(location)); + Zones = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); + Location = location; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The tags. - /// The location. /// /// The set of properties specific to bot channel resource - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , , , , , , , , , , , , , , , and . /// /// Channel settings. @@ -72,15 +75,17 @@ public BotChannelGetWithKeysResult(AzureLocation location) : base(location) /// Changed time of the resource. /// /// The set of properties specific to bot channel resource - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , , , , , , , , , , , , , , , and . /// /// Gets or sets the SKU of the resource. /// Required. Gets or sets the Kind of the resource. /// Entity Tag. /// Entity zones. + /// Resource tags. + /// The geo-location where the resource lives. /// Keeps track of any properties unknown to the library. - internal BotChannelGetWithKeysResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, BotChannelProperties resource, BotChannelSettings setting, string provisioningState, string entityTag, string changedTime, BotChannelProperties properties, BotServiceSku sku, BotServiceKind? kind, ETag? etag, IReadOnlyList zones, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ListChannelWithKeysResponse(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Channel resource, ChannelSettings setting, string provisioningState, string entityTag, string changedTime, Channel properties, BotServiceSku sku, BotServiceKind? kind, string etag, IReadOnlyList zones, IReadOnlyDictionary tags, string location, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Resource = resource; Setting = setting; @@ -92,41 +97,47 @@ internal BotChannelGetWithKeysResult(ResourceIdentifier id, string name, Resourc Kind = kind; ETag = etag; Zones = zones; + Tags = tags; + Location = location; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal BotChannelGetWithKeysResult() + /// Initializes a new instance of for deserialization. + internal ListChannelWithKeysResponse() { } /// /// The set of properties specific to bot channel resource - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , , , , , , , , , , , , , , , and . /// - public BotChannelProperties Resource { get; set; } + public Channel Resource { get; } /// Channel settings. - public BotChannelSettings Setting { get; set; } + public ChannelSettings Setting { get; } /// Provisioning state of the resource. - public string ProvisioningState { get; set; } + public string ProvisioningState { get; } /// Entity tag of the resource. - public string EntityTag { get; set; } + public string EntityTag { get; } /// Changed time of the resource. - public string ChangedTime { get; set; } + public string ChangedTime { get; } /// /// The set of properties specific to bot channel resource - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include , , , , , , , , , , , , , , , , , and . /// - public BotChannelProperties Properties { get; set; } + public Channel Properties { get; } /// Gets or sets the SKU of the resource. - public BotServiceSku Sku { get; set; } + public BotServiceSku Sku { get; } /// Required. Gets or sets the Kind of the resource. - public BotServiceKind? Kind { get; set; } + public BotServiceKind? Kind { get; } /// Entity Tag. - public ETag? ETag { get; set; } + public string ETag { get; } /// Entity zones. public IReadOnlyList Zones { get; } + /// Resource tags. + public IReadOnlyDictionary Tags { get; } + /// The geo-location where the resource lives. + public string Location { get; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/M365Extensions.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/M365Extensions.Serialization.cs index 0a4e65177634..283514225ecb 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/M365Extensions.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/M365Extensions.Serialization.cs @@ -58,9 +58,9 @@ internal static M365Extensions DeserializeM365Extensions(JsonElement element, Mo return null; } string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -77,7 +77,7 @@ internal static M365Extensions DeserializeM365Extensions(JsonElement element, Mo etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -87,11 +87,7 @@ internal static M365Extensions DeserializeM365Extensions(JsonElement element, Mo } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/M365Extensions.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/M365Extensions.cs index 9f12077ec0ae..3e94ab022f18 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/M365Extensions.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/M365Extensions.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// M365 Extensions definition. - public partial class M365Extensions : BotChannelProperties + public partial class M365Extensions : Channel { /// Initializes a new instance of . public M365Extensions() @@ -26,7 +25,7 @@ public M365Extensions() /// Provisioning state of the resource. /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. - internal M365Extensions(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal M365Extensions(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { ChannelName = channelName ?? "M365Extensions"; } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannel.Serialization.cs index 18012d726856..5c8c2ffba7ef 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static MsTeamsChannel DeserializeMsTeamsChannel(JsonElement element, Mo } MsTeamsChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static MsTeamsChannel DeserializeMsTeamsChannel(JsonElement element, Mo etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static MsTeamsChannel DeserializeMsTeamsChannel(JsonElement element, Mo } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannel.cs index d0efd929c079..f113e5db1512 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Microsoft Teams channel definition. - public partial class MsTeamsChannel : BotChannelProperties + public partial class MsTeamsChannel : Channel { /// Initializes a new instance of . public MsTeamsChannel() @@ -27,7 +26,7 @@ public MsTeamsChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to Microsoft Teams channel resource. - internal MsTeamsChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, MsTeamsChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal MsTeamsChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, MsTeamsChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "MsTeamsChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannelProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannelProperties.Serialization.cs index 7e84f61c227f..e00b955a65f2 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannelProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannelProperties.Serialization.cs @@ -34,10 +34,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(MsTeamsChannelProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(IsCallingEnabled)) + if (Optional.IsDefined(EnableCalling)) { writer.WritePropertyName("enableCalling"u8); - writer.WriteBooleanValue(IsCallingEnabled.Value); + writer.WriteBooleanValue(EnableCalling.Value); } if (Optional.IsDefined(CallingWebhook)) { diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannelProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannelProperties.cs index 7f76b7d606ca..660dab30c5bb 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannelProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsTeamsChannelProperties.cs @@ -53,16 +53,16 @@ public MsTeamsChannelProperties(bool isEnabled) } /// Initializes a new instance of . - /// Enable calling for Microsoft Teams channel. + /// Enable calling for Microsoft Teams channel. /// Webhook for Microsoft Teams channel calls. /// Whether this channel is enabled for the bot. /// Webhook for Microsoft Teams channel calls. /// Deployment environment for Microsoft Teams channel calls. /// Whether this channel accepted terms. /// Keeps track of any properties unknown to the library. - internal MsTeamsChannelProperties(bool? isCallingEnabled, string callingWebhook, bool isEnabled, string incomingCallRoute, string deploymentEnvironment, bool? acceptedTerms, IDictionary serializedAdditionalRawData) + internal MsTeamsChannelProperties(bool? enableCalling, string callingWebhook, bool isEnabled, string incomingCallRoute, string deploymentEnvironment, bool? acceptedTerms, IDictionary serializedAdditionalRawData) { - IsCallingEnabled = isCallingEnabled; + EnableCalling = enableCalling; CallingWebhook = callingWebhook; IsEnabled = isEnabled; IncomingCallRoute = incomingCallRoute; @@ -77,7 +77,7 @@ internal MsTeamsChannelProperties() } /// Enable calling for Microsoft Teams channel. - public bool? IsCallingEnabled { get; set; } + public bool? EnableCalling { get; set; } /// Webhook for Microsoft Teams channel calls. public string CallingWebhook { get; set; } /// Whether this channel is enabled for the bot. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotMsaAppType.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsaAppType.cs similarity index 51% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotMsaAppType.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsaAppType.cs index cfd35d260cf8..2610048118ff 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotMsaAppType.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/MsaAppType.cs @@ -11,13 +11,13 @@ namespace Azure.ResourceManager.BotService.Models { /// Microsoft App Type for the bot. - public readonly partial struct BotMsaAppType : IEquatable + public readonly partial struct MsaAppType : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public BotMsaAppType(string value) + public MsaAppType(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -27,23 +27,23 @@ public BotMsaAppType(string value) private const string MultiTenantValue = "MultiTenant"; /// UserAssignedMSI. - public static BotMsaAppType UserAssignedMSI { get; } = new BotMsaAppType(UserAssignedMSIValue); + public static MsaAppType UserAssignedMSI { get; } = new MsaAppType(UserAssignedMSIValue); /// SingleTenant. - public static BotMsaAppType SingleTenant { get; } = new BotMsaAppType(SingleTenantValue); + public static MsaAppType SingleTenant { get; } = new MsaAppType(SingleTenantValue); /// MultiTenant. - public static BotMsaAppType MultiTenant { get; } = new BotMsaAppType(MultiTenantValue); - /// Determines if two values are the same. - public static bool operator ==(BotMsaAppType left, BotMsaAppType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(BotMsaAppType left, BotMsaAppType right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator BotMsaAppType(string value) => new BotMsaAppType(value); + public static MsaAppType MultiTenant { get; } = new MsaAppType(MultiTenantValue); + /// Determines if two values are the same. + public static bool operator ==(MsaAppType left, MsaAppType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MsaAppType left, MsaAppType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MsaAppType(string value) => new MsaAppType(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is BotMsaAppType other && Equals(other); + public override bool Equals(object obj) => obj is MsaAppType other && Equals(other); /// - public bool Equals(BotMsaAppType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(MsaAppType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs new file mode 100644 index 000000000000..83fa3cf72961 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + public partial class NetworkSecurityPerimeter : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(PerimeterGuid)) + { + writer.WritePropertyName("perimeterGuid"u8); + writer.WriteStringValue(PerimeterGuid); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkSecurityPerimeter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkSecurityPerimeter(document.RootElement, options); + } + + internal static NetworkSecurityPerimeter DeserializeNetworkSecurityPerimeter(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string perimeterGuid = default; + string location = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("perimeterGuid"u8)) + { + perimeterGuid = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + location = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkSecurityPerimeter(id, perimeterGuid, location, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support writing '{options.Format}' format."); + } + } + + NetworkSecurityPerimeter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkSecurityPerimeter(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeter.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeter.cs new file mode 100644 index 000000000000..1d4d6941ece9 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeter.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + /// Information about Network Security Perimeter. + public partial class NetworkSecurityPerimeter + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NetworkSecurityPerimeter() + { + } + + /// Initializes a new instance of . + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + /// Guid of the Network Security Perimeter. + /// Location of the Network Security Perimeter. + /// Keeps track of any properties unknown to the library. + internal NetworkSecurityPerimeter(ResourceIdentifier id, string perimeterGuid, string location, IDictionary serializedAdditionalRawData) + { + Id = id; + PerimeterGuid = perimeterGuid; + Location = location; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". + public ResourceIdentifier Id { get; } + /// Guid of the Network Security Perimeter. + public string PerimeterGuid { get; } + /// Location of the Network Security Perimeter. + public string Location { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.Serialization.cs new file mode 100644 index 000000000000..796e2cc760fe --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + internal partial class NetworkSecurityPerimeterConfigurationList : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationList)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkSecurityPerimeterConfigurationList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationList)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkSecurityPerimeterConfigurationList(document.RootElement, options); + } + + internal static NetworkSecurityPerimeterConfigurationList DeserializeNetworkSecurityPerimeterConfigurationList(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkSecurityPerimeterConfigurationList(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationList)} does not support writing '{options.Format}' format."); + } + } + + NetworkSecurityPerimeterConfigurationList IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkSecurityPerimeterConfigurationList(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationList)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.cs new file mode 100644 index 000000000000..a8f708973c99 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationList.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.BotService.Models +{ + /// Result of the List NetworkSecurityPerimeterConfiguration operation. + internal partial class NetworkSecurityPerimeterConfigurationList + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The NetworkSecurityPerimeterConfiguration items on this page. + internal NetworkSecurityPerimeterConfigurationList(IEnumerable value) + { + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NetworkSecurityPerimeterConfiguration items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NetworkSecurityPerimeterConfigurationList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NetworkSecurityPerimeterConfigurationList() + { + } + + /// The NetworkSecurityPerimeterConfiguration items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs new file mode 100644 index 000000000000..f0f4cd3e4a84 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + public partial class NetworkSecurityPerimeterConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(ProvisioningIssues)) + { + writer.WritePropertyName("provisioningIssues"u8); + writer.WriteStartArray(); + foreach (var item in ProvisioningIssues) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(NetworkSecurityPerimeter)) + { + writer.WritePropertyName("networkSecurityPerimeter"u8); + writer.WriteObjectValue(NetworkSecurityPerimeter, options); + } + if (options.Format != "W" && Optional.IsDefined(ResourceAssociation)) + { + writer.WritePropertyName("resourceAssociation"u8); + writer.WriteObjectValue(ResourceAssociation, options); + } + if (options.Format != "W" && Optional.IsDefined(Profile)) + { + writer.WritePropertyName("profile"u8); + writer.WriteObjectValue(Profile, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkSecurityPerimeterConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkSecurityPerimeterConfigurationProperties(document.RootElement, options); + } + + internal static NetworkSecurityPerimeterConfigurationProperties DeserializeNetworkSecurityPerimeterConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + IReadOnlyList provisioningIssues = default; + NetworkSecurityPerimeter networkSecurityPerimeter = default; + ResourceAssociation resourceAssociation = default; + Profile profile = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningIssues"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ProvisioningIssue.DeserializeProvisioningIssue(item, options)); + } + provisioningIssues = array; + continue; + } + if (property.NameEquals("networkSecurityPerimeter"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkSecurityPerimeter = NetworkSecurityPerimeter.DeserializeNetworkSecurityPerimeter(property.Value, options); + continue; + } + if (property.NameEquals("resourceAssociation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceAssociation = ResourceAssociation.DeserializeResourceAssociation(property.Value, options); + continue; + } + if (property.NameEquals("profile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + profile = Profile.DeserializeProfile(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkSecurityPerimeterConfigurationProperties( + provisioningState, + provisioningIssues ?? new ChangeTrackingList(), + networkSecurityPerimeter, + resourceAssociation, + profile, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkSecurityPerimeterConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkSecurityPerimeterConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs new file mode 100644 index 000000000000..5dd9d308f9a1 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.BotService.Models +{ + /// Properties of Network Security Perimeter configuration. + public partial class NetworkSecurityPerimeterConfigurationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NetworkSecurityPerimeterConfigurationProperties() + { + ProvisioningIssues = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// + /// List of Provisioning Issues if any. + /// Information about Network Security Perimeter. + /// Information about resource association. + /// Information about profile. + /// Keeps track of any properties unknown to the library. + internal NetworkSecurityPerimeterConfigurationProperties(ProvisioningState? provisioningState, IReadOnlyList provisioningIssues, NetworkSecurityPerimeter networkSecurityPerimeter, ResourceAssociation resourceAssociation, Profile profile, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + ProvisioningIssues = provisioningIssues; + NetworkSecurityPerimeter = networkSecurityPerimeter; + ResourceAssociation = resourceAssociation; + Profile = profile; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the provisioning state. + public ProvisioningState? ProvisioningState { get; } + /// List of Provisioning Issues if any. + public IReadOnlyList ProvisioningIssues { get; } + /// Information about Network Security Perimeter. + public NetworkSecurityPerimeter NetworkSecurityPerimeter { get; } + /// Information about resource association. + public ResourceAssociation ResourceAssociation { get; } + /// Information about profile. + public Profile Profile { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceNameAvailabilityContent.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRule.Serialization.cs similarity index 60% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceNameAvailabilityContent.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRule.Serialization.cs index 325857c87485..2ae368d1b6cd 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceNameAvailabilityContent.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRule.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class BotServiceNameAvailabilityContent : IUtf8JsonSerializable, IJsonModel + public partial class NspAccessRule : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotServiceNameAvailabilityContent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NspAccessRule)} does not support writing '{format}' format."); } if (Optional.IsDefined(Name)) @@ -39,10 +39,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - if (Optional.IsDefined(ResourceType)) + if (options.Format != "W" && Optional.IsDefined(Properties)) { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType.Value); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -61,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BotServiceNameAvailabilityContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NspAccessRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotServiceNameAvailabilityContent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NspAccessRule)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotServiceNameAvailabilityContent(document.RootElement, options); + return DeserializeNspAccessRule(document.RootElement, options); } - internal static BotServiceNameAvailabilityContent DeserializeBotServiceNameAvailabilityContent(JsonElement element, ModelReaderWriterOptions options = null) + internal static NspAccessRule DeserializeNspAccessRule(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -82,7 +82,7 @@ internal static BotServiceNameAvailabilityContent DeserializeBotServiceNameAvail return null; } string name = default; - ResourceType? type = default; + NspAccessRuleProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,13 +92,13 @@ internal static BotServiceNameAvailabilityContent DeserializeBotServiceNameAvail name = property.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (property.NameEquals("properties"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - type = new ResourceType(property.Value.GetString()); + properties = NspAccessRuleProperties.DeserializeNspAccessRuleProperties(property.Value, options); continue; } if (options.Format != "W") @@ -107,38 +107,38 @@ internal static BotServiceNameAvailabilityContent DeserializeBotServiceNameAvail } } serializedAdditionalRawData = rawDataDictionary; - return new BotServiceNameAvailabilityContent(name, type, serializedAdditionalRawData); + return new NspAccessRule(name, properties, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotServiceNameAvailabilityContent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NspAccessRule)} does not support writing '{options.Format}' format."); } } - BotServiceNameAvailabilityContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NspAccessRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotServiceNameAvailabilityContent(document.RootElement, options); + return DeserializeNspAccessRule(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotServiceNameAvailabilityContent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NspAccessRule)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRule.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRule.cs new file mode 100644 index 000000000000..a82f71dc087e --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRule.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.BotService.Models +{ + /// Information of Access Rule in a profile. + public partial class NspAccessRule + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NspAccessRule() + { + } + + /// Initializes a new instance of . + /// Name of the access rule. + /// Properties of Access Rule. + /// Keeps track of any properties unknown to the library. + internal NspAccessRule(string name, NspAccessRuleProperties properties, IDictionary serializedAdditionalRawData) + { + Name = name; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the access rule. + public string Name { get; } + /// Properties of Access Rule. + public NspAccessRuleProperties Properties { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRuleDirection.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRuleDirection.cs new file mode 100644 index 000000000000..e2c7f051db5b --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRuleDirection.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.BotService.Models +{ + /// Direction of Access Rule. + public readonly partial struct NspAccessRuleDirection : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NspAccessRuleDirection(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InboundValue = "Inbound"; + private const string OutboundValue = "Outbound"; + + /// Inbound. + public static NspAccessRuleDirection Inbound { get; } = new NspAccessRuleDirection(InboundValue); + /// Outbound. + public static NspAccessRuleDirection Outbound { get; } = new NspAccessRuleDirection(OutboundValue); + /// Determines if two values are the same. + public static bool operator ==(NspAccessRuleDirection left, NspAccessRuleDirection right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NspAccessRuleDirection left, NspAccessRuleDirection right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator NspAccessRuleDirection(string value) => new NspAccessRuleDirection(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NspAccessRuleDirection other && Equals(other); + /// + public bool Equals(NspAccessRuleDirection other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRuleProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRuleProperties.Serialization.cs new file mode 100644 index 000000000000..af72e4792cac --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRuleProperties.Serialization.cs @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.BotService.Models +{ + public partial class NspAccessRuleProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NspAccessRuleProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Direction)) + { + writer.WritePropertyName("direction"u8); + writer.WriteStringValue(Direction.Value.ToString()); + } + if (Optional.IsCollectionDefined(AddressPrefixes)) + { + writer.WritePropertyName("addressPrefixes"u8); + writer.WriteStartArray(); + foreach (var item in AddressPrefixes) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Subscriptions)) + { + writer.WritePropertyName("subscriptions"u8); + writer.WriteStartArray(); + foreach (var item in Subscriptions) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(NetworkSecurityPerimeters)) + { + writer.WritePropertyName("networkSecurityPerimeters"u8); + writer.WriteStartArray(); + foreach (var item in NetworkSecurityPerimeters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(FullyQualifiedDomainNames)) + { + writer.WritePropertyName("fullyQualifiedDomainNames"u8); + writer.WriteStartArray(); + foreach (var item in FullyQualifiedDomainNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(EmailAddresses)) + { + writer.WritePropertyName("emailAddresses"u8); + writer.WriteStartArray(); + foreach (var item in EmailAddresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(PhoneNumbers)) + { + writer.WritePropertyName("phoneNumbers"u8); + writer.WriteStartArray(); + foreach (var item in PhoneNumbers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NspAccessRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NspAccessRuleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNspAccessRuleProperties(document.RootElement, options); + } + + internal static NspAccessRuleProperties DeserializeNspAccessRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NspAccessRuleDirection? direction = default; + IReadOnlyList addressPrefixes = default; + IReadOnlyList subscriptions = default; + IReadOnlyList networkSecurityPerimeters = default; + IReadOnlyList fullyQualifiedDomainNames = default; + IReadOnlyList emailAddresses = default; + IReadOnlyList phoneNumbers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("direction"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + direction = new NspAccessRuleDirection(property.Value.GetString()); + continue; + } + if (property.NameEquals("addressPrefixes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + addressPrefixes = array; + continue; + } + if (property.NameEquals("subscriptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + subscriptions = array; + continue; + } + if (property.NameEquals("networkSecurityPerimeters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkSecurityPerimeter.DeserializeNetworkSecurityPerimeter(item, options)); + } + networkSecurityPerimeters = array; + continue; + } + if (property.NameEquals("fullyQualifiedDomainNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + fullyQualifiedDomainNames = array; + continue; + } + if (property.NameEquals("emailAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + emailAddresses = array; + continue; + } + if (property.NameEquals("phoneNumbers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + phoneNumbers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NspAccessRuleProperties( + direction, + addressPrefixes ?? new ChangeTrackingList(), + subscriptions ?? new ChangeTrackingList(), + networkSecurityPerimeters ?? new ChangeTrackingList(), + fullyQualifiedDomainNames ?? new ChangeTrackingList(), + emailAddresses ?? new ChangeTrackingList(), + phoneNumbers ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(NspAccessRuleProperties)} does not support writing '{options.Format}' format."); + } + } + + NspAccessRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNspAccessRuleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NspAccessRuleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRuleProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRuleProperties.cs new file mode 100644 index 000000000000..10c07ade04ce --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/NspAccessRuleProperties.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.BotService.Models +{ + /// Properties of Access Rule. + public partial class NspAccessRuleProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NspAccessRuleProperties() + { + AddressPrefixes = new ChangeTrackingList(); + Subscriptions = new ChangeTrackingList(); + NetworkSecurityPerimeters = new ChangeTrackingList(); + FullyQualifiedDomainNames = new ChangeTrackingList(); + EmailAddresses = new ChangeTrackingList(); + PhoneNumbers = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Direction of Access Rule. + /// Address prefixes in the CIDR format for inbound rules. + /// Subscriptions for inbound rules. + /// NetworkSecurityPerimeters for inbound rules. + /// FQDN for outbound rules. + /// Email addresses for outbound rules. + /// Phone numbers for outbound rules. + /// Keeps track of any properties unknown to the library. + internal NspAccessRuleProperties(NspAccessRuleDirection? direction, IReadOnlyList addressPrefixes, IReadOnlyList subscriptions, IReadOnlyList networkSecurityPerimeters, IReadOnlyList fullyQualifiedDomainNames, IReadOnlyList emailAddresses, IReadOnlyList phoneNumbers, IDictionary serializedAdditionalRawData) + { + Direction = direction; + AddressPrefixes = addressPrefixes; + Subscriptions = subscriptions; + NetworkSecurityPerimeters = networkSecurityPerimeters; + FullyQualifiedDomainNames = fullyQualifiedDomainNames; + EmailAddresses = emailAddresses; + PhoneNumbers = phoneNumbers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Direction of Access Rule. + public NspAccessRuleDirection? Direction { get; } + /// Address prefixes in the CIDR format for inbound rules. + public IReadOnlyList AddressPrefixes { get; } + /// Subscriptions for inbound rules. + public IReadOnlyList Subscriptions { get; } + /// NetworkSecurityPerimeters for inbound rules. + public IReadOnlyList NetworkSecurityPerimeters { get; } + /// FQDN for outbound rules. + public IReadOnlyList FullyQualifiedDomainNames { get; } + /// Email addresses for outbound rules. + public IReadOnlyList EmailAddresses { get; } + /// Phone numbers for outbound rules. + public IReadOnlyList PhoneNumbers { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Omnichannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Omnichannel.Serialization.cs index 7f9989485b9d..2c1e76217268 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Omnichannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Omnichannel.Serialization.cs @@ -58,9 +58,9 @@ internal static Omnichannel DeserializeOmnichannel(JsonElement element, ModelRea return null; } string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -77,7 +77,7 @@ internal static Omnichannel DeserializeOmnichannel(JsonElement element, ModelRea etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -87,11 +87,7 @@ internal static Omnichannel DeserializeOmnichannel(JsonElement element, ModelRea } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Omnichannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Omnichannel.cs index 9234b85ca9e9..5e2573264ace 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Omnichannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Omnichannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Omnichannel channel definition. - public partial class Omnichannel : BotChannelProperties + public partial class Omnichannel : Channel { /// Initializes a new instance of . public Omnichannel() @@ -26,7 +25,7 @@ public Omnichannel() /// Provisioning state of the resource. /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. - internal Omnichannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal Omnichannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { ChannelName = channelName ?? "Omnichannel"; } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationDisplayInfo.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationDisplayInfo.Serialization.cs new file mode 100644 index 000000000000..548b8b2a4bc6 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationDisplayInfo.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + public partial class OperationDisplayInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationDisplayInfo)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Operation)) + { + writer.WritePropertyName("operation"u8); + writer.WriteStringValue(Operation); + } + if (Optional.IsDefined(Provider)) + { + writer.WritePropertyName("provider"u8); + writer.WriteStringValue(Provider); + } + if (Optional.IsDefined(Resource)) + { + writer.WritePropertyName("resource"u8); + writer.WriteStringValue(Resource); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperationDisplayInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationDisplayInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationDisplayInfo(document.RootElement, options); + } + + internal static OperationDisplayInfo DeserializeOperationDisplayInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + string operation = default; + string provider = default; + string resource = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("operation"u8)) + { + operation = property.Value.GetString(); + continue; + } + if (property.NameEquals("provider"u8)) + { + provider = property.Value.GetString(); + continue; + } + if (property.NameEquals("resource"u8)) + { + resource = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationDisplayInfo(description, operation, provider, resource, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(OperationDisplayInfo)} does not support writing '{options.Format}' format."); + } + } + + OperationDisplayInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOperationDisplayInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationDisplayInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationDisplayInfo.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationDisplayInfo.cs new file mode 100644 index 000000000000..c15a14cbbd59 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationDisplayInfo.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.BotService.Models +{ + /// The operation supported by Bot Service Management. + public partial class OperationDisplayInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal OperationDisplayInfo() + { + } + + /// Initializes a new instance of . + /// The description of the operation. + /// The action that users can perform, based on their permission level. + /// Service provider: Microsoft Bot Service. + /// Resource on which the operation is performed. + /// Keeps track of any properties unknown to the library. + internal OperationDisplayInfo(string description, string operation, string provider, string resource, IDictionary serializedAdditionalRawData) + { + Description = description; + Operation = operation; + Provider = provider; + Resource = resource; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The description of the operation. + public string Description { get; } + /// The action that users can perform, based on their permission level. + public string Operation { get; } + /// Service provider: Microsoft Bot Service. + public string Provider { get; } + /// Resource on which the operation is performed. + public string Resource { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntity.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntity.Serialization.cs new file mode 100644 index 000000000000..83e678e1ce0e --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntity.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + public partial class OperationEntity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationEntity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"u8); + writer.WriteObjectValue(Display, options); + } + if (Optional.IsDefined(Origin)) + { + writer.WritePropertyName("origin"u8); + writer.WriteStringValue(Origin); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Properties); +#else + using (JsonDocument document = JsonDocument.Parse(Properties, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperationEntity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationEntity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationEntity(document.RootElement, options); + } + + internal static OperationEntity DeserializeOperationEntity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + OperationDisplayInfo display = default; + string origin = default; + BinaryData properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("display"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + display = OperationDisplayInfo.DeserializeOperationDisplayInfo(property.Value, options); + continue; + } + if (property.NameEquals("origin"u8)) + { + origin = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationEntity(name, display, origin, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(OperationEntity)} does not support writing '{options.Format}' format."); + } + } + + OperationEntity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOperationEntity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationEntity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntity.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntity.cs new file mode 100644 index 000000000000..ba40597ee3db --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntity.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.BotService.Models +{ + /// The operations supported by Bot Service Management. + public partial class OperationEntity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal OperationEntity() + { + } + + /// Initializes a new instance of . + /// Operation name: {provider}/{resource}/{operation}. + /// The operation supported by Bot Service Management. + /// The origin of the operation. + /// Additional properties. + /// Keeps track of any properties unknown to the library. + internal OperationEntity(string name, OperationDisplayInfo display, string origin, BinaryData properties, IDictionary serializedAdditionalRawData) + { + Name = name; + Display = display; + Origin = origin; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Operation name: {provider}/{resource}/{operation}. + public string Name { get; } + /// The operation supported by Bot Service Management. + public OperationDisplayInfo Display { get; } + /// The origin of the operation. + public string Origin { get; } + /// + /// Additional properties. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData Properties { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntityListResult.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntityListResult.Serialization.cs new file mode 100644 index 000000000000..cfec6ab12f22 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntityListResult.Serialization.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + internal partial class OperationEntityListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationEntityListResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperationEntityListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationEntityListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationEntityListResult(document.RootElement, options); + } + + internal static OperationEntityListResult DeserializeOperationEntityListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nextLink = default; + IReadOnlyList value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(OperationEntity.DeserializeOperationEntity(item, options)); + } + value = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationEntityListResult(nextLink, value, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(OperationEntityListResult)} does not support writing '{options.Format}' format."); + } + } + + OperationEntityListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOperationEntityListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationEntityListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntityListResult.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntityListResult.cs new file mode 100644 index 000000000000..6b5fcee5625e --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationEntityListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.BotService.Models +{ + /// The list of bot service operation response. + internal partial class OperationEntityListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of operations. + /// is null. + internal OperationEntityListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The link used to get the next page of operations. + /// The list of operations. + /// Keeps track of any properties unknown to the library. + internal OperationEntityListResult(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + { + NextLink = nextLink; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OperationEntityListResult() + { + } + + /// The link used to get the next page of operations. + public string NextLink { get; } + /// The list of operations. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationResultStatus.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationResultStatus.cs new file mode 100644 index 000000000000..2f48b05b0c44 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationResultStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.BotService.Models +{ + /// The status of the operation being performed. + public readonly partial struct OperationResultStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OperationResultStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CanceledValue = "Canceled"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string RequestedValue = "Requested"; + private const string RunningValue = "Running"; + + /// Canceled. + public static OperationResultStatus Canceled { get; } = new OperationResultStatus(CanceledValue); + /// Succeeded. + public static OperationResultStatus Succeeded { get; } = new OperationResultStatus(SucceededValue); + /// Failed. + public static OperationResultStatus Failed { get; } = new OperationResultStatus(FailedValue); + /// Requested. + public static OperationResultStatus Requested { get; } = new OperationResultStatus(RequestedValue); + /// Running. + public static OperationResultStatus Running { get; } = new OperationResultStatus(RunningValue); + /// Determines if two values are the same. + public static bool operator ==(OperationResultStatus left, OperationResultStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OperationResultStatus left, OperationResultStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OperationResultStatus(string value) => new OperationResultStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OperationResultStatus other && Equals(other); + /// + public bool Equals(OperationResultStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationResultsDescription.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationResultsDescription.Serialization.cs new file mode 100644 index 000000000000..a835799bae5e --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationResultsDescription.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + public partial class OperationResultsDescription : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationResultsDescription)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperationResultsDescription IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationResultsDescription)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationResultsDescription(document.RootElement, options); + } + + internal static OperationResultsDescription DeserializeOperationResultsDescription(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string name = default; + OperationResultStatus? status = default; + DateTimeOffset? startTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new OperationResultStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationResultsDescription(id, name, status, startTime, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(OperationResultsDescription)} does not support writing '{options.Format}' format."); + } + } + + OperationResultsDescription IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOperationResultsDescription(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationResultsDescription)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationResultsDescription.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationResultsDescription.cs new file mode 100644 index 000000000000..7a43da8a3957 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OperationResultsDescription.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.BotService.Models +{ + /// The properties indicating the operation result of an operation on a service. + public partial class OperationResultsDescription + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal OperationResultsDescription() + { + } + + /// Initializes a new instance of . + /// The ID of the operation returned. + /// The name of the operation result. + /// The status of the operation being performed. + /// The time that the operation was started. + /// Keeps track of any properties unknown to the library. + internal OperationResultsDescription(string id, string name, OperationResultStatus? status, DateTimeOffset? startOn, IDictionary serializedAdditionalRawData) + { + Id = id; + Name = name; + Status = status; + StartOn = startOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The ID of the operation returned. + public string Id { get; } + /// The name of the operation result. + public string Name { get; } + /// The status of the operation being performed. + public OperationResultStatus? Status { get; } + /// The time that the operation was started. + public DateTimeOffset? StartOn { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OutlookChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OutlookChannel.Serialization.cs index 3f5361ebfd23..2e0e3039489a 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OutlookChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OutlookChannel.Serialization.cs @@ -58,9 +58,9 @@ internal static OutlookChannel DeserializeOutlookChannel(JsonElement element, Mo return null; } string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -77,7 +77,7 @@ internal static OutlookChannel DeserializeOutlookChannel(JsonElement element, Mo etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -87,11 +87,7 @@ internal static OutlookChannel DeserializeOutlookChannel(JsonElement element, Mo } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OutlookChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OutlookChannel.cs index 7a424991562c..983980017714 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OutlookChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/OutlookChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Outlook channel definition. - public partial class OutlookChannel : BotChannelProperties + public partial class OutlookChannel : Channel { /// Initializes a new instance of . public OutlookChannel() @@ -26,7 +25,7 @@ public OutlookChannel() /// Provisioning state of the resource. /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. - internal OutlookChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal OutlookChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { ChannelName = channelName ?? "OutlookChannel"; } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Profile.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Profile.Serialization.cs new file mode 100644 index 000000000000..1794c04d07c1 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Profile.Serialization.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + public partial class Profile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Profile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(AccessRulesVersion)) + { + writer.WritePropertyName("accessRulesVersion"u8); + writer.WriteNumberValue(AccessRulesVersion.Value); + } + if (Optional.IsCollectionDefined(AccessRules)) + { + writer.WritePropertyName("accessRules"u8); + writer.WriteStartArray(); + foreach (var item in AccessRules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DiagnosticSettingsVersion)) + { + writer.WritePropertyName("diagnosticSettingsVersion"u8); + writer.WriteNumberValue(DiagnosticSettingsVersion.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(EnabledLogCategories)) + { + writer.WritePropertyName("enabledLogCategories"u8); + writer.WriteStartArray(); + foreach (var item in EnabledLogCategories) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Profile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Profile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProfile(document.RootElement, options); + } + + internal static Profile DeserializeProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + long? accessRulesVersion = default; + IReadOnlyList accessRules = default; + long? diagnosticSettingsVersion = default; + IReadOnlyList enabledLogCategories = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessRulesVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + accessRulesVersion = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("accessRules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NspAccessRule.DeserializeNspAccessRule(item, options)); + } + accessRules = array; + continue; + } + if (property.NameEquals("diagnosticSettingsVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diagnosticSettingsVersion = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("enabledLogCategories"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + enabledLogCategories = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Profile( + name, + accessRulesVersion, + accessRules ?? new ChangeTrackingList(), + diagnosticSettingsVersion, + enabledLogCategories ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(Profile)} does not support writing '{options.Format}' format."); + } + } + + Profile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Profile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Profile.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Profile.cs new file mode 100644 index 000000000000..d0539f9c53fd --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Profile.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.BotService.Models +{ + /// Information about profile. + public partial class Profile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal Profile() + { + AccessRules = new ChangeTrackingList(); + EnabledLogCategories = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Name of the profile. + /// Current access rules version. + /// List of Access Rules. + /// Current diagnostic settings version. + /// List of log categories. + /// Keeps track of any properties unknown to the library. + internal Profile(string name, long? accessRulesVersion, IReadOnlyList accessRules, long? diagnosticSettingsVersion, IReadOnlyList enabledLogCategories, IDictionary serializedAdditionalRawData) + { + Name = name; + AccessRulesVersion = accessRulesVersion; + AccessRules = accessRules; + DiagnosticSettingsVersion = diagnosticSettingsVersion; + EnabledLogCategories = enabledLogCategories; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the profile. + public string Name { get; } + /// Current access rules version. + public long? AccessRulesVersion { get; } + /// List of Access Rules. + public IReadOnlyList AccessRules { get; } + /// Current diagnostic settings version. + public long? DiagnosticSettingsVersion { get; } + /// List of log categories. + public IReadOnlyList EnabledLogCategories { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssue.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssue.Serialization.cs new file mode 100644 index 000000000000..77f788d4f896 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssue.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + public partial class ProvisioningIssue : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProvisioningIssue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProvisioningIssue(document.RootElement, options); + } + + internal static ProvisioningIssue DeserializeProvisioningIssue(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ProvisioningIssueProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ProvisioningIssueProperties.DeserializeProvisioningIssueProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProvisioningIssue(name, properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support writing '{options.Format}' format."); + } + } + + ProvisioningIssue IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProvisioningIssue(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssue.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssue.cs new file mode 100644 index 000000000000..1428d262b13c --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssue.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.BotService.Models +{ + /// Describes Provisioning issue for given Network Security Perimeter configuration. + public partial class ProvisioningIssue + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ProvisioningIssue() + { + } + + /// Initializes a new instance of . + /// Name of the issue. + /// Properties of Provisioning Issue. + /// Keeps track of any properties unknown to the library. + internal ProvisioningIssue(string name, ProvisioningIssueProperties properties, IDictionary serializedAdditionalRawData) + { + Name = name; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the issue. + public string Name { get; } + /// Properties of Provisioning Issue. + public ProvisioningIssueProperties Properties { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs new file mode 100644 index 000000000000..f19951ab5285 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + public partial class ProvisioningIssueProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IssueType)) + { + writer.WritePropertyName("issueType"u8); + writer.WriteStringValue(IssueType); + } + if (Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SuggestedResourceIds)) + { + writer.WritePropertyName("suggestedResourceIds"u8); + writer.WriteStartArray(); + foreach (var item in SuggestedResourceIds) + { + if (item == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(SuggestedAccessRules)) + { + writer.WritePropertyName("suggestedAccessRules"u8); + writer.WriteStartArray(); + foreach (var item in SuggestedAccessRules) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProvisioningIssueProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProvisioningIssueProperties(document.RootElement, options); + } + + internal static ProvisioningIssueProperties DeserializeProvisioningIssueProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string issueType = default; + BotServiceSeverity? severity = default; + string description = default; + IReadOnlyList suggestedResourceIds = default; + IReadOnlyList suggestedAccessRules = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("issueType"u8)) + { + issueType = property.Value.GetString(); + continue; + } + if (property.NameEquals("severity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + severity = new BotServiceSeverity(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("suggestedResourceIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } + } + suggestedResourceIds = array; + continue; + } + if (property.NameEquals("suggestedAccessRules"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NspAccessRule.DeserializeNspAccessRule(item, options)); + } + suggestedAccessRules = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProvisioningIssueProperties( + issueType, + severity, + description, + suggestedResourceIds ?? new ChangeTrackingList(), + suggestedAccessRules ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support writing '{options.Format}' format."); + } + } + + ProvisioningIssueProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProvisioningIssueProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssueProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssueProperties.cs new file mode 100644 index 000000000000..51ab81d28120 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningIssueProperties.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + /// Properties of Provisioning Issue. + public partial class ProvisioningIssueProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ProvisioningIssueProperties() + { + SuggestedResourceIds = new ChangeTrackingList(); + SuggestedAccessRules = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Type of Issue. + /// Provisioning state of Network Security Perimeter configuration propagation. + /// Description of the issue. + /// ARM IDs of resources that can be associated to the same perimeter to remediate the issue. + /// Access rules that can be added to the same profile to remediate the issue. + /// Keeps track of any properties unknown to the library. + internal ProvisioningIssueProperties(string issueType, BotServiceSeverity? severity, string description, IReadOnlyList suggestedResourceIds, IReadOnlyList suggestedAccessRules, IDictionary serializedAdditionalRawData) + { + IssueType = issueType; + Severity = severity; + Description = description; + SuggestedResourceIds = suggestedResourceIds; + SuggestedAccessRules = suggestedAccessRules; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Type of Issue. + public string IssueType { get; } + /// Provisioning state of Network Security Perimeter configuration propagation. + public BotServiceSeverity? Severity { get; } + /// Description of the issue. + public string Description { get; } + /// ARM IDs of resources that can be associated to the same perimeter to remediate the issue. + public IReadOnlyList SuggestedResourceIds { get; } + /// Access rules that can be added to the same profile to remediate the issue. + public IReadOnlyList SuggestedAccessRules { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningState.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..7aa442bfb5d3 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.BotService.Models +{ + /// The ProvisioningState. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string AcceptedValue = "Accepted"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string DeletingValue = "Deleting"; + + /// Creating. + public static ProvisioningState Creating { get; } = new ProvisioningState(CreatingValue); + /// Updating. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// Accepted. + public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); + /// Succeeded. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Deleting. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/PublicNetworkAccess.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/PublicNetworkAccess.cs new file mode 100644 index 000000000000..254c34a570c4 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/PublicNetworkAccess.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.BotService.Models +{ + /// Whether the bot is in an isolated network. + public readonly partial struct PublicNetworkAccess : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PublicNetworkAccess(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + private const string SecuredByPerimeterValue = "SecuredByPerimeter"; + + /// Enabled. + public static PublicNetworkAccess Enabled { get; } = new PublicNetworkAccess(EnabledValue); + /// Disabled. + public static PublicNetworkAccess Disabled { get; } = new PublicNetworkAccess(DisabledValue); + /// SecuredByPerimeter. + public static PublicNetworkAccess SecuredByPerimeter { get; } = new PublicNetworkAccess(SecuredByPerimeterValue); + /// Determines if two values are the same. + public static bool operator ==(PublicNetworkAccess left, PublicNetworkAccess right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PublicNetworkAccess left, PublicNetworkAccess right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PublicNetworkAccess(string value) => new PublicNetworkAccess(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PublicNetworkAccess other && Equals(other); + /// + public bool Equals(PublicNetworkAccess other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/GetBotServiceQnAMakerEndpointKeyContent.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/QnAMakerEndpointKeysRequestBody.Serialization.cs similarity index 63% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/GetBotServiceQnAMakerEndpointKeyContent.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/QnAMakerEndpointKeysRequestBody.Serialization.cs index 57a407e4b075..b9eb4a285d91 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/GetBotServiceQnAMakerEndpointKeyContent.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/QnAMakerEndpointKeysRequestBody.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class GetBotServiceQnAMakerEndpointKeyContent : IUtf8JsonSerializable, IJsonModel + public partial class QnAMakerEndpointKeysRequestBody : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter wr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GetBotServiceQnAMakerEndpointKeyContent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(QnAMakerEndpointKeysRequestBody)} does not support writing '{format}' format."); } if (Optional.IsDefined(Hostname)) @@ -61,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - GetBotServiceQnAMakerEndpointKeyContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + QnAMakerEndpointKeysRequestBody IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GetBotServiceQnAMakerEndpointKeyContent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(QnAMakerEndpointKeysRequestBody)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGetBotServiceQnAMakerEndpointKeyContent(document.RootElement, options); + return DeserializeQnAMakerEndpointKeysRequestBody(document.RootElement, options); } - internal static GetBotServiceQnAMakerEndpointKeyContent DeserializeGetBotServiceQnAMakerEndpointKeyContent(JsonElement element, ModelReaderWriterOptions options = null) + internal static QnAMakerEndpointKeysRequestBody DeserializeQnAMakerEndpointKeysRequestBody(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -103,38 +103,38 @@ internal static GetBotServiceQnAMakerEndpointKeyContent DeserializeGetBotService } } serializedAdditionalRawData = rawDataDictionary; - return new GetBotServiceQnAMakerEndpointKeyContent(hostname, authkey, serializedAdditionalRawData); + return new QnAMakerEndpointKeysRequestBody(hostname, authkey, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(GetBotServiceQnAMakerEndpointKeyContent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(QnAMakerEndpointKeysRequestBody)} does not support writing '{options.Format}' format."); } } - GetBotServiceQnAMakerEndpointKeyContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + QnAMakerEndpointKeysRequestBody IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeGetBotServiceQnAMakerEndpointKeyContent(document.RootElement, options); + return DeserializeQnAMakerEndpointKeysRequestBody(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(GetBotServiceQnAMakerEndpointKeyContent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(QnAMakerEndpointKeysRequestBody)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/GetBotServiceQnAMakerEndpointKeyContent.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/QnAMakerEndpointKeysRequestBody.cs similarity index 82% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/GetBotServiceQnAMakerEndpointKeyContent.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/QnAMakerEndpointKeysRequestBody.cs index bacee066cce9..0928b0146223 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/GetBotServiceQnAMakerEndpointKeyContent.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/QnAMakerEndpointKeysRequestBody.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// The request body for a request to Bot Service Management to list QnA Maker endpoint keys. - public partial class GetBotServiceQnAMakerEndpointKeyContent + public partial class QnAMakerEndpointKeysRequestBody { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ public partial class GetBotServiceQnAMakerEndpointKeyContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public GetBotServiceQnAMakerEndpointKeyContent() + /// Initializes a new instance of . + public QnAMakerEndpointKeysRequestBody() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// the host name of the QnA Maker endpoint. /// Subscription key which provides access to this API. /// Keeps track of any properties unknown to the library. - internal GetBotServiceQnAMakerEndpointKeyContent(string hostname, string authkey, IDictionary serializedAdditionalRawData) + internal QnAMakerEndpointKeysRequestBody(string hostname, string authkey, IDictionary serializedAdditionalRawData) { Hostname = hostname; Authkey = authkey; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/GetBotServiceQnAMakerEndpointKeyResult.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/QnAMakerEndpointKeysResponse.Serialization.cs similarity index 67% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/GetBotServiceQnAMakerEndpointKeyResult.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/QnAMakerEndpointKeysResponse.Serialization.cs index fe451a748675..aedb57b2edcf 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/GetBotServiceQnAMakerEndpointKeyResult.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/QnAMakerEndpointKeysResponse.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class GetBotServiceQnAMakerEndpointKeyResult : IUtf8JsonSerializable, IJsonModel + public partial class QnAMakerEndpointKeysResponse : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter wri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GetBotServiceQnAMakerEndpointKeyResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(QnAMakerEndpointKeysResponse)} does not support writing '{format}' format."); } if (Optional.IsDefined(PrimaryEndpointKey)) @@ -71,19 +71,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - GetBotServiceQnAMakerEndpointKeyResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + QnAMakerEndpointKeysResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GetBotServiceQnAMakerEndpointKeyResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(QnAMakerEndpointKeysResponse)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGetBotServiceQnAMakerEndpointKeyResult(document.RootElement, options); + return DeserializeQnAMakerEndpointKeysResponse(document.RootElement, options); } - internal static GetBotServiceQnAMakerEndpointKeyResult DeserializeGetBotServiceQnAMakerEndpointKeyResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static QnAMakerEndpointKeysResponse DeserializeQnAMakerEndpointKeysResponse(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -125,38 +125,38 @@ internal static GetBotServiceQnAMakerEndpointKeyResult DeserializeGetBotServiceQ } } serializedAdditionalRawData = rawDataDictionary; - return new GetBotServiceQnAMakerEndpointKeyResult(primaryEndpointKey, secondaryEndpointKey, installedVersion, lastStableVersion, serializedAdditionalRawData); + return new QnAMakerEndpointKeysResponse(primaryEndpointKey, secondaryEndpointKey, installedVersion, lastStableVersion, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(GetBotServiceQnAMakerEndpointKeyResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(QnAMakerEndpointKeysResponse)} does not support writing '{options.Format}' format."); } } - GetBotServiceQnAMakerEndpointKeyResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + QnAMakerEndpointKeysResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeGetBotServiceQnAMakerEndpointKeyResult(document.RootElement, options); + return DeserializeQnAMakerEndpointKeysResponse(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(GetBotServiceQnAMakerEndpointKeyResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(QnAMakerEndpointKeysResponse)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/GetBotServiceQnAMakerEndpointKeyResult.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/QnAMakerEndpointKeysResponse.cs similarity index 83% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/GetBotServiceQnAMakerEndpointKeyResult.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/QnAMakerEndpointKeysResponse.cs index c717585648e5..99c9f4af6135 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/GetBotServiceQnAMakerEndpointKeyResult.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/QnAMakerEndpointKeysResponse.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// Schema for EndpointKeys generate/refresh operations. - public partial class GetBotServiceQnAMakerEndpointKeyResult + public partial class QnAMakerEndpointKeysResponse { /// /// Keeps track of any properties unknown to the library. @@ -45,18 +45,18 @@ public partial class GetBotServiceQnAMakerEndpointKeyResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal GetBotServiceQnAMakerEndpointKeyResult() + /// Initializes a new instance of . + internal QnAMakerEndpointKeysResponse() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Primary Access Key. /// Secondary Access Key. /// Current version of runtime. /// Latest version of runtime. /// Keeps track of any properties unknown to the library. - internal GetBotServiceQnAMakerEndpointKeyResult(string primaryEndpointKey, string secondaryEndpointKey, string installedVersion, string lastStableVersion, IDictionary serializedAdditionalRawData) + internal QnAMakerEndpointKeysResponse(string primaryEndpointKey, string secondaryEndpointKey, string installedVersion, string lastStableVersion, IDictionary serializedAdditionalRawData) { PrimaryEndpointKey = primaryEndpointKey; SecondaryEndpointKey = secondaryEndpointKey; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/RegenerateKeysBotChannelName.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/RegenerateKeysBotChannelName.Serialization.cs deleted file mode 100644 index 609358239522..000000000000 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/RegenerateKeysBotChannelName.Serialization.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.BotService.Models -{ - internal static partial class RegenerateKeysBotChannelNameExtensions - { - public static string ToSerialString(this RegenerateKeysBotChannelName value) => value switch - { - RegenerateKeysBotChannelName.WebChatChannel => "WebChatChannel", - RegenerateKeysBotChannelName.DirectLineChannel => "DirectLineChannel", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RegenerateKeysBotChannelName value.") - }; - - public static RegenerateKeysBotChannelName ToRegenerateKeysBotChannelName(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "WebChatChannel")) return RegenerateKeysBotChannelName.WebChatChannel; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "DirectLineChannel")) return RegenerateKeysBotChannelName.DirectLineChannel; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown RegenerateKeysBotChannelName value."); - } - } -} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/RegenerateKeysBotChannelName.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/RegenerateKeysBotChannelName.cs deleted file mode 100644 index e47ca311a29a..000000000000 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/RegenerateKeysBotChannelName.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.BotService.Models -{ - /// The RegenerateKeysBotChannelName. - public enum RegenerateKeysBotChannelName - { - /// WebChatChannel. - WebChatChannel, - /// DirectLineChannel. - DirectLineChannel - } -} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ResourceAssociation.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ResourceAssociation.Serialization.cs new file mode 100644 index 000000000000..5a8b13cf96fd --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ResourceAssociation.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.BotService.Models +{ + public partial class ResourceAssociation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceAssociation)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(AccessMode)) + { + writer.WritePropertyName("accessMode"u8); + writer.WriteStringValue(AccessMode.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ResourceAssociation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceAssociation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceAssociation(document.RootElement, options); + } + + internal static ResourceAssociation DeserializeResourceAssociation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + AccessMode? accessMode = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("accessMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + accessMode = new AccessMode(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceAssociation(name, accessMode, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(ResourceAssociation)} does not support writing '{options.Format}' format."); + } + } + + ResourceAssociation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceAssociation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceAssociation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ResourceAssociation.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ResourceAssociation.cs new file mode 100644 index 000000000000..8e457d2bfb38 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ResourceAssociation.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.BotService.Models +{ + /// Information about resource association. + public partial class ResourceAssociation + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ResourceAssociation() + { + } + + /// Initializes a new instance of . + /// Name of the resource association. + /// Access Mode of the resource association. + /// Keeps track of any properties unknown to the library. + internal ResourceAssociation(string name, AccessMode? accessMode, IDictionary serializedAdditionalRawData) + { + Name = name; + AccessMode = accessMode; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the resource association. + public string Name { get; } + /// Access Mode of the resource association. + public AccessMode? AccessMode { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SearchAssistant.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SearchAssistant.Serialization.cs index 4dbb94c72fb6..479e92367f76 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SearchAssistant.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SearchAssistant.Serialization.cs @@ -58,9 +58,9 @@ internal static SearchAssistant DeserializeSearchAssistant(JsonElement element, return null; } string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -77,7 +77,7 @@ internal static SearchAssistant DeserializeSearchAssistant(JsonElement element, etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -87,11 +87,7 @@ internal static SearchAssistant DeserializeSearchAssistant(JsonElement element, } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SearchAssistant.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SearchAssistant.cs index e6e978bd1d41..d99425ea1231 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SearchAssistant.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SearchAssistant.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// SearchAssistant definition. - public partial class SearchAssistant : BotChannelProperties + public partial class SearchAssistant : Channel { /// Initializes a new instance of . public SearchAssistant() @@ -26,7 +25,7 @@ public SearchAssistant() /// Provisioning state of the resource. /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. - internal SearchAssistant(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal SearchAssistant(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { ChannelName = channelName ?? "SearchAssistant"; } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProvider.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProvider.Serialization.cs similarity index 64% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProvider.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProvider.Serialization.cs index ef4cdefe4f2f..0d15ba577031 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProvider.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProvider.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class BotServiceProvider : IUtf8JsonSerializable, IJsonModel + public partial class ServiceProvider : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotServiceProvider)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServiceProvider)} does not support writing '{format}' format."); } if (Optional.IsDefined(Properties)) @@ -56,19 +56,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BotServiceProvider IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServiceProvider IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotServiceProvider)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServiceProvider)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotServiceProvider(document.RootElement, options); + return DeserializeServiceProvider(document.RootElement, options); } - internal static BotServiceProvider DeserializeBotServiceProvider(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServiceProvider DeserializeServiceProvider(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,7 +76,7 @@ internal static BotServiceProvider DeserializeBotServiceProvider(JsonElement ele { return null; } - BotServiceProviderProperties properties = default; + ServiceProviderProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -87,7 +87,7 @@ internal static BotServiceProvider DeserializeBotServiceProvider(JsonElement ele { continue; } - properties = BotServiceProviderProperties.DeserializeBotServiceProviderProperties(property.Value, options); + properties = ServiceProviderProperties.DeserializeServiceProviderProperties(property.Value, options); continue; } if (options.Format != "W") @@ -96,38 +96,38 @@ internal static BotServiceProvider DeserializeBotServiceProvider(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new BotServiceProvider(properties, serializedAdditionalRawData); + return new ServiceProvider(properties, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotServiceProvider)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServiceProvider)} does not support writing '{options.Format}' format."); } } - BotServiceProvider IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServiceProvider IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotServiceProvider(document.RootElement, options); + return DeserializeServiceProvider(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotServiceProvider)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServiceProvider)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProvider.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProvider.cs similarity index 81% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProvider.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProvider.cs index d8f483d305eb..55a68637b8e4 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProvider.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProvider.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// Service Provider Definition. - public partial class BotServiceProvider + public partial class ServiceProvider { /// /// Keeps track of any properties unknown to the library. @@ -45,21 +45,21 @@ public partial class BotServiceProvider /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal BotServiceProvider() + /// Initializes a new instance of . + internal ServiceProvider() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The Properties of a Service Provider Object. /// Keeps track of any properties unknown to the library. - internal BotServiceProvider(BotServiceProviderProperties properties, IDictionary serializedAdditionalRawData) + internal ServiceProvider(ServiceProviderProperties properties, IDictionary serializedAdditionalRawData) { Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } /// The Properties of a Service Provider Object. - public BotServiceProviderProperties Properties { get; } + public ServiceProviderProperties Properties { get; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProviderParameter.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameter.Serialization.cs similarity index 71% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProviderParameter.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameter.Serialization.cs index 0e0098b07df7..faa218330681 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProviderParameter.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameter.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class BotServiceProviderParameter : IUtf8JsonSerializable, IJsonModel + public partial class ServiceProviderParameter : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotServiceProviderParameter)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServiceProviderParameter)} does not support writing '{format}' format."); } if (options.Format != "W" && Optional.IsDefined(Name)) @@ -39,10 +39,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - if (options.Format != "W" && Optional.IsDefined(ServiceProviderParameterType)) + if (options.Format != "W" && Optional.IsDefined(Type)) { writer.WritePropertyName("type"u8); - writer.WriteStringValue(ServiceProviderParameterType); + writer.WriteStringValue(Type); } if (options.Format != "W" && Optional.IsDefined(DisplayName)) { @@ -57,7 +57,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (options.Format != "W" && Optional.IsDefined(HelpUri)) { writer.WritePropertyName("helpUrl"u8); - writer.WriteStringValue(HelpUri.AbsoluteUri); + writer.WriteStringValue(HelpUri); } if (options.Format != "W" && Optional.IsDefined(Default)) { @@ -86,19 +86,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BotServiceProviderParameter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServiceProviderParameter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotServiceProviderParameter)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServiceProviderParameter)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotServiceProviderParameter(document.RootElement, options); + return DeserializeServiceProviderParameter(document.RootElement, options); } - internal static BotServiceProviderParameter DeserializeBotServiceProviderParameter(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServiceProviderParameter DeserializeServiceProviderParameter(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -110,7 +110,7 @@ internal static BotServiceProviderParameter DeserializeBotServiceProviderParamet string type = default; string displayName = default; string description = default; - Uri helpUrl = default; + string helpUrl = default; string @default = default; ServiceProviderParameterMetadata metadata = default; IDictionary serializedAdditionalRawData = default; @@ -139,11 +139,7 @@ internal static BotServiceProviderParameter DeserializeBotServiceProviderParamet } if (property.NameEquals("helpUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - helpUrl = new Uri(property.Value.GetString()); + helpUrl = property.Value.GetString(); continue; } if (property.NameEquals("default"u8)) @@ -166,7 +162,7 @@ internal static BotServiceProviderParameter DeserializeBotServiceProviderParamet } } serializedAdditionalRawData = rawDataDictionary; - return new BotServiceProviderParameter( + return new ServiceProviderParameter( name, type, displayName, @@ -177,35 +173,35 @@ internal static BotServiceProviderParameter DeserializeBotServiceProviderParamet serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotServiceProviderParameter)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServiceProviderParameter)} does not support writing '{options.Format}' format."); } } - BotServiceProviderParameter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServiceProviderParameter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotServiceProviderParameter(document.RootElement, options); + return DeserializeServiceProviderParameter(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotServiceProviderParameter)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServiceProviderParameter)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProviderParameter.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameter.cs similarity index 78% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProviderParameter.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameter.cs index 7b1a19d96946..4687a557b318 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProviderParameter.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameter.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// Extra Parameters specific to each Service Provider. - public partial class BotServiceProviderParameter + public partial class ServiceProviderParameter { /// /// Keeps track of any properties unknown to the library. @@ -45,24 +45,24 @@ public partial class BotServiceProviderParameter /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal BotServiceProviderParameter() + /// Initializes a new instance of . + internal ServiceProviderParameter() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Name of the Service Provider. - /// Type of the Service Provider. + /// Type of the Service Provider. /// Display Name of the Service Provider. /// Description of the Service Provider. /// Help Url for the Service Provider. /// Default Name for the Service Provider. /// Meta data for the Service Provider. /// Keeps track of any properties unknown to the library. - internal BotServiceProviderParameter(string name, string serviceProviderParameterType, string displayName, string description, Uri helpUri, string @default, ServiceProviderParameterMetadata metadata, IDictionary serializedAdditionalRawData) + internal ServiceProviderParameter(string name, string type, string displayName, string description, string helpUri, string @default, ServiceProviderParameterMetadata metadata, IDictionary serializedAdditionalRawData) { Name = name; - ServiceProviderParameterType = serviceProviderParameterType; + Type = type; DisplayName = displayName; Description = description; HelpUri = helpUri; @@ -74,21 +74,21 @@ internal BotServiceProviderParameter(string name, string serviceProviderParamete /// Name of the Service Provider. public string Name { get; } /// Type of the Service Provider. - public string ServiceProviderParameterType { get; } + public string Type { get; } /// Display Name of the Service Provider. public string DisplayName { get; } /// Description of the Service Provider. public string Description { get; } /// Help Url for the Service Provider. - public Uri HelpUri { get; } + public string HelpUri { get; } /// Default Name for the Service Provider. public string Default { get; } /// Meta data for the Service Provider. internal ServiceProviderParameterMetadata Metadata { get; } /// Whether required the constraints of the bot meta data. - public bool? IsRequired + public bool? Required { - get => Metadata?.IsRequired; + get => Metadata?.Required; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameterMetadata.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameterMetadata.cs index 5b11f22f4b79..9f55d358f497 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameterMetadata.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameterMetadata.cs @@ -62,9 +62,9 @@ internal ServiceProviderParameterMetadata(ServiceProviderParameterMetadataConstr /// the constraints of the bot meta data. internal ServiceProviderParameterMetadataConstraints Constraints { get; } /// Whether required the constraints of the bot meta data. - public bool? IsRequired + public bool? Required { - get => Constraints?.IsRequired; + get => Constraints?.Required; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameterMetadataConstraints.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameterMetadataConstraints.Serialization.cs index d8d9ea7d6498..8a22c07164d0 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameterMetadataConstraints.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameterMetadataConstraints.Serialization.cs @@ -34,10 +34,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ServiceProviderParameterMetadataConstraints)} does not support writing '{format}' format."); } - if (Optional.IsDefined(IsRequired)) + if (Optional.IsDefined(Required)) { writer.WritePropertyName("required"u8); - writer.WriteBooleanValue(IsRequired.Value); + writer.WriteBooleanValue(Required.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameterMetadataConstraints.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameterMetadataConstraints.cs index bbda79ec28d5..f4ee4d89ba9e 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameterMetadataConstraints.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderParameterMetadataConstraints.cs @@ -51,15 +51,15 @@ internal ServiceProviderParameterMetadataConstraints() } /// Initializes a new instance of . - /// Whether required the constraints of the bot meta data. + /// Whether required the constraints of the bot meta data. /// Keeps track of any properties unknown to the library. - internal ServiceProviderParameterMetadataConstraints(bool? isRequired, IDictionary serializedAdditionalRawData) + internal ServiceProviderParameterMetadataConstraints(bool? required, IDictionary serializedAdditionalRawData) { - IsRequired = isRequired; + Required = required; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Whether required the constraints of the bot meta data. - public bool? IsRequired { get; } + public bool? Required { get; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProviderProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderProperties.Serialization.cs similarity index 66% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProviderProperties.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderProperties.Serialization.cs index c7264e8041f6..04c64db28d2e 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProviderProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class BotServiceProviderProperties : IUtf8JsonSerializable, IJsonModel + public partial class ServiceProviderProperties : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotServiceProviderProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ServiceProviderProperties)} does not support writing '{format}' format."); } if (options.Format != "W" && Optional.IsDefined(Id)) @@ -52,12 +52,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (options.Format != "W" && Optional.IsDefined(DevPortalUri)) { writer.WritePropertyName("devPortalUrl"u8); - writer.WriteStringValue(DevPortalUri.AbsoluteUri); + writer.WriteStringValue(DevPortalUri); } if (Optional.IsDefined(IconUri)) { writer.WritePropertyName("iconUrl"u8); - writer.WriteStringValue(IconUri.AbsoluteUri); + writer.WriteStringValue(IconUri); } if (Optional.IsCollectionDefined(Parameters)) { @@ -86,19 +86,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BotServiceProviderProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ServiceProviderProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotServiceProviderProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ServiceProviderProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotServiceProviderProperties(document.RootElement, options); + return DeserializeServiceProviderProperties(document.RootElement, options); } - internal static BotServiceProviderProperties DeserializeBotServiceProviderProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static ServiceProviderProperties DeserializeServiceProviderProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -109,9 +109,9 @@ internal static BotServiceProviderProperties DeserializeBotServiceProviderProper string id = default; string displayName = default; string serviceProviderName = default; - Uri devPortalUrl = default; - Uri iconUrl = default; - IReadOnlyList parameters = default; + string devPortalUrl = default; + string iconUrl = default; + IReadOnlyList parameters = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -133,20 +133,12 @@ internal static BotServiceProviderProperties DeserializeBotServiceProviderProper } if (property.NameEquals("devPortalUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - devPortalUrl = new Uri(property.Value.GetString()); + devPortalUrl = property.Value.GetString(); continue; } if (property.NameEquals("iconUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - iconUrl = new Uri(property.Value.GetString()); + iconUrl = property.Value.GetString(); continue; } if (property.NameEquals("parameters"u8)) @@ -155,10 +147,10 @@ internal static BotServiceProviderProperties DeserializeBotServiceProviderProper { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(BotServiceProviderParameter.DeserializeBotServiceProviderParameter(item, options)); + array.Add(ServiceProviderParameter.DeserializeServiceProviderParameter(item, options)); } parameters = array; continue; @@ -169,45 +161,45 @@ internal static BotServiceProviderProperties DeserializeBotServiceProviderProper } } serializedAdditionalRawData = rawDataDictionary; - return new BotServiceProviderProperties( + return new ServiceProviderProperties( id, displayName, serviceProviderName, devPortalUrl, iconUrl, - parameters ?? new ChangeTrackingList(), + parameters ?? new ChangeTrackingList(), serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotServiceProviderProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServiceProviderProperties)} does not support writing '{options.Format}' format."); } } - BotServiceProviderProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ServiceProviderProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotServiceProviderProperties(document.RootElement, options); + return DeserializeServiceProviderProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotServiceProviderProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ServiceProviderProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProviderProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderProperties.cs similarity index 81% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProviderProperties.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderProperties.cs index 3cc3e09a6351..33e56d8f5efd 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotServiceProviderProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// The Object used to describe a Service Provider supported by Bot Service. - public partial class BotServiceProviderProperties + public partial class ServiceProviderProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,13 +45,13 @@ public partial class BotServiceProviderProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal BotServiceProviderProperties() + /// Initializes a new instance of . + internal ServiceProviderProperties() { - Parameters = new ChangeTrackingList(); + Parameters = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Id for Service Provider. /// Display Name of the Service Provider. /// Name of the Service Provider. @@ -59,7 +59,7 @@ internal BotServiceProviderProperties() /// The URL of icon. /// The list of parameters for the Service Provider. /// Keeps track of any properties unknown to the library. - internal BotServiceProviderProperties(string id, string displayName, string serviceProviderName, Uri devPortalUri, Uri iconUri, IReadOnlyList parameters, IDictionary serializedAdditionalRawData) + internal ServiceProviderProperties(string id, string displayName, string serviceProviderName, string devPortalUri, string iconUri, IReadOnlyList parameters, IDictionary serializedAdditionalRawData) { Id = id; DisplayName = displayName; @@ -77,10 +77,10 @@ internal BotServiceProviderProperties(string id, string displayName, string serv /// Name of the Service Provider. public string ServiceProviderName { get; } /// URL of Dev Portal. - public Uri DevPortalUri { get; } + public string DevPortalUri { get; } /// The URL of icon. - public Uri IconUri { get; } + public string IconUri { get; } /// The list of parameters for the Service Provider. - public IReadOnlyList Parameters { get; } + public IReadOnlyList Parameters { get; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderResponseList.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderResponseList.Serialization.cs index 0a3e06b2d92d..39306f829f64 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderResponseList.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderResponseList.Serialization.cs @@ -87,7 +87,7 @@ internal static ServiceProviderResponseList DeserializeServiceProviderResponseLi return null; } string nextLink = default; - IReadOnlyList value = default; + IReadOnlyList value = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -103,10 +103,10 @@ internal static ServiceProviderResponseList DeserializeServiceProviderResponseLi { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(BotServiceProvider.DeserializeBotServiceProvider(item, options)); + array.Add(ServiceProvider.DeserializeServiceProvider(item, options)); } value = array; continue; @@ -117,7 +117,7 @@ internal static ServiceProviderResponseList DeserializeServiceProviderResponseLi } } serializedAdditionalRawData = rawDataDictionary; - return new ServiceProviderResponseList(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new ServiceProviderResponseList(nextLink, value ?? new ChangeTrackingList(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderResponseList.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderResponseList.cs index 6fd3085051f3..4b18847d6a2f 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderResponseList.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/ServiceProviderResponseList.cs @@ -48,14 +48,14 @@ internal partial class ServiceProviderResponseList /// Initializes a new instance of . internal ServiceProviderResponseList() { - Value = new ChangeTrackingList(); + Value = new ChangeTrackingList(); } /// Initializes a new instance of . /// The link used to get the next page of bot service providers. /// Gets the list of bot service providers and their properties. /// Keeps track of any properties unknown to the library. - internal ServiceProviderResponseList(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) + internal ServiceProviderResponseList(string nextLink, IReadOnlyList value, IDictionary serializedAdditionalRawData) { NextLink = nextLink; Value = value; @@ -65,6 +65,6 @@ internal ServiceProviderResponseList(string nextLink, IReadOnlyList The link used to get the next page of bot service providers. public string NextLink { get; } /// Gets the list of bot service providers and their properties. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelSite.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Site.Serialization.cs similarity index 85% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelSite.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Site.Serialization.cs index 2c502d53b3bf..1e8edfa8a4c4 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelSite.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Site.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class BotChannelSite : IUtf8JsonSerializable, IJsonModel + public partial class Site : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,16 +28,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotChannelSite)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(Site)} does not support writing '{format}' format."); } if (Optional.IsDefined(TenantId)) { writer.WritePropertyName("tenantId"u8); - writer.WriteStringValue(TenantId.Value); + writer.WriteStringValue(TenantId); } if (options.Format != "W" && Optional.IsDefined(SiteId)) { @@ -93,7 +93,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(ETag)) { writer.WritePropertyName("eTag"u8); - writer.WriteStringValue(ETag.Value.ToString()); + writer.WriteStringValue(ETag); } if (Optional.IsDefined(AppId)) { @@ -152,19 +152,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BotChannelSite IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + Site IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotChannelSite)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(Site)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotChannelSite(document.RootElement, options); + return DeserializeSite(document.RootElement, options); } - internal static BotChannelSite DeserializeBotChannelSite(JsonElement element, ModelReaderWriterOptions options = null) + internal static Site DeserializeSite(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -172,7 +172,7 @@ internal static BotChannelSite DeserializeBotChannelSite(JsonElement element, Mo { return null; } - Guid? tenantId = default; + string tenantId = default; string siteId = default; string siteName = default; string key = default; @@ -183,7 +183,7 @@ internal static BotChannelSite DeserializeBotChannelSite(JsonElement element, Mo bool? isDetailedLoggingEnabled = default; bool? isBlockUserUploadEnabled = default; bool? isNoStorageEnabled = default; - ETag? etag = default; + string etag = default; string appId = default; bool? isV1Enabled = default; bool? isV3Enabled = default; @@ -197,11 +197,7 @@ internal static BotChannelSite DeserializeBotChannelSite(JsonElement element, Mo { if (property.NameEquals("tenantId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - tenantId = property.Value.GetGuid(); + tenantId = property.Value.GetString(); continue; } if (property.NameEquals("siteId"u8)) @@ -277,11 +273,7 @@ internal static BotChannelSite DeserializeBotChannelSite(JsonElement element, Mo } if (property.NameEquals("eTag"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("appId"u8)) @@ -354,7 +346,7 @@ internal static BotChannelSite DeserializeBotChannelSite(JsonElement element, Mo } } serializedAdditionalRawData = rawDataDictionary; - return new BotChannelSite( + return new Site( tenantId, siteId, siteName, @@ -377,35 +369,35 @@ internal static BotChannelSite DeserializeBotChannelSite(JsonElement element, Mo serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotChannelSite)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(Site)} does not support writing '{options.Format}' format."); } } - BotChannelSite IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + Site IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotChannelSite(document.RootElement, options); + return DeserializeSite(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotChannelSite)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(Site)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelSite.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Site.cs similarity index 88% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelSite.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Site.cs index df0af95787f7..7a7075da3bd1 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelSite.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/Site.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// A site for the channel. - public partial class BotChannelSite + public partial class Site { /// /// Keeps track of any properties unknown to the library. @@ -45,11 +45,11 @@ public partial class BotChannelSite /// private protected IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// Site name. /// Whether this site is enabled for DirectLine channel. /// is null. - public BotChannelSite(string siteName, bool isEnabled) + public Site(string siteName, bool isEnabled) { Argument.AssertNotNull(siteName, nameof(siteName)); @@ -58,7 +58,7 @@ public BotChannelSite(string siteName, bool isEnabled) TrustedOrigins = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Tenant Id. /// Site Id. /// Site name. @@ -79,7 +79,7 @@ public BotChannelSite(string siteName, bool isEnabled) /// Whether this site is enabled for Webchat Speech. /// Whether this site is enabled for preview versions of Webchat. /// Keeps track of any properties unknown to the library. - internal BotChannelSite(Guid? tenantId, string siteId, string siteName, string key, string key2, bool isEnabled, bool? isTokenEnabled, bool? isEndpointParametersEnabled, bool? isDetailedLoggingEnabled, bool? isBlockUserUploadEnabled, bool? isNoStorageEnabled, ETag? etag, string appId, bool? isV1Enabled, bool? isV3Enabled, bool? isSecureSiteEnabled, IList trustedOrigins, bool? isWebChatSpeechEnabled, bool? isWebchatPreviewEnabled, IDictionary serializedAdditionalRawData) + internal Site(string tenantId, string siteId, string siteName, string key, string key2, bool isEnabled, bool? isTokenEnabled, bool? isEndpointParametersEnabled, bool? isDetailedLoggingEnabled, bool? isBlockUserUploadEnabled, bool? isNoStorageEnabled, string etag, string appId, bool? isV1Enabled, bool? isV3Enabled, bool? isSecureSiteEnabled, IList trustedOrigins, bool? isWebChatSpeechEnabled, bool? isWebchatPreviewEnabled, IDictionary serializedAdditionalRawData) { TenantId = tenantId; SiteId = siteId; @@ -103,13 +103,13 @@ internal BotChannelSite(Guid? tenantId, string siteId, string siteName, string k _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal BotChannelSite() + /// Initializes a new instance of for deserialization. + internal Site() { } /// Tenant Id. - public Guid? TenantId { get; set; } + public string TenantId { get; set; } /// Site Id. public string SiteId { get; } /// Site name. @@ -131,7 +131,7 @@ internal BotChannelSite() /// Whether this no-storage site is disabled detailed logging for. public bool? IsNoStorageEnabled { get; set; } /// Entity Tag. - public ETag? ETag { get; set; } + public string ETag { get; set; } /// DirectLine application id. public string AppId { get; set; } /// Whether this site is enabled for Bot Framework V1 protocol. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelRegenerateKeysContent.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SiteContent.Serialization.cs similarity index 62% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelRegenerateKeysContent.Serialization.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SiteContent.Serialization.cs index 468369fbff96..575be562af14 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelRegenerateKeysContent.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SiteContent.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - public partial class BotChannelRegenerateKeysContent : IUtf8JsonSerializable, IJsonModel + public partial class SiteContent : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotChannelRegenerateKeysContent)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(SiteContent)} does not support writing '{format}' format."); } writer.WritePropertyName("siteName"u8); @@ -55,19 +55,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BotChannelRegenerateKeysContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + SiteContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotChannelRegenerateKeysContent)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(SiteContent)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotChannelRegenerateKeysContent(document.RootElement, options); + return DeserializeSiteContent(document.RootElement, options); } - internal static BotChannelRegenerateKeysContent DeserializeBotChannelRegenerateKeysContent(JsonElement element, ModelReaderWriterOptions options = null) + internal static SiteContent DeserializeSiteContent(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -76,7 +76,7 @@ internal static BotChannelRegenerateKeysContent DeserializeBotChannelRegenerateK return null; } string siteName = default; - BotServiceKey key = default; + Key key = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -88,7 +88,7 @@ internal static BotChannelRegenerateKeysContent DeserializeBotChannelRegenerateK } if (property.NameEquals("key"u8)) { - key = property.Value.GetString().ToBotServiceKey(); + key = property.Value.GetString().ToKey(); continue; } if (options.Format != "W") @@ -97,38 +97,38 @@ internal static BotChannelRegenerateKeysContent DeserializeBotChannelRegenerateK } } serializedAdditionalRawData = rawDataDictionary; - return new BotChannelRegenerateKeysContent(siteName, key, serializedAdditionalRawData); + return new SiteContent(siteName, key, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotChannelRegenerateKeysContent)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(SiteContent)} does not support writing '{options.Format}' format."); } } - BotChannelRegenerateKeysContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + SiteContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotChannelRegenerateKeysContent(document.RootElement, options); + return DeserializeSiteContent(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotChannelRegenerateKeysContent)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(SiteContent)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelRegenerateKeysContent.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SiteContent.cs similarity index 78% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelRegenerateKeysContent.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SiteContent.cs index 9f41ea20be8c..50a8b4c03eae 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/BotChannelRegenerateKeysContent.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SiteContent.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// Site information for WebChat or DirectLine Channels to identify which site to regenerate keys for. - public partial class BotChannelRegenerateKeysContent + public partial class SiteContent { /// /// Keeps track of any properties unknown to the library. @@ -45,11 +45,11 @@ public partial class BotChannelRegenerateKeysContent /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The site name. /// Determines which key is to be regenerated. /// is null. - public BotChannelRegenerateKeysContent(string siteName, BotServiceKey key) + public SiteContent(string siteName, Key key) { Argument.AssertNotNull(siteName, nameof(siteName)); @@ -57,25 +57,25 @@ public BotChannelRegenerateKeysContent(string siteName, BotServiceKey key) Key = key; } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The site name. /// Determines which key is to be regenerated. /// Keeps track of any properties unknown to the library. - internal BotChannelRegenerateKeysContent(string siteName, BotServiceKey key, IDictionary serializedAdditionalRawData) + internal SiteContent(string siteName, Key key, IDictionary serializedAdditionalRawData) { SiteName = siteName; Key = key; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal BotChannelRegenerateKeysContent() + /// Initializes a new instance of for deserialization. + internal SiteContent() { } /// The site name. public string SiteName { get; } /// Determines which key is to be regenerated. - public BotServiceKey Key { get; } + public Key Key { get; } } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannel.Serialization.cs index 0685b135792d..479cbdf43d91 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static SkypeChannel DeserializeSkypeChannel(JsonElement element, ModelR } SkypeChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static SkypeChannel DeserializeSkypeChannel(JsonElement element, ModelR etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static SkypeChannel DeserializeSkypeChannel(JsonElement element, ModelR } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannel.cs index 619e5e731d7b..203bcf0a95dd 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Skype channel definition. - public partial class SkypeChannel : BotChannelProperties + public partial class SkypeChannel : Channel { /// Initializes a new instance of . public SkypeChannel() @@ -27,7 +26,7 @@ public SkypeChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to Skype channel resource. - internal SkypeChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, SkypeChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal SkypeChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, SkypeChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "SkypeChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannelProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannelProperties.Serialization.cs index 01932a6df717..67b28a31720f 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannelProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannelProperties.Serialization.cs @@ -34,35 +34,35 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(SkypeChannelProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(IsMessagingEnabled)) + if (Optional.IsDefined(EnableMessaging)) { writer.WritePropertyName("enableMessaging"u8); - writer.WriteBooleanValue(IsMessagingEnabled.Value); + writer.WriteBooleanValue(EnableMessaging.Value); } - if (Optional.IsDefined(IsMediaCardsEnabled)) + if (Optional.IsDefined(EnableMediaCards)) { writer.WritePropertyName("enableMediaCards"u8); - writer.WriteBooleanValue(IsMediaCardsEnabled.Value); + writer.WriteBooleanValue(EnableMediaCards.Value); } - if (Optional.IsDefined(IsVideoEnabled)) + if (Optional.IsDefined(EnableVideo)) { writer.WritePropertyName("enableVideo"u8); - writer.WriteBooleanValue(IsVideoEnabled.Value); + writer.WriteBooleanValue(EnableVideo.Value); } - if (Optional.IsDefined(IsCallingEnabled)) + if (Optional.IsDefined(EnableCalling)) { writer.WritePropertyName("enableCalling"u8); - writer.WriteBooleanValue(IsCallingEnabled.Value); + writer.WriteBooleanValue(EnableCalling.Value); } - if (Optional.IsDefined(IsScreenSharingEnabled)) + if (Optional.IsDefined(EnableScreenSharing)) { writer.WritePropertyName("enableScreenSharing"u8); - writer.WriteBooleanValue(IsScreenSharingEnabled.Value); + writer.WriteBooleanValue(EnableScreenSharing.Value); } - if (Optional.IsDefined(IsGroupsEnabled)) + if (Optional.IsDefined(EnableGroups)) { writer.WritePropertyName("enableGroups"u8); - writer.WriteBooleanValue(IsGroupsEnabled.Value); + writer.WriteBooleanValue(EnableGroups.Value); } if (Optional.IsDefined(GroupsMode)) { diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannelProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannelProperties.cs index 9e7b5d8f8a75..735c3b5623e0 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannelProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SkypeChannelProperties.cs @@ -53,25 +53,25 @@ public SkypeChannelProperties(bool isEnabled) } /// Initializes a new instance of . - /// Enable messaging for Skype channel. - /// Enable media cards for Skype channel. - /// Enable video for Skype channel. - /// Enable calling for Skype channel. - /// Enable screen sharing for Skype channel. - /// Enable groups for Skype channel. + /// Enable messaging for Skype channel. + /// Enable media cards for Skype channel. + /// Enable video for Skype channel. + /// Enable calling for Skype channel. + /// Enable screen sharing for Skype channel. + /// Enable groups for Skype channel. /// Group mode for Skype channel. /// Calling web hook for Skype channel. /// Incoming call route for Skype channel. /// Whether this channel is enabled for the bot. /// Keeps track of any properties unknown to the library. - internal SkypeChannelProperties(bool? isMessagingEnabled, bool? isMediaCardsEnabled, bool? isVideoEnabled, bool? isCallingEnabled, bool? isScreenSharingEnabled, bool? isGroupsEnabled, string groupsMode, string callingWebHook, string incomingCallRoute, bool isEnabled, IDictionary serializedAdditionalRawData) + internal SkypeChannelProperties(bool? enableMessaging, bool? enableMediaCards, bool? enableVideo, bool? enableCalling, bool? enableScreenSharing, bool? enableGroups, string groupsMode, string callingWebHook, string incomingCallRoute, bool isEnabled, IDictionary serializedAdditionalRawData) { - IsMessagingEnabled = isMessagingEnabled; - IsMediaCardsEnabled = isMediaCardsEnabled; - IsVideoEnabled = isVideoEnabled; - IsCallingEnabled = isCallingEnabled; - IsScreenSharingEnabled = isScreenSharingEnabled; - IsGroupsEnabled = isGroupsEnabled; + EnableMessaging = enableMessaging; + EnableMediaCards = enableMediaCards; + EnableVideo = enableVideo; + EnableCalling = enableCalling; + EnableScreenSharing = enableScreenSharing; + EnableGroups = enableGroups; GroupsMode = groupsMode; CallingWebHook = callingWebHook; IncomingCallRoute = incomingCallRoute; @@ -85,17 +85,17 @@ internal SkypeChannelProperties() } /// Enable messaging for Skype channel. - public bool? IsMessagingEnabled { get; set; } + public bool? EnableMessaging { get; set; } /// Enable media cards for Skype channel. - public bool? IsMediaCardsEnabled { get; set; } + public bool? EnableMediaCards { get; set; } /// Enable video for Skype channel. - public bool? IsVideoEnabled { get; set; } + public bool? EnableVideo { get; set; } /// Enable calling for Skype channel. - public bool? IsCallingEnabled { get; set; } + public bool? EnableCalling { get; set; } /// Enable screen sharing for Skype channel. - public bool? IsScreenSharingEnabled { get; set; } + public bool? EnableScreenSharing { get; set; } /// Enable groups for Skype channel. - public bool? IsGroupsEnabled { get; set; } + public bool? EnableGroups { get; set; } /// Group mode for Skype channel. public string GroupsMode { get; set; } /// Calling web hook for Skype channel. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannel.Serialization.cs index 362a971827ec..8b74eb5b6dcb 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static SlackChannel DeserializeSlackChannel(JsonElement element, ModelR } SlackChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static SlackChannel DeserializeSlackChannel(JsonElement element, ModelR etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static SlackChannel DeserializeSlackChannel(JsonElement element, ModelR } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannel.cs index c9adacc3c991..179a1f118cec 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Slack channel definition. - public partial class SlackChannel : BotChannelProperties + public partial class SlackChannel : Channel { /// Initializes a new instance of . public SlackChannel() @@ -27,7 +26,7 @@ public SlackChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to Slack channel resource. - internal SlackChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, SlackChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal SlackChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, SlackChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "SlackChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannelProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannelProperties.Serialization.cs index 4b2d12de09e9..bd2b6278543c 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannelProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannelProperties.Serialization.cs @@ -57,7 +57,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(LandingPageUri)) { writer.WritePropertyName("landingPageUrl"u8); - writer.WriteStringValue(LandingPageUri.AbsoluteUri); + writer.WriteStringValue(LandingPageUri); } if (options.Format != "W" && Optional.IsDefined(RedirectAction)) { @@ -127,7 +127,7 @@ internal static SlackChannelProperties DeserializeSlackChannelProperties(JsonEle string clientSecret = default; string verificationToken = default; string scopes = default; - Uri landingPageUrl = default; + string landingPageUrl = default; string redirectAction = default; string lastSubmissionId = default; bool? registerBeforeOAuthFlow = default; @@ -160,11 +160,7 @@ internal static SlackChannelProperties DeserializeSlackChannelProperties(JsonEle } if (property.NameEquals("landingPageUrl"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - landingPageUrl = new Uri(property.Value.GetString()); + landingPageUrl = property.Value.GetString(); continue; } if (property.NameEquals("redirectAction"u8)) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannelProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannelProperties.cs index 4ae784cfcad6..91582acb0869 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannelProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SlackChannelProperties.cs @@ -65,7 +65,7 @@ public SlackChannelProperties(bool isEnabled) /// The Slack signing secret. /// Whether this channel is enabled for the bot. /// Keeps track of any properties unknown to the library. - internal SlackChannelProperties(string clientId, string clientSecret, string verificationToken, string scopes, Uri landingPageUri, string redirectAction, string lastSubmissionId, bool? registerBeforeOAuthFlow, bool? isValidated, string signingSecret, bool isEnabled, IDictionary serializedAdditionalRawData) + internal SlackChannelProperties(string clientId, string clientSecret, string verificationToken, string scopes, string landingPageUri, string redirectAction, string lastSubmissionId, bool? registerBeforeOAuthFlow, bool? isValidated, string signingSecret, bool isEnabled, IDictionary serializedAdditionalRawData) { ClientId = clientId; ClientSecret = clientSecret; @@ -95,7 +95,7 @@ internal SlackChannelProperties() /// The Slack permission scopes. public string Scopes { get; set; } /// The Slack landing page Url. - public Uri LandingPageUri { get; set; } + public string LandingPageUri { get; set; } /// The Slack redirect action. public string RedirectAction { get; } /// The Sms auth token. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SmsChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SmsChannel.Serialization.cs index 1df621aec334..2b032899a3a1 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SmsChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SmsChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static SmsChannel DeserializeSmsChannel(JsonElement element, ModelReade } SmsChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static SmsChannel DeserializeSmsChannel(JsonElement element, ModelReade etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static SmsChannel DeserializeSmsChannel(JsonElement element, ModelReade } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SmsChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SmsChannel.cs index 1c3917d3cedc..75e6e9a96e96 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SmsChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/SmsChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Sms channel definition. - public partial class SmsChannel : BotChannelProperties + public partial class SmsChannel : Channel { /// Initializes a new instance of . public SmsChannel() @@ -27,7 +26,7 @@ public SmsChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to Sms channel resource. - internal SmsChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, SmsChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal SmsChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, SmsChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "SmsChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelegramChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelegramChannel.Serialization.cs index 0d4a641a21a5..712beedfa375 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelegramChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelegramChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static TelegramChannel DeserializeTelegramChannel(JsonElement element, } TelegramChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static TelegramChannel DeserializeTelegramChannel(JsonElement element, etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static TelegramChannel DeserializeTelegramChannel(JsonElement element, } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelegramChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelegramChannel.cs index 474c380c633b..dd49cbbd09c6 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelegramChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelegramChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Telegram channel definition. - public partial class TelegramChannel : BotChannelProperties + public partial class TelegramChannel : Channel { /// Initializes a new instance of . public TelegramChannel() @@ -27,7 +26,7 @@ public TelegramChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to Telegram channel resource. - internal TelegramChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, TelegramChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal TelegramChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, TelegramChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "TelegramChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannel.Serialization.cs index f85a8f5741ef..98e114cd7b60 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static TelephonyChannel DeserializeTelephonyChannel(JsonElement element } TelephonyChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static TelephonyChannel DeserializeTelephonyChannel(JsonElement element etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static TelephonyChannel DeserializeTelephonyChannel(JsonElement element } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannel.cs index e6f4a093d399..cc83ed1a2794 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Telephony channel definition. - public partial class TelephonyChannel : BotChannelProperties + public partial class TelephonyChannel : Channel { /// Initializes a new instance of . public TelephonyChannel() @@ -27,7 +26,7 @@ public TelephonyChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to Telephony channel resource. - internal TelephonyChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, TelephonyChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal TelephonyChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, TelephonyChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "TelephonyChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelProperties.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelProperties.Serialization.cs index 1e81feb77a2e..520c4a0b83cf 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelProperties.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelProperties.Serialization.cs @@ -90,12 +90,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteNull("defaultLocale"); } } - if (Optional.IsDefined(PremiumSku)) + if (Optional.IsDefined(PremiumSKU)) { - if (PremiumSku != null) + if (PremiumSKU != null) { writer.WritePropertyName("premiumSKU"u8); - writer.WriteStringValue(PremiumSku); + writer.WriteStringValue(PremiumSKU); } else { @@ -149,7 +149,7 @@ internal static TelephonyChannelProperties DeserializeTelephonyChannelProperties string cognitiveServiceSubscriptionKey = default; string cognitiveServiceRegion = default; string defaultLocale = default; - string premiumSku = default; + string premiumSKU = default; bool? isEnabled = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -217,10 +217,10 @@ internal static TelephonyChannelProperties DeserializeTelephonyChannelProperties { if (property.Value.ValueKind == JsonValueKind.Null) { - premiumSku = null; + premiumSKU = null; continue; } - premiumSku = property.Value.GetString(); + premiumSKU = property.Value.GetString(); continue; } if (property.NameEquals("isEnabled"u8)) @@ -244,7 +244,7 @@ internal static TelephonyChannelProperties DeserializeTelephonyChannelProperties cognitiveServiceSubscriptionKey, cognitiveServiceRegion, defaultLocale, - premiumSku, + premiumSKU, isEnabled, serializedAdditionalRawData); } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelProperties.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelProperties.cs index 1d98bfe58686..828931d569d6 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelProperties.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelProperties.cs @@ -58,17 +58,17 @@ public TelephonyChannelProperties() /// The extensionKey1. /// The extensionKey2. /// The default locale of the channel. - /// The premium SKU applied to the channel. + /// The premium SKU applied to the channel. /// Whether the channel is enabled. /// Keeps track of any properties unknown to the library. - internal TelephonyChannelProperties(IList phoneNumbers, IList apiConfigurations, string cognitiveServiceSubscriptionKey, string cognitiveServiceRegion, string defaultLocale, string premiumSku, bool? isEnabled, IDictionary serializedAdditionalRawData) + internal TelephonyChannelProperties(IList phoneNumbers, IList apiConfigurations, string cognitiveServiceSubscriptionKey, string cognitiveServiceRegion, string defaultLocale, string premiumSKU, bool? isEnabled, IDictionary serializedAdditionalRawData) { PhoneNumbers = phoneNumbers; ApiConfigurations = apiConfigurations; CognitiveServiceSubscriptionKey = cognitiveServiceSubscriptionKey; CognitiveServiceRegion = cognitiveServiceRegion; DefaultLocale = defaultLocale; - PremiumSku = premiumSku; + PremiumSKU = premiumSKU; IsEnabled = isEnabled; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -84,7 +84,7 @@ internal TelephonyChannelProperties(IList phoneNumbers, I /// The default locale of the channel. public string DefaultLocale { get; set; } /// The premium SKU applied to the channel. - public string PremiumSku { get; set; } + public string PremiumSKU { get; set; } /// Whether the channel is enabled. public bool? IsEnabled { get; set; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelResourceApiConfiguration.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelResourceApiConfiguration.Serialization.cs index 373035e9ab13..b8d3b8886b05 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelResourceApiConfiguration.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelResourceApiConfiguration.Serialization.cs @@ -140,7 +140,7 @@ internal static TelephonyChannelResourceApiConfiguration DeserializeTelephonyCha string providerName = default; string cognitiveServiceSubscriptionKey = default; string cognitiveServiceRegion = default; - ResourceIdentifier cognitiveServiceResourceId = default; + string cognitiveServiceResourceId = default; string defaultLocale = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -188,7 +188,7 @@ internal static TelephonyChannelResourceApiConfiguration DeserializeTelephonyCha cognitiveServiceResourceId = null; continue; } - cognitiveServiceResourceId = new ResourceIdentifier(property.Value.GetString()); + cognitiveServiceResourceId = property.Value.GetString(); continue; } if (property.NameEquals("defaultLocale"u8)) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelResourceApiConfiguration.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelResourceApiConfiguration.cs index 4f5f24d5977b..dc68ef3d55a3 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelResourceApiConfiguration.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyChannelResourceApiConfiguration.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { @@ -59,7 +58,7 @@ public TelephonyChannelResourceApiConfiguration() /// The cognitive service resourceId. /// The default locale. /// Keeps track of any properties unknown to the library. - internal TelephonyChannelResourceApiConfiguration(string id, string providerName, string cognitiveServiceSubscriptionKey, string cognitiveServiceRegion, ResourceIdentifier cognitiveServiceResourceId, string defaultLocale, IDictionary serializedAdditionalRawData) + internal TelephonyChannelResourceApiConfiguration(string id, string providerName, string cognitiveServiceSubscriptionKey, string cognitiveServiceRegion, string cognitiveServiceResourceId, string defaultLocale, IDictionary serializedAdditionalRawData) { Id = id; ProviderName = providerName; @@ -79,7 +78,7 @@ internal TelephonyChannelResourceApiConfiguration(string id, string providerName /// The cognitive service region. public string CognitiveServiceRegion { get; set; } /// The cognitive service resourceId. - public ResourceIdentifier CognitiveServiceResourceId { get; set; } + public string CognitiveServiceResourceId { get; set; } /// The default locale. public string DefaultLocale { get; set; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyPhoneNumbers.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyPhoneNumbers.Serialization.cs index 5079a3741bfa..d6b5ca58cdfb 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyPhoneNumbers.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyPhoneNumbers.Serialization.cs @@ -181,10 +181,10 @@ internal static TelephonyPhoneNumbers DeserializeTelephonyPhoneNumbers(JsonEleme string phoneNumber = default; string acsEndpoint = default; string acsSecret = default; - ResourceIdentifier acsResourceId = default; + string acsResourceId = default; string cognitiveServiceSubscriptionKey = default; string cognitiveServiceRegion = default; - ResourceIdentifier cognitiveServiceResourceId = default; + string cognitiveServiceResourceId = default; string defaultLocale = default; string offerType = default; IDictionary serializedAdditionalRawData = default; @@ -228,7 +228,7 @@ internal static TelephonyPhoneNumbers DeserializeTelephonyPhoneNumbers(JsonEleme acsResourceId = null; continue; } - acsResourceId = new ResourceIdentifier(property.Value.GetString()); + acsResourceId = property.Value.GetString(); continue; } if (property.NameEquals("cognitiveServiceSubscriptionKey"u8)) @@ -258,7 +258,7 @@ internal static TelephonyPhoneNumbers DeserializeTelephonyPhoneNumbers(JsonEleme cognitiveServiceResourceId = null; continue; } - cognitiveServiceResourceId = new ResourceIdentifier(property.Value.GetString()); + cognitiveServiceResourceId = property.Value.GetString(); continue; } if (property.NameEquals("defaultLocale"u8)) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyPhoneNumbers.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyPhoneNumbers.cs index d73d4f21b175..f824a65c84f7 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyPhoneNumbers.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/TelephonyPhoneNumbers.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { @@ -63,7 +62,7 @@ public TelephonyPhoneNumbers() /// The default locale of the phone number. /// Optional Property that will determine the offering type of the phone. /// Keeps track of any properties unknown to the library. - internal TelephonyPhoneNumbers(string id, string phoneNumber, string acsEndpoint, string acsSecret, ResourceIdentifier acsResourceId, string cognitiveServiceSubscriptionKey, string cognitiveServiceRegion, ResourceIdentifier cognitiveServiceResourceId, string defaultLocale, string offerType, IDictionary serializedAdditionalRawData) + internal TelephonyPhoneNumbers(string id, string phoneNumber, string acsEndpoint, string acsSecret, string acsResourceId, string cognitiveServiceSubscriptionKey, string cognitiveServiceRegion, string cognitiveServiceResourceId, string defaultLocale, string offerType, IDictionary serializedAdditionalRawData) { Id = id; PhoneNumber = phoneNumber; @@ -87,13 +86,13 @@ internal TelephonyPhoneNumbers(string id, string phoneNumber, string acsEndpoint /// The secret of ACS. public string AcsSecret { get; set; } /// The resource id of ACS. - public ResourceIdentifier AcsResourceId { get; set; } + public string AcsResourceId { get; set; } /// The subscription key of cognitive service. public string CognitiveServiceSubscriptionKey { get; set; } /// The service region of cognitive service. public string CognitiveServiceRegion { get; set; } /// The resource id of cognitive service. - public ResourceIdentifier CognitiveServiceResourceId { get; set; } + public string CognitiveServiceResourceId { get; set; } /// The default locale of the phone number. public string DefaultLocale { get; set; } /// Optional Property that will determine the offering type of the phone. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/UnknownChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/UnknownChannel.Serialization.cs index d0faf146b249..da4f2a303acc 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/UnknownChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/UnknownChannel.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.BotService.Models { - internal partial class UnknownChannel : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownChannel : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,25 +28,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotChannelProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(Channel)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); } - BotChannelProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + Channel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BotChannelProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(Channel)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBotChannelProperties(document.RootElement, options); + return DeserializeChannel(document.RootElement, options); } internal static UnknownChannel DeserializeUnknownChannel(JsonElement element, ModelReaderWriterOptions options = null) @@ -58,9 +58,9 @@ internal static UnknownChannel DeserializeUnknownChannel(JsonElement element, Mo return null; } string channelName = "Unknown"; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -77,7 +77,7 @@ internal static UnknownChannel DeserializeUnknownChannel(JsonElement element, Mo etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -87,11 +87,7 @@ internal static UnknownChannel DeserializeUnknownChannel(JsonElement element, Mo } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") @@ -103,35 +99,35 @@ internal static UnknownChannel DeserializeUnknownChannel(JsonElement element, Mo return new UnknownChannel(channelName, etag, provisioningState, location, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); default: - throw new FormatException($"The model {nameof(BotChannelProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(Channel)} does not support writing '{options.Format}' format."); } } - BotChannelProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + Channel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeBotChannelProperties(document.RootElement, options); + return DeserializeChannel(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BotChannelProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(Channel)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/UnknownChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/UnknownChannel.cs index 909e08e3ea88..f6f2bd23cfb5 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/UnknownChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/UnknownChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Unknown version of Channel. - internal partial class UnknownChannel : BotChannelProperties + internal partial class UnknownChannel : Channel { /// Initializes a new instance of . /// The channel name. @@ -20,7 +19,7 @@ internal partial class UnknownChannel : BotChannelProperties /// Provisioning state of the resource. /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. - internal UnknownChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal UnknownChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { ChannelName = channelName ?? "Unknown"; } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatChannel.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatChannel.Serialization.cs index 8113eafc52f1..9b02a90b82dc 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatChannel.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatChannel.Serialization.cs @@ -64,9 +64,9 @@ internal static WebChatChannel DeserializeWebChatChannel(JsonElement element, Mo } WebChatChannelProperties properties = default; string channelName = default; - ETag? etag = default; + string etag = default; string provisioningState = default; - AzureLocation? location = default; + string location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -92,7 +92,7 @@ internal static WebChatChannel DeserializeWebChatChannel(JsonElement element, Mo etag = null; continue; } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) @@ -102,11 +102,7 @@ internal static WebChatChannel DeserializeWebChatChannel(JsonElement element, Mo } if (property.NameEquals("location"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); + location = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatChannel.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatChannel.cs index 1285e6ed8a50..c060ad5f3683 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatChannel.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatChannel.cs @@ -7,12 +7,11 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.BotService.Models { /// Web Chat channel definition. - public partial class WebChatChannel : BotChannelProperties + public partial class WebChatChannel : Channel { /// Initializes a new instance of . public WebChatChannel() @@ -27,7 +26,7 @@ public WebChatChannel() /// Specifies the location of the resource. /// Keeps track of any properties unknown to the library. /// The set of properties specific to Web Chat channel resource. - internal WebChatChannel(string channelName, ETag? etag, string provisioningState, AzureLocation? location, IDictionary serializedAdditionalRawData, WebChatChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) + internal WebChatChannel(string channelName, string etag, string provisioningState, string location, IDictionary serializedAdditionalRawData, WebChatChannelProperties properties) : base(channelName, etag, provisioningState, location, serializedAdditionalRawData) { Properties = properties; ChannelName = channelName ?? "WebChatChannel"; diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatSite.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatSite.Serialization.cs index 3ac14f3098cc..49af4839113d 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatSite.Serialization.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatSite.Serialization.cs @@ -57,7 +57,7 @@ internal static WebChatSite DeserializeWebChatSite(JsonElement element, ModelRea { return null; } - Guid? tenantId = default; + string tenantId = default; string siteId = default; string siteName = default; string key = default; @@ -68,7 +68,7 @@ internal static WebChatSite DeserializeWebChatSite(JsonElement element, ModelRea bool? isDetailedLoggingEnabled = default; bool? isBlockUserUploadEnabled = default; bool? isNoStorageEnabled = default; - ETag? etag = default; + string etag = default; string appId = default; bool? isV1Enabled = default; bool? isV3Enabled = default; @@ -82,11 +82,7 @@ internal static WebChatSite DeserializeWebChatSite(JsonElement element, ModelRea { if (property.NameEquals("tenantId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - tenantId = property.Value.GetGuid(); + tenantId = property.Value.GetString(); continue; } if (property.NameEquals("siteId"u8)) @@ -162,11 +158,7 @@ internal static WebChatSite DeserializeWebChatSite(JsonElement element, ModelRea } if (property.NameEquals("eTag"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); + etag = property.Value.GetString(); continue; } if (property.NameEquals("appId"u8)) diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatSite.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatSite.cs index b40f110753cd..3e8edc29afc4 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatSite.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/Models/WebChatSite.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.BotService.Models { /// A site for the Webchat channel. - public partial class WebChatSite : BotChannelSite + public partial class WebChatSite : Site { /// Initializes a new instance of . /// Site name. @@ -43,7 +43,7 @@ public WebChatSite(string siteName, bool isEnabled) : base(siteName, isEnabled) /// Whether this site is enabled for Webchat Speech. /// Whether this site is enabled for preview versions of Webchat. /// Keeps track of any properties unknown to the library. - internal WebChatSite(Guid? tenantId, string siteId, string siteName, string key, string key2, bool isEnabled, bool? isTokenEnabled, bool? isEndpointParametersEnabled, bool? isDetailedLoggingEnabled, bool? isBlockUserUploadEnabled, bool? isNoStorageEnabled, ETag? etag, string appId, bool? isV1Enabled, bool? isV3Enabled, bool? isSecureSiteEnabled, IList trustedOrigins, bool? isWebChatSpeechEnabled, bool? isWebchatPreviewEnabled, IDictionary serializedAdditionalRawData) : base(tenantId, siteId, siteName, key, key2, isEnabled, isTokenEnabled, isEndpointParametersEnabled, isDetailedLoggingEnabled, isBlockUserUploadEnabled, isNoStorageEnabled, etag, appId, isV1Enabled, isV3Enabled, isSecureSiteEnabled, trustedOrigins, isWebChatSpeechEnabled, isWebchatPreviewEnabled, serializedAdditionalRawData) + internal WebChatSite(string tenantId, string siteId, string siteName, string key, string key2, bool isEnabled, bool? isTokenEnabled, bool? isEndpointParametersEnabled, bool? isDetailedLoggingEnabled, bool? isBlockUserUploadEnabled, bool? isNoStorageEnabled, string etag, string appId, bool? isV1Enabled, bool? isV3Enabled, bool? isSecureSiteEnabled, IList trustedOrigins, bool? isWebChatSpeechEnabled, bool? isWebchatPreviewEnabled, IDictionary serializedAdditionalRawData) : base(tenantId, siteId, siteName, key, key2, isEnabled, isTokenEnabled, isEndpointParametersEnabled, isDetailedLoggingEnabled, isBlockUserUploadEnabled, isNoStorageEnabled, etag, appId, isV1Enabled, isV3Enabled, isSecureSiteEnabled, trustedOrigins, isWebChatSpeechEnabled, isWebchatPreviewEnabled, serializedAdditionalRawData) { } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs new file mode 100644 index 000000000000..34f3af33c409 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.BotService +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetNetworkSecurityPerimeterConfigurations method from an instance of . + /// + public partial class NetworkSecurityPerimeterConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _networkSecurityPerimeterConfigurationClientDiagnostics; + private readonly NetworkSecurityPerimeterConfigurationsRestOperations _networkSecurityPerimeterConfigurationRestClient; + + /// Initializes a new instance of the class for mocking. + protected NetworkSecurityPerimeterConfigurationCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal NetworkSecurityPerimeterConfigurationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _networkSecurityPerimeterConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", NetworkSecurityPerimeterConfigurationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NetworkSecurityPerimeterConfigurationResource.ResourceType, out string networkSecurityPerimeterConfigurationApiVersion); + _networkSecurityPerimeterConfigurationRestClient = new NetworkSecurityPerimeterConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, networkSecurityPerimeterConfigurationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != BotResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BotResource.ResourceType), nameof(id)); + } + + /// + /// Gets the specified Network Security Perimeter configuration associated with the Bot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfiguration_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource association Name. Composed of parameter guid and association name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); + + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Get"); + scope.Start(); + try + { + var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Network Security Perimeter configuration associated with the Bot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfiguration_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource association Name. Composed of parameter guid and association name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); + + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Get"); + scope.Start(); + try + { + var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Network Security Perimeter configurations associated with the Bot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfiguration_List + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _networkSecurityPerimeterConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkSecurityPerimeterConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityPerimeterConfigurationResource(Client, NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(e)), _networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, "NetworkSecurityPerimeterConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Network Security Perimeter configurations associated with the Bot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfiguration_List + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _networkSecurityPerimeterConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkSecurityPerimeterConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityPerimeterConfigurationResource(Client, NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(e)), _networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, "NetworkSecurityPerimeterConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfiguration_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource association Name. Composed of parameter guid and association name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); + + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Exists"); + scope.Start(); + try + { + var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfiguration_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource association Name. Composed of parameter guid and association name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); + + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.Exists"); + scope.Start(); + try + { + var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfiguration_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource association Name. Composed of parameter guid and association name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); + + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfiguration_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The resource association Name. Composed of parameter guid and association name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); + + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationCollection.GetIfExists"); + scope.Start(); + try + { + var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs new file mode 100644 index 000000000000..a0f6fe67c317 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.BotService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.BotService +{ + public partial class NetworkSecurityPerimeterConfigurationData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + NetworkSecurityPerimeterConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement, options); + } + + internal static NetworkSecurityPerimeterConfigurationData DeserializeNetworkSecurityPerimeterConfigurationData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkSecurityPerimeterConfigurationProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NetworkSecurityPerimeterConfigurationProperties.DeserializeNetworkSecurityPerimeterConfigurationProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkSecurityPerimeterConfigurationData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerBotServiceContext.Default); + default: + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support writing '{options.Format}' format."); + } + } + + NetworkSecurityPerimeterConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationData.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationData.cs new file mode 100644 index 000000000000..9ef44c5943ba --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.BotService.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.BotService +{ + /// + /// A class representing the NetworkSecurityPerimeterConfiguration data model. + /// Network Security Perimeter configuration + /// + public partial class NetworkSecurityPerimeterConfigurationData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal NetworkSecurityPerimeterConfigurationData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Properties of the Network Security Perimeter configuration. + /// Keeps track of any properties unknown to the library. + internal NetworkSecurityPerimeterConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NetworkSecurityPerimeterConfigurationProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Properties of the Network Security Perimeter configuration. + public NetworkSecurityPerimeterConfigurationProperties Properties { get; } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs new file mode 100644 index 000000000000..639737aa5e23 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.BotService +{ + public partial class NetworkSecurityPerimeterConfigurationResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NetworkSecurityPerimeterConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerBotServiceContext.Default); + + NetworkSecurityPerimeterConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerBotServiceContext.Default); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs new file mode 100644 index 000000000000..630c539843f7 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs @@ -0,0 +1,255 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.BotService +{ + /// + /// A Class representing a NetworkSecurityPerimeterConfiguration along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetNetworkSecurityPerimeterConfigurationResource method. + /// Otherwise you can get one from its parent resource using the GetNetworkSecurityPerimeterConfiguration method. + /// + public partial class NetworkSecurityPerimeterConfigurationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The resourceName. + /// The networkSecurityPerimeterConfigurationName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string networkSecurityPerimeterConfigurationName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _networkSecurityPerimeterConfigurationClientDiagnostics; + private readonly NetworkSecurityPerimeterConfigurationsRestOperations _networkSecurityPerimeterConfigurationRestClient; + private readonly NetworkSecurityPerimeterConfigurationData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.BotService/botServices/networkSecurityPerimeterConfigurations"; + + /// Initializes a new instance of the class for mocking. + protected NetworkSecurityPerimeterConfigurationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal NetworkSecurityPerimeterConfigurationResource(ArmClient client, NetworkSecurityPerimeterConfigurationData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal NetworkSecurityPerimeterConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _networkSecurityPerimeterConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.BotService", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string networkSecurityPerimeterConfigurationApiVersion); + _networkSecurityPerimeterConfigurationRestClient = new NetworkSecurityPerimeterConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, networkSecurityPerimeterConfigurationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual NetworkSecurityPerimeterConfigurationData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the specified Network Security Perimeter configuration associated with the Bot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfiguration_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Get"); + scope.Start(); + try + { + var response = await _networkSecurityPerimeterConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified Network Security Perimeter configuration associated with the Bot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfiguration_Get + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Get"); + scope.Start(); + try + { + var response = _networkSecurityPerimeterConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Reconcile the specified Network Security Perimeter configuration associated with the Bot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfigurations_Reconcile + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task> ReconcileAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Reconcile"); + scope.Start(); + try + { + var response = await _networkSecurityPerimeterConfigurationRestClient.ReconcileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new BotServiceArmOperation(new NetworkSecurityPerimeterConfigurationOperationSource(Client), _networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, _networkSecurityPerimeterConfigurationRestClient.CreateReconcileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Reconcile the specified Network Security Perimeter configuration associated with the Bot. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfigurations_Reconcile + /// + /// + /// Default Api Version + /// 2023-09-15-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Reconcile(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.Reconcile"); + scope.Start(); + try + { + var response = _networkSecurityPerimeterConfigurationRestClient.Reconcile(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new BotServiceArmOperation(new NetworkSecurityPerimeterConfigurationOperationSource(Client), _networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, _networkSecurityPerimeterConfigurationRestClient.CreateReconcileRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/ChannelsRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotChannelsRestOperations.cs similarity index 66% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/ChannelsRestOperations.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotChannelsRestOperations.cs index c88c8c2c529d..8bff9d3f68f2 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/ChannelsRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotChannelsRestOperations.cs @@ -15,28 +15,28 @@ namespace Azure.ResourceManager.BotService { - internal partial class ChannelsRestOperations + internal partial class BotChannelsRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of ChannelsRestOperations. + /// Initializes a new instance of BotChannelsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. - public ChannelsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public BotChannelsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-15"; + _apiVersion = apiVersion ?? "2023-09-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string channelName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -47,12 +47,116 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); uri.AppendPath("/channels/", false); - uri.AppendPath(channelName.ToString(), true); + uri.AppendPath(channelName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string channelName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/channels/", false); + uri.AppendPath(channelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns a BotService Channel registration specified by the parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The name of the Bot resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, string channelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, channelName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BotChannelData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BotChannelData.DeserializeBotChannelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BotChannelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns a BotService Channel registration specified by the parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The name of the Bot resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string resourceName, string channelName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, channelName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BotChannelData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BotChannelData.DeserializeBotChannelData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BotChannelData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string channelName, BotChannelData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/channels/", false); + uri.AppendPath(channelName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string resourceName, string channelName, BotChannelData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -66,7 +170,7 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); uri.AppendPath("/channels/", false); - uri.AppendPath(channelName.ToString(), true); + uri.AppendPath(channelName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -79,19 +183,20 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a Channel registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Channel resource. + /// The name of the Bot resource. /// The parameters to provide for the created bot. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string resourceName, string channelName, BotChannelData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); Argument.AssertNotNull(data, nameof(data)); using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, channelName, data); @@ -112,19 +217,20 @@ public async Task> CreateAsync(string subscriptionId, s } /// Creates a Channel registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Channel resource. + /// The name of the Bot resource. /// The parameters to provide for the created bot. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string resourceName, string channelName, BotChannelData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); Argument.AssertNotNull(data, nameof(data)); using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, channelName, data); @@ -144,7 +250,7 @@ public Response Create(string subscriptionId, string resourceGro } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string channelName, BotChannelData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -155,12 +261,12 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); uri.AppendPath("/channels/", false); - uri.AppendPath(channelName.ToString(), true); + uri.AppendPath(channelName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string channelName, BotChannelData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -174,7 +280,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); uri.AppendPath("/channels/", false); - uri.AppendPath(channelName.ToString(), true); + uri.AppendPath(channelName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -187,19 +293,20 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates a Channel registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Channel resource. + /// The name of the Bot resource. /// The parameters to provide for the created bot. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string channelName, BotChannelData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); Argument.AssertNotNull(data, nameof(data)); using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, channelName, data); @@ -220,19 +327,20 @@ public async Task> UpdateAsync(string subscriptionId, s } /// Updates a Channel registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Channel resource. + /// The name of the Bot resource. /// The parameters to provide for the created bot. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, BotChannelData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string resourceName, string channelName, BotChannelData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); Argument.AssertNotNull(data, nameof(data)); using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, resourceName, channelName, data); @@ -252,7 +360,7 @@ public Response Update(string subscriptionId, string resourceGro } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string channelName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -263,12 +371,12 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); uri.AppendPath("/channels/", false); - uri.AppendPath(channelName.ToString(), true); + uri.AppendPath(channelName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string channelName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -282,7 +390,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); uri.AppendPath("/channels/", false); - uri.AppendPath(channelName.ToString(), true); + uri.AppendPath(channelName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -291,18 +399,19 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a Channel registration from a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Channel resource. + /// The name of the Bot resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string channelName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, channelName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); @@ -317,18 +426,19 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a Channel registration from a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Channel resource. + /// The name of the Bot resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string channelName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, channelName); _pipeline.Send(message, cancellationToken); @@ -342,7 +452,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string resourceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -352,13 +462,12 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); - uri.AppendPath("/channels/", false); - uri.AppendPath(channelName.ToString(), true); + uri.AppendPath("/channels", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string resourceName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -371,8 +480,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); - uri.AppendPath("/channels/", false); - uri.AppendPath(channelName.ToString(), true); + uri.AppendPath("/channels", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -380,71 +488,65 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Returns a BotService Channel registration specified by the parameters. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Returns all the Channel registrations of a particular BotService resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Channel resource. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, channelName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, resourceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - BotChannelData value = default; + ChannelResponseList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotChannelData.DeserializeBotChannelData(document.RootElement); + value = ChannelResponseList.DeserializeChannelResponseList(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((BotChannelData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Returns a BotService Channel registration specified by the parameters. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Returns all the Channel registrations of a particular BotService resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Channel resource. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, channelName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, resourceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - BotChannelData value = default; + ChannelResponseList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotChannelData.DeserializeBotChannelData(document.RootElement); + value = ChannelResponseList.DeserializeChannelResponseList(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((BotChannelData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListWithKeysRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) + internal RequestUriBuilder CreateListWithKeysRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string channelName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -455,13 +557,13 @@ internal RequestUriBuilder CreateListWithKeysRequestUri(string subscriptionId, s uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); uri.AppendPath("/channels/", false); - uri.AppendPath(channelName.ToString(), true); + uri.AppendPath(channelName, true); uri.AppendPath("/listChannelWithKeys", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListWithKeysRequest(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName) + internal HttpMessage CreateListWithKeysRequest(string subscriptionId, string resourceGroupName, string resourceName, string channelName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -475,7 +577,7 @@ internal HttpMessage CreateListWithKeysRequest(string subscriptionId, string res uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); uri.AppendPath("/channels/", false); - uri.AppendPath(channelName.ToString(), true); + uri.AppendPath(channelName, true); uri.AppendPath("/listChannelWithKeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; @@ -485,18 +587,19 @@ internal HttpMessage CreateListWithKeysRequest(string subscriptionId, string res } /// Lists a Channel registration for a Bot Service including secrets. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Channel resource. + /// The name of the Bot resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListWithKeysAsync(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListWithKeysAsync(string subscriptionId, string resourceGroupName, string resourceName, string channelName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); using var message = CreateListWithKeysRequest(subscriptionId, resourceGroupName, resourceName, channelName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); @@ -504,9 +607,9 @@ public async Task> ListWithKeysAsync(strin { case 200: { - BotChannelGetWithKeysResult value = default; + ListChannelWithKeysResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotChannelGetWithKeysResult.DeserializeBotChannelGetWithKeysResult(document.RootElement); + value = ListChannelWithKeysResponse.DeserializeListChannelWithKeysResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -515,18 +618,19 @@ public async Task> ListWithKeysAsync(strin } /// Lists a Channel registration for a Bot Service including secrets. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Channel resource. + /// The name of the Bot resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListWithKeys(string subscriptionId, string resourceGroupName, string resourceName, BotChannelName channelName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListWithKeys(string subscriptionId, string resourceGroupName, string resourceName, string channelName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); using var message = CreateListWithKeysRequest(subscriptionId, resourceGroupName, resourceName, channelName); _pipeline.Send(message, cancellationToken); @@ -534,9 +638,9 @@ public Response ListWithKeys(string subscriptionId, { case 200: { - BotChannelGetWithKeysResult value = default; + ListChannelWithKeysResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotChannelGetWithKeysResult.DeserializeBotChannelGetWithKeysResult(document.RootElement); + value = ListChannelWithKeysResponse.DeserializeListChannelWithKeysResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -544,7 +648,7 @@ public Response ListWithKeys(string subscriptionId, } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateRegenerateKeysRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string channelName, SiteContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -554,16 +658,18 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); - uri.AppendPath("/channels", false); + uri.AppendPath("/channels/", false); + uri.AppendPath(channelName, true); + uri.AppendPath("/regeneratekeys", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateRegenerateKeysRequest(string subscriptionId, string resourceGroupName, string resourceName, string channelName, SiteContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -572,36 +678,46 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); - uri.AppendPath("/channels", false); + uri.AppendPath("/channels/", false); + uri.AppendPath(channelName, true); + uri.AppendPath("/regeneratekeys", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Returns all the Channel registrations of a particular BotService resource. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. + /// The name of the Bot resource. + /// The parameters to provide for the created bot. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> RegenerateKeysAsync(string subscriptionId, string resourceGroupName, string resourceName, string channelName, SiteContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, resourceName, channelName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ChannelResponseList value = default; + BotChannelData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ChannelResponseList.DeserializeChannelResponseList(document.RootElement); + value = BotChannelData.DeserializeBotChannelData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -609,28 +725,32 @@ public async Task> ListByResourceGroupAsync(string } } - /// Returns all the Channel registrations of a particular BotService resource. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. + /// The name of the Bot resource. + /// The parameters to provide for the created bot. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response RegenerateKeys(string subscriptionId, string resourceGroupName, string resourceName, string channelName, SiteContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(channelName, nameof(channelName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, resourceName, channelName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ChannelResponseList value = default; + BotChannelData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ChannelResponseList.DeserializeChannelResponseList(document.RootElement); + value = BotChannelData.DeserializeBotChannelData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -662,8 +782,8 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Returns all the Channel registrations of a particular BotService resource. /// The URL to the next page of results. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The cancellation token to use. /// , , or is null. @@ -693,8 +813,8 @@ public async Task> ListByResourceGroupNextPageAsyn /// Returns all the Channel registrations of a particular BotService resource. /// The URL to the next page of results. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The cancellation token to use. /// , , or is null. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotConnectionOperationGroupRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotConnectionOperationGroupRestOperations.cs new file mode 100644 index 000000000000..cd6ab9fae742 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotConnectionOperationGroupRestOperations.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.BotService.Models; + +namespace Azure.ResourceManager.BotService +{ + internal partial class BotConnectionOperationGroupRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BotConnectionOperationGroupRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public BotConnectionOperationGroupRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-09-15-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListServiceProvidersRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.BotService/listAuthServiceProviders", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListServiceProvidersRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.BotService/listAuthServiceProviders", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the available Service Providers for creating Connection Settings. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListServiceProvidersAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListServiceProvidersRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServiceProviderResponseList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ServiceProviderResponseList.DeserializeServiceProviderResponseList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the available Service Providers for creating Connection Settings. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListServiceProviders(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListServiceProvidersRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServiceProviderResponseList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ServiceProviderResponseList.DeserializeServiceProviderResponseList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotsOperationGroupRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotsOperationGroupRestOperations.cs new file mode 100644 index 000000000000..8c735e618f6f --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotsOperationGroupRestOperations.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.BotService.Models; + +namespace Azure.ResourceManager.BotService +{ + internal partial class BotsOperationGroupRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BotsOperationGroupRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public BotsOperationGroupRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-09-15-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetCheckNameAvailabilityRequestUri(CheckNameAvailabilityRequestBody checkNameAvailabilityRequestBody) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.BotService/checkNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetCheckNameAvailabilityRequest(CheckNameAvailabilityRequestBody checkNameAvailabilityRequestBody) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.BotService/checkNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(checkNameAvailabilityRequestBody, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Check whether a bot name is available. + /// The request body. + /// The cancellation token to use. + /// is null. + public async Task> GetCheckNameAvailabilityAsync(CheckNameAvailabilityRequestBody checkNameAvailabilityRequestBody, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(checkNameAvailabilityRequestBody, nameof(checkNameAvailabilityRequestBody)); + + using var message = CreateGetCheckNameAvailabilityRequest(checkNameAvailabilityRequestBody); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CheckNameAvailabilityResponseBody value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CheckNameAvailabilityResponseBody.DeserializeCheckNameAvailabilityResponseBody(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Check whether a bot name is available. + /// The request body. + /// The cancellation token to use. + /// is null. + public Response GetCheckNameAvailability(CheckNameAvailabilityRequestBody checkNameAvailabilityRequestBody, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(checkNameAvailabilityRequestBody, nameof(checkNameAvailabilityRequestBody)); + + using var message = CreateGetCheckNameAvailabilityRequest(checkNameAvailabilityRequestBody); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CheckNameAvailabilityResponseBody value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CheckNameAvailabilityResponseBody.DeserializeCheckNameAvailabilityResponseBody(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotsRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotsRestOperations.cs index 59c8c93866fc..e99509ceb146 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotsRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotsRestOperations.cs @@ -25,17 +25,113 @@ internal partial class BotsRestOperations /// Initializes a new instance of BotsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public BotsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-15"; + _apiVersion = apiVersion ?? "2023-09-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns a BotService specified by the parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BotData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BotData.DeserializeBotData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BotData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns a BotService specified by the parameters. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BotData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BotData.DeserializeBotData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BotData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, BotData data) { var uri = new RawRequestUriBuilder(); @@ -75,8 +171,8 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Creates a Bot Service. Bot Service is a resource group wide resource type. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The parameters to provide for the created bot. /// The cancellation token to use. @@ -107,8 +203,8 @@ public async Task> CreateAsync(string subscriptionId, string r } /// Creates a Bot Service. Bot Service is a resource group wide resource type. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The parameters to provide for the created bot. /// The cancellation token to use. @@ -177,8 +273,8 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The parameters to provide for the created bot. /// The cancellation token to use. @@ -209,8 +305,8 @@ public async Task> UpdateAsync(string subscriptionId, string r } /// Updates a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The parameters to provide for the created bot. /// The cancellation token to use. @@ -275,8 +371,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes a Bot Service from the resource group. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The cancellation token to use. /// , or is null. @@ -300,8 +396,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes a Bot Service from the resource group. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The cancellation token to use. /// , or is null. @@ -324,7 +420,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string r } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -332,13 +428,12 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); - uri.AppendPath(resourceName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -349,8 +444,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); - uri.AppendPath(resourceName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -358,82 +452,72 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Returns a BotService specified by the parameters. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. + /// Returns all the resources of a particular type belonging to a resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - BotData value = default; + BotResponseList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotData.DeserializeBotData(document.RootElement); + value = BotResponseList.DeserializeBotResponseList(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((BotData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Returns a BotService specified by the parameters. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. + /// Returns all the resources of a particular type belonging to a resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - BotData value = default; + BotResponseList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotData.DeserializeBotData(document.RootElement); + value = BotResponseList.DeserializeBotResponseList(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((BotData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -442,8 +526,6 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; @@ -452,18 +534,16 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Returns all the resources of a particular type belonging to a resource group. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Returns all the resources of a particular type belonging to a subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateListRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -479,18 +559,16 @@ public async Task> ListByResourceGroupAsync(string sub } } - /// Returns all the resources of a particular type belonging to a resource group. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Returns all the resources of a particular type belonging to a subscription. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateListRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -506,27 +584,35 @@ public Response ListByResourceGroup(string subscriptionId, stri } } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId) + internal RequestUriBuilder CreateCreateSignInUrlRequestUri(string subscriptionId, string resourceGroupName, string resourceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.BotService/botServices", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/createEmailSignInUrl", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId) + internal HttpMessage CreateCreateSignInUrlRequest(string subscriptionId, string resourceGroupName, string resourceName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.BotService/botServices", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/createEmailSignInUrl", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -534,24 +620,28 @@ internal HttpMessage CreateListRequest(string subscriptionId) return message; } - /// Returns all the resources of a particular type belonging to a subscription. - /// Azure Subscription ID. + /// Creates an email channel sign in url for a Bot Service. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> CreateSignInUrlAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateListRequest(subscriptionId); + using var message = CreateCreateSignInUrlRequest(subscriptionId, resourceGroupName, resourceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - BotResponseList value = default; + CreateEmailSignInUrlResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotResponseList.DeserializeBotResponseList(document.RootElement); + value = CreateEmailSignInUrlResponse.DeserializeCreateEmailSignInUrlResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -559,24 +649,28 @@ public async Task> ListAsync(string subscriptionId, Ca } } - /// Returns all the resources of a particular type belonging to a subscription. - /// Azure Subscription ID. + /// Creates an email channel sign in url for a Bot Service. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateSignInUrl(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateListRequest(subscriptionId); + using var message = CreateCreateSignInUrlRequest(subscriptionId, resourceGroupName, resourceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - BotResponseList value = default; + CreateEmailSignInUrlResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotResponseList.DeserializeBotResponseList(document.RootElement); + value = CreateEmailSignInUrlResponse.DeserializeCreateEmailSignInUrlResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -584,51 +678,64 @@ public Response List(string subscriptionId, CancellationToken c } } - internal RequestUriBuilder CreateGetCheckNameAvailabilityRequestUri(BotServiceNameAvailabilityContent content) + internal RequestUriBuilder CreateListByBotResourceRequestUri(string subscriptionId, string resourceGroupName, string resourceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/providers/Microsoft.BotService/checkNameAvailability", false); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/privateLinkResources", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetCheckNameAvailabilityRequest(BotServiceNameAvailabilityContent content) + internal HttpMessage CreateListByBotResourceRequest(string subscriptionId, string resourceGroupName, string resourceName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendPath("/providers/Microsoft.BotService/checkNameAvailability", false); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/privateLinkResources", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; _userAgent.Apply(message); return message; } - /// Check whether a bot name is available. - /// The request body parameters to provide for the check name availability request. + /// Gets the private link resources that need to be created for a Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. /// The cancellation token to use. - /// is null. - public async Task> GetCheckNameAvailabilityAsync(BotServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByBotResourceAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateGetCheckNameAvailabilityRequest(content); + using var message = CreateListByBotResourceRequest(subscriptionId, resourceGroupName, resourceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - BotServiceNameAvailabilityResult value = default; + BotServicePrivateLinkResourceListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotServiceNameAvailabilityResult.DeserializeBotServiceNameAvailabilityResult(document.RootElement); + value = BotServicePrivateLinkResourceListResult.DeserializeBotServicePrivateLinkResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -636,23 +743,28 @@ public async Task> GetCheckNameAvaila } } - /// Check whether a bot name is available. - /// The request body parameters to provide for the check name availability request. + /// Gets the private link resources that need to be created for a Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. /// The cancellation token to use. - /// is null. - public Response GetCheckNameAvailability(BotServiceNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByBotResource(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - using var message = CreateGetCheckNameAvailabilityRequest(content); + using var message = CreateListByBotResourceRequest(subscriptionId, resourceGroupName, resourceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - BotServiceNameAvailabilityResult value = default; + BotServicePrivateLinkResourceListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotServiceNameAvailabilityResult.DeserializeBotServiceNameAvailabilityResult(document.RootElement); + value = BotServicePrivateLinkResourceListResult.DeserializeBotServicePrivateLinkResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -684,8 +796,8 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Returns all the resources of a particular type belonging to a resource group. /// The URL to the next page of results. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. @@ -713,8 +825,8 @@ public async Task> ListByResourceGroupNextPageAsync(st /// Returns all the resources of a particular type belonging to a resource group. /// The URL to the next page of results. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// , or is null. /// or is an empty string, and was expected to be non-empty. @@ -764,7 +876,7 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Returns all the resources of a particular type belonging to a subscription. /// The URL to the next page of results. - /// Azure Subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. @@ -791,7 +903,7 @@ public async Task> ListNextPageAsync(string nextLink, /// Returns all the resources of a particular type belonging to a subscription. /// The URL to the next page of results. - /// Azure Subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// or is null. /// is an empty string, and was expected to be non-empty. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotConnectionRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/ConnectionSettingsRestOperations.cs similarity index 78% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotConnectionRestOperations.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/ConnectionSettingsRestOperations.cs index e578bed51a54..f45de1e1c10f 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/BotConnectionRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/ConnectionSettingsRestOperations.cs @@ -15,106 +15,28 @@ namespace Azure.ResourceManager.BotService { - internal partial class BotConnectionRestOperations + internal partial class ConnectionSettingsRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of BotConnectionRestOperations. + /// Initializes a new instance of ConnectionSettingsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. - public BotConnectionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public ConnectionSettingsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-15"; + _apiVersion = apiVersion ?? "2023-09-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListServiceProvidersRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.BotService/listAuthServiceProviders", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListServiceProvidersRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.BotService/listAuthServiceProviders", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists the available Service Providers for creating Connection Settings. - /// Azure Subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListServiceProvidersAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListServiceProvidersRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ServiceProviderResponseList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ServiceProviderResponseList.DeserializeServiceProviderResponseList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists the available Service Providers for creating Connection Settings. - /// Azure Subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListServiceProviders(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListServiceProvidersRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ServiceProviderResponseList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ServiceProviderResponseList.DeserializeServiceProviderResponseList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListWithSecretsRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -126,16 +48,15 @@ internal RequestUriBuilder CreateListWithSecretsRequestUri(string subscriptionId uri.AppendPath(resourceName, true); uri.AppendPath("/connections/", false); uri.AppendPath(connectionName, true); - uri.AppendPath("/listWithSecrets", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListWithSecretsRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -146,7 +67,6 @@ internal HttpMessage CreateListWithSecretsRequest(string subscriptionId, string uri.AppendPath(resourceName, true); uri.AppendPath("/connections/", false); uri.AppendPath(connectionName, true); - uri.AppendPath("/listWithSecrets", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -155,68 +75,72 @@ internal HttpMessage CreateListWithSecretsRequest(string subscriptionId, string } /// Get a Connection Setting registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListWithSecretsAsync(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var message = CreateListWithSecretsRequest(subscriptionId, resourceGroupName, resourceName, connectionName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, connectionName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - BotConnectionSettingData value = default; + ConnectionSettingData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotConnectionSettingData.DeserializeBotConnectionSettingData(document.RootElement); + value = ConnectionSettingData.DeserializeConnectionSettingData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((ConnectionSettingData)null, message.Response); default: throw new RequestFailedException(message.Response); } } /// Get a Connection Setting registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListWithSecrets(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var message = CreateListWithSecretsRequest(subscriptionId, resourceGroupName, resourceName, connectionName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, connectionName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - BotConnectionSettingData value = default; + ConnectionSettingData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotConnectionSettingData.DeserializeBotConnectionSettingData(document.RootElement); + value = ConnectionSettingData.DeserializeConnectionSettingData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((ConnectionSettingData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, ConnectionSettingData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -232,7 +156,7 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, ConnectionSettingData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -259,15 +183,15 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG } /// Register a new Auth Connection for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. /// The parameters to provide for creating the Connection Setting. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data, CancellationToken cancellationToken = default) + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, ConnectionSettingData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -282,9 +206,9 @@ public async Task> CreateAsync(string subscri case 200: case 201: { - BotConnectionSettingData value = default; + ConnectionSettingData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotConnectionSettingData.DeserializeBotConnectionSettingData(document.RootElement); + value = ConnectionSettingData.DeserializeConnectionSettingData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -293,15 +217,15 @@ public async Task> CreateAsync(string subscri } /// Register a new Auth Connection for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. /// The parameters to provide for creating the Connection Setting. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, ConnectionSettingData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -316,9 +240,9 @@ public Response Create(string subscriptionId, string r case 200: case 201: { - BotConnectionSettingData value = default; + ConnectionSettingData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotConnectionSettingData.DeserializeBotConnectionSettingData(document.RootElement); + value = ConnectionSettingData.DeserializeConnectionSettingData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -326,7 +250,7 @@ public Response Create(string subscriptionId, string r } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, ConnectionSettingData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -342,7 +266,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, ConnectionSettingData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -369,15 +293,15 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates a Connection Setting registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. /// The parameters to provide for updating the Connection Setting. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, ConnectionSettingData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -392,9 +316,9 @@ public async Task> UpdateAsync(string subscri case 200: case 201: { - BotConnectionSettingData value = default; + ConnectionSettingData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotConnectionSettingData.DeserializeBotConnectionSettingData(document.RootElement); + value = ConnectionSettingData.DeserializeConnectionSettingData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -403,15 +327,15 @@ public async Task> UpdateAsync(string subscri } /// Updates a Connection Setting registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. /// The parameters to provide for updating the Connection Setting. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, BotConnectionSettingData data, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, ConnectionSettingData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -426,9 +350,9 @@ public Response Update(string subscriptionId, string r case 200: case 201: { - BotConnectionSettingData value = default; + ConnectionSettingData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotConnectionSettingData.DeserializeBotConnectionSettingData(document.RootElement); + value = ConnectionSettingData.DeserializeConnectionSettingData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -436,7 +360,7 @@ public Response Update(string subscriptionId, string r } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -452,11 +376,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -474,73 +398,61 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Get a Connection Setting registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Deletes a Connection Setting registration for a Bot Service. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, connectionName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, connectionName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - BotConnectionSettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotConnectionSettingData.DeserializeBotConnectionSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((BotConnectionSettingData)null, message.Response); + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Get a Connection Setting registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Deletes a Connection Setting registration for a Bot Service. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the Bot Service Connection Setting resource. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, connectionName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, connectionName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - BotConnectionSettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotConnectionSettingData.DeserializeBotConnectionSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((BotConnectionSettingData)null, message.Response); + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) + internal RequestUriBuilder CreateListByBotServiceRequestUri(string subscriptionId, string resourceGroupName, string resourceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -550,17 +462,16 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); - uri.AppendPath("/connections/", false); - uri.AppendPath(connectionName, true); + uri.AppendPath("/connections", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) + internal HttpMessage CreateListByBotServiceRequest(string subscriptionId, string resourceGroupName, string resourceName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -569,8 +480,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); - uri.AppendPath("/connections/", false); - uri.AppendPath(connectionName, true); + uri.AppendPath("/connections", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -578,61 +488,65 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Deletes a Connection Setting registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Returns all the Connection Settings registered to a particular BotService resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Bot Service Connection Setting resource. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByBotServiceAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, connectionName); + using var message = CreateListByBotServiceRequest(subscriptionId, resourceGroupName, resourceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + ConnectionSettingResponseList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectionSettingResponseList.DeserializeConnectionSettingResponseList(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Deletes a Connection Setting registration for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Returns all the Connection Settings registered to a particular BotService resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the Bot Service Connection Setting resource. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByBotService(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, connectionName); + using var message = CreateListByBotServiceRequest(subscriptionId, resourceGroupName, resourceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + ConnectionSettingResponseList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectionSettingResponseList.DeserializeConnectionSettingResponseList(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListByBotServiceRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateListWithSecretsRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -642,16 +556,18 @@ internal RequestUriBuilder CreateListByBotServiceRequestUri(string subscriptionI uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); - uri.AppendPath("/connections", false); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/listWithSecrets", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByBotServiceRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateListWithSecretsRequest(string subscriptionId, string resourceGroupName, string resourceName, string connectionName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -660,7 +576,9 @@ internal HttpMessage CreateListByBotServiceRequest(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); - uri.AppendPath("/connections", false); + uri.AppendPath("/connections/", false); + uri.AppendPath(connectionName, true); + uri.AppendPath("/listWithSecrets", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -668,28 +586,30 @@ internal HttpMessage CreateListByBotServiceRequest(string subscriptionId, string return message; } - /// Returns all the Connection Settings registered to a particular BotService resource. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Get a Connection Setting registration for a Bot Service. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. + /// The name of the Bot Service Connection Setting resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByBotServiceAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListWithSecretsAsync(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var message = CreateListByBotServiceRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListWithSecretsRequest(subscriptionId, resourceGroupName, resourceName, connectionName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ConnectionSettingResponseList value = default; + ConnectionSettingData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ConnectionSettingResponseList.DeserializeConnectionSettingResponseList(document.RootElement); + value = ConnectionSettingData.DeserializeConnectionSettingData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -697,28 +617,30 @@ public async Task> ListByBotServiceAsync } } - /// Returns all the Connection Settings registered to a particular BotService resource. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Get a Connection Setting registration for a Bot Service. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. + /// The name of the Bot Service Connection Setting resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByBotService(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListWithSecrets(string subscriptionId, string resourceGroupName, string resourceName, string connectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(connectionName, nameof(connectionName)); - using var message = CreateListByBotServiceRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateListWithSecretsRequest(subscriptionId, resourceGroupName, resourceName, connectionName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ConnectionSettingResponseList value = default; + ConnectionSettingData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ConnectionSettingResponseList.DeserializeConnectionSettingResponseList(document.RootElement); + value = ConnectionSettingData.DeserializeConnectionSettingData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -750,8 +672,8 @@ internal HttpMessage CreateListByBotServiceNextPageRequest(string nextLink, stri /// Returns all the Connection Settings registered to a particular BotService resource. /// The URL to the next page of results. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The cancellation token to use. /// , , or is null. @@ -781,8 +703,8 @@ public async Task> ListByBotServiceNextP /// Returns all the Connection Settings registered to a particular BotService resource. /// The URL to the next page of results. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The cancellation token to use. /// , , or is null. diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/DirectLineRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/DirectLineRestOperations.cs deleted file mode 100644 index 6d3a31bc46f1..000000000000 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/DirectLineRestOperations.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.BotService.Models; - -namespace Azure.ResourceManager.BotService -{ - internal partial class DirectLineRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of DirectLineRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public DirectLineRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-15"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateRegenerateKeysRequestUri(string subscriptionId, string resourceGroupName, string resourceName, RegenerateKeysBotChannelName channelName, BotChannelRegenerateKeysContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/channels/", false); - uri.AppendPath(channelName.ToSerialString(), true); - uri.AppendPath("/regeneratekeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateRegenerateKeysRequest(string subscriptionId, string resourceGroupName, string resourceName, RegenerateKeysBotChannelName channelName, BotChannelRegenerateKeysContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/channels/", false); - uri.AppendPath(channelName.ToSerialString(), true); - uri.AppendPath("/regeneratekeys", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// The name of the Channel resource for which keys are to be regenerated. - /// The parameters to provide for the created bot. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> RegenerateKeysAsync(string subscriptionId, string resourceGroupName, string resourceName, RegenerateKeysBotChannelName channelName, BotChannelRegenerateKeysContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, resourceName, channelName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BotChannelData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotChannelData.DeserializeBotChannelData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Regenerates secret keys and returns them for the DirectLine Channel of a particular BotService resource. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// The name of the Channel resource for which keys are to be regenerated. - /// The parameters to provide for the created bot. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response RegenerateKeys(string subscriptionId, string resourceGroupName, string resourceName, RegenerateKeysBotChannelName channelName, BotChannelRegenerateKeysContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateRegenerateKeysRequest(subscriptionId, resourceGroupName, resourceName, channelName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BotChannelData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotChannelData.DeserializeBotChannelData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/EmailRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/EmailRestOperations.cs deleted file mode 100644 index e15d04ca7548..000000000000 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/EmailRestOperations.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.BotService.Models; - -namespace Azure.ResourceManager.BotService -{ - internal partial class EmailRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of EmailRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public EmailRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-15"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateCreateSignInUrlRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/createEmailSignInUrl", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateSignInUrlRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/createEmailSignInUrl", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Creates an email channel sign in url for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> CreateSignInUrlAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateCreateSignInUrlRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BotCreateEmailSignInUriResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotCreateEmailSignInUriResult.DeserializeBotCreateEmailSignInUriResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates an email channel sign in url for a Bot Service. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateSignInUrl(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateCreateSignInUrlRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BotCreateEmailSignInUriResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotCreateEmailSignInUriResult.DeserializeBotCreateEmailSignInUriResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/HostSettingsRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/HostSettingsOperationGroupRestOperations.cs similarity index 79% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/HostSettingsRestOperations.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/HostSettingsOperationGroupRestOperations.cs index 86985a100647..2746d90f1207 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/HostSettingsRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/HostSettingsOperationGroupRestOperations.cs @@ -15,24 +15,24 @@ namespace Azure.ResourceManager.BotService { - internal partial class HostSettingsRestOperations + internal partial class HostSettingsOperationGroupRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of HostSettingsRestOperations. + /// Initializes a new instance of HostSettingsOperationGroupRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. - public HostSettingsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public HostSettingsOperationGroupRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-15"; + _apiVersion = apiVersion ?? "2023-09-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -65,11 +65,11 @@ internal HttpMessage CreateGetRequest(string subscriptionId) } /// Get per subscription settings needed to host bot in compute resource such as Azure App Service. - /// Azure Subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -79,9 +79,9 @@ public async Task> GetAsync(string subscr { case 200: { - BotServiceHostSettingsResult value = default; + HostSettingsResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotServiceHostSettingsResult.DeserializeBotServiceHostSettingsResult(document.RootElement); + value = HostSettingsResponse.DeserializeHostSettingsResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -90,11 +90,11 @@ public async Task> GetAsync(string subscr } /// Get per subscription settings needed to host bot in compute resource such as Azure App Service. - /// Azure Subscription ID. + /// The ID of the target subscription. The value must be an UUID. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -104,9 +104,9 @@ public Response Get(string subscriptionId, Cancell { case 200: { - BotServiceHostSettingsResult value = default; + HostSettingsResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotServiceHostSettingsResult.DeserializeBotServiceHostSettingsResult(document.RootElement); + value = HostSettingsResponse.DeserializeHostSettingsResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs new file mode 100644 index 000000000000..77b8a83958ce --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs @@ -0,0 +1,415 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.BotService.Models; + +namespace Azure.ResourceManager.BotService +{ + internal partial class NetworkSecurityPerimeterConfigurationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NetworkSecurityPerimeterConfigurationsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public NetworkSecurityPerimeterConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-09-15-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string networkSecurityPerimeterConfigurationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); + uri.AppendPath(networkSecurityPerimeterConfigurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string networkSecurityPerimeterConfigurationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); + uri.AppendPath(networkSecurityPerimeterConfigurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified Network Security Perimeter configuration associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The resource association Name. Composed of parameter guid and association name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, networkSecurityPerimeterConfigurationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkSecurityPerimeterConfigurationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkSecurityPerimeterConfigurationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified Network Security Perimeter configuration associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The resource association Name. Composed of parameter guid and association name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string resourceName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, networkSecurityPerimeterConfigurationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkSecurityPerimeterConfigurationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NetworkSecurityPerimeterConfigurationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/networkSecurityPerimeterConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/networkSecurityPerimeterConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Network Security Perimeter configurations associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkSecurityPerimeterConfigurationList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkSecurityPerimeterConfigurationList.DeserializeNetworkSecurityPerimeterConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Network Security Perimeter configurations associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkSecurityPerimeterConfigurationList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkSecurityPerimeterConfigurationList.DeserializeNetworkSecurityPerimeterConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateReconcileRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string networkSecurityPerimeterConfigurationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); + uri.AppendPath(networkSecurityPerimeterConfigurationName, true); + uri.AppendPath("/reconcile", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateReconcileRequest(string subscriptionId, string resourceGroupName, string resourceName, string networkSecurityPerimeterConfigurationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); + uri.AppendPath(resourceName, true); + uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); + uri.AppendPath(networkSecurityPerimeterConfigurationName, true); + uri.AppendPath("/reconcile", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Reconcile the specified Network Security Perimeter configuration associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The resource association Name. Composed of parameter guid and association name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task ReconcileAsync(string subscriptionId, string resourceGroupName, string resourceName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); + + using var message = CreateReconcileRequest(subscriptionId, resourceGroupName, resourceName, networkSecurityPerimeterConfigurationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Reconcile the specified Network Security Perimeter configuration associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The resource association Name. Composed of parameter guid and association name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Reconcile(string subscriptionId, string resourceGroupName, string resourceName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(networkSecurityPerimeterConfigurationName, nameof(networkSecurityPerimeterConfigurationName)); + + using var message = CreateReconcileRequest(subscriptionId, resourceGroupName, resourceName, networkSecurityPerimeterConfigurationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Network Security Perimeter configurations associated with the Bot. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkSecurityPerimeterConfigurationList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NetworkSecurityPerimeterConfigurationList.DeserializeNetworkSecurityPerimeterConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Network Security Perimeter configurations associated with the Bot. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkSecurityPerimeterConfigurationList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NetworkSecurityPerimeterConfigurationList.DeserializeNetworkSecurityPerimeterConfigurationList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/OperationResultsOperationGroupRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/OperationResultsOperationGroupRestOperations.cs new file mode 100644 index 000000000000..515832a7b202 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/OperationResultsOperationGroupRestOperations.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.BotService +{ + internal partial class OperationResultsOperationGroupRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of OperationResultsOperationGroupRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public OperationResultsOperationGroupRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-09-15-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string operationResultId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.BotService/operationresults/", false); + uri.AppendPath(operationResultId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string operationResultId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.BotService/operationresults/", false); + uri.AppendPath(operationResultId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the operation result for a long running operation. + /// The ID of the target subscription. The value must be an UUID. + /// The ID of the operation result to get. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task GetAsync(string subscriptionId, string operationResultId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(operationResultId, nameof(operationResultId)); + + using var message = CreateGetRequest(subscriptionId, operationResultId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the operation result for a long running operation. + /// The ID of the target subscription. The value must be an UUID. + /// The ID of the operation result to get. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string operationResultId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(operationResultId, nameof(operationResultId)); + + using var message = CreateGetRequest(subscriptionId, operationResultId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/OperationsRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/OperationsRestOperations.cs new file mode 100644 index 000000000000..2056ef07e526 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/OperationsRestOperations.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.BotService.Models; + +namespace Azure.ResourceManager.BotService +{ + internal partial class OperationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of OperationsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public OperationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-09-15-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri() + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.BotService/operations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.BotService/operations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the operations for the provider. + /// The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationEntityListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperationEntityListResult.DeserializeOperationEntityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the operations for the provider. + /// The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationEntityListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperationEntityListResult.DeserializeOperationEntityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List the operations for the provider. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + + using var message = CreateListNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationEntityListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperationEntityListResult.DeserializeOperationEntityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List the operations for the provider. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + + using var message = CreateListNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationEntityListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperationEntityListResult.DeserializeOperationEntityListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index bc6129bfae64..155c3e9ed7df 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -25,18 +25,18 @@ internal partial class PrivateEndpointConnectionsRestOperations /// Initializes a new instance of PrivateEndpointConnectionsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-15"; + _apiVersion = apiVersion ?? "2023-09-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string resourceName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,12 +46,13 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections", false); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -64,7 +65,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections", false); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -72,65 +74,73 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro return message; } - /// List all the private endpoint connections associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Gets the specified private endpoint connection associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - BotServicePrivateEndpointConnectionListResult value = default; + BotServicePrivateEndpointConnectionData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotServicePrivateEndpointConnectionListResult.DeserializeBotServicePrivateEndpointConnectionListResult(document.RootElement); + value = BotServicePrivateEndpointConnectionData.DeserializeBotServicePrivateEndpointConnectionData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((BotServicePrivateEndpointConnectionData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// List all the private endpoint connections associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Gets the specified private endpoint connection associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. + /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - BotServicePrivateEndpointConnectionListResult value = default; + BotServicePrivateEndpointConnectionData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotServicePrivateEndpointConnectionListResult.DeserializeBotServicePrivateEndpointConnectionListResult(document.RootElement); + value = BotServicePrivateEndpointConnectionData.DeserializeBotServicePrivateEndpointConnectionData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((BotServicePrivateEndpointConnectionData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, BotServicePrivateEndpointConnectionData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -146,11 +156,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, BotServicePrivateEndpointConnectionData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -164,26 +174,32 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Gets the specified private endpoint connection associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Update the state of specified private endpoint connection associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the private endpoint connection associated with the Azure resource. + /// The private endpoint connection properties. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, BotServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -194,29 +210,29 @@ public async Task> GetAsync(st value = BotServicePrivateEndpointConnectionData.DeserializeBotServicePrivateEndpointConnectionData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((BotServicePrivateEndpointConnectionData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets the specified private endpoint connection associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Update the state of specified private endpoint connection associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the private endpoint connection associated with the Azure resource. + /// The private endpoint connection properties. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + public Response Create(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, BotServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -227,14 +243,12 @@ public Response Get(string subscription value = BotServicePrivateEndpointConnectionData.DeserializeBotServicePrivateEndpointConnectionData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((BotServicePrivateEndpointConnectionData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, BotServicePrivateEndpointConnectionData data) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -250,11 +264,11 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, BotServicePrivateEndpointConnectionData data) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -268,81 +282,65 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Update the state of specified private endpoint connection associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Deletes the specified private endpoint connection associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the private endpoint connection associated with the Azure resource. - /// The private endpoint connection properties. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, BotServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName, data); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - BotServicePrivateEndpointConnectionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotServicePrivateEndpointConnectionData.DeserializeBotServicePrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Update the state of specified private endpoint connection associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// Deletes the specified private endpoint connection associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. /// The name of the private endpoint connection associated with the Azure resource. - /// The private endpoint connection properties. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, BotServicePrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName, data); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - BotServicePrivateEndpointConnectionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotServicePrivateEndpointConnectionData.DeserializeBotServicePrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string resourceName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -352,17 +350,16 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendPath("/privateEndpointConnections", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string resourceName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -371,8 +368,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); uri.AppendPath(resourceName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendPath("/privateEndpointConnections", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -380,55 +376,143 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Deletes the specified private endpoint connection associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// List all the private endpoint connections associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + BotServicePrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BotServicePrivateEndpointConnectionListResult.DeserializeBotServicePrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Deletes the specified private endpoint connection associated with the Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. + /// List all the private endpoint connections associated with the Bot. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the Bot resource. - /// The name of the private endpoint connection associated with the Azure resource. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceName, privateEndpointConnectionName); + using var message = CreateListRequest(subscriptionId, resourceGroupName, resourceName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + BotServicePrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BotServicePrivateEndpointConnectionListResult.DeserializeBotServicePrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the private endpoint connections associated with the Bot. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BotServicePrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BotServicePrivateEndpointConnectionListResult.DeserializeBotServicePrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the private endpoint connections associated with the Bot. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Bot resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BotServicePrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BotServicePrivateEndpointConnectionListResult.DeserializeBotServicePrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs deleted file mode 100644 index ad5a8e6b076e..000000000000 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.BotService.Models; - -namespace Azure.ResourceManager.BotService -{ - internal partial class PrivateLinkResourcesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of PrivateLinkResourcesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-15"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListByBotResourceRequestUri(string subscriptionId, string resourceGroupName, string resourceName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByBotResourceRequest(string subscriptionId, string resourceGroupName, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.BotService/botServices/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the private link resources that need to be created for a Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByBotResourceAsync(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByBotResourceRequest(subscriptionId, resourceGroupName, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BotServicePrivateLinkResourceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = BotServicePrivateLinkResourceListResult.DeserializeBotServicePrivateLinkResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the private link resources that need to be created for a Bot. - /// Azure Subscription ID. - /// The name of the Bot resource group in the user subscription. - /// The name of the Bot resource. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByBotResource(string subscriptionId, string resourceGroupName, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByBotResourceRequest(subscriptionId, resourceGroupName, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BotServicePrivateLinkResourceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = BotServicePrivateLinkResourceListResult.DeserializeBotServicePrivateLinkResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/QnAMakerEndpointKeysRestOperations.cs b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/QnAMakerEndpointKeysOperationGroupRestOperations.cs similarity index 64% rename from sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/QnAMakerEndpointKeysRestOperations.cs rename to sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/QnAMakerEndpointKeysOperationGroupRestOperations.cs index c93157890eec..0052e60927a0 100644 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/QnAMakerEndpointKeysRestOperations.cs +++ b/sdk/botservice/Azure.ResourceManager.BotService/src/Generated/RestOperations/QnAMakerEndpointKeysOperationGroupRestOperations.cs @@ -15,28 +15,28 @@ namespace Azure.ResourceManager.BotService { - internal partial class QnAMakerEndpointKeysRestOperations + internal partial class QnAMakerEndpointKeysOperationGroupRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of QnAMakerEndpointKeysRestOperations. + /// Initializes a new instance of QnAMakerEndpointKeysOperationGroupRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. - public QnAMakerEndpointKeysRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public QnAMakerEndpointKeysOperationGroupRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-09-15"; + _apiVersion = apiVersion ?? "2023-09-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, GetBotServiceQnAMakerEndpointKeyContent content) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, QnAMakerEndpointKeysRequestBody qnAMakerEndpointKeysRequestBody) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -47,7 +47,7 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, GetBotServ return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, GetBotServiceQnAMakerEndpointKeyContent content) + internal HttpMessage CreateGetRequest(string subscriptionId, QnAMakerEndpointKeysRequestBody qnAMakerEndpointKeysRequestBody) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -61,33 +61,33 @@ internal HttpMessage CreateGetRequest(string subscriptionId, GetBotServiceQnAMak request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(qnAMakerEndpointKeysRequestBody, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } /// Lists the QnA Maker endpoint keys. - /// Azure Subscription ID. - /// The request body parameters to provide for the check name availability request. + /// The ID of the target subscription. The value must be an UUID. + /// The request body. /// The cancellation token to use. - /// or is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, QnAMakerEndpointKeysRequestBody qnAMakerEndpointKeysRequestBody, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(qnAMakerEndpointKeysRequestBody, nameof(qnAMakerEndpointKeysRequestBody)); - using var message = CreateGetRequest(subscriptionId, content); + using var message = CreateGetRequest(subscriptionId, qnAMakerEndpointKeysRequestBody); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - GetBotServiceQnAMakerEndpointKeyResult value = default; + QnAMakerEndpointKeysResponse value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = GetBotServiceQnAMakerEndpointKeyResult.DeserializeGetBotServiceQnAMakerEndpointKeyResult(document.RootElement); + value = QnAMakerEndpointKeysResponse.DeserializeQnAMakerEndpointKeysResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -96,25 +96,25 @@ public async Task> GetAsync(str } /// Lists the QnA Maker endpoint keys. - /// Azure Subscription ID. - /// The request body parameters to provide for the check name availability request. + /// The ID of the target subscription. The value must be an UUID. + /// The request body. /// The cancellation token to use. - /// or is null. + /// or is null. /// is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, GetBotServiceQnAMakerEndpointKeyContent content, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, QnAMakerEndpointKeysRequestBody qnAMakerEndpointKeysRequestBody, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(qnAMakerEndpointKeysRequestBody, nameof(qnAMakerEndpointKeysRequestBody)); - using var message = CreateGetRequest(subscriptionId, content); + using var message = CreateGetRequest(subscriptionId, qnAMakerEndpointKeysRequestBody); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - GetBotServiceQnAMakerEndpointKeyResult value = default; + QnAMakerEndpointKeysResponse value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = GetBotServiceQnAMakerEndpointKeyResult.DeserializeGetBotServiceQnAMakerEndpointKeyResult(document.RootElement); + value = QnAMakerEndpointKeysResponse.DeserializeQnAMakerEndpointKeysResponse(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/botservice/Azure.ResourceManager.BotService/src/autorest.md b/sdk/botservice/Azure.ResourceManager.BotService/src/autorest.md deleted file mode 100644 index 558ac811041e..000000000000 --- a/sdk/botservice/Azure.ResourceManager.BotService/src/autorest.md +++ /dev/null @@ -1,125 +0,0 @@ -# Generated code configuration - -Run `dotnet build /t:GenerateCode` to generate code. - -``` yaml - -azure-arm: true -csharp: true -library-name: BotService -namespace: Azure.ResourceManager.BotService -# default tag is now a stable version -require: https://github.com/Azure/azure-rest-api-specs/blob/8468620c009664ed91a3148c04cf77b6c8eb7b6f/specification/botservice/resource-manager/readme.md -output-folder: $(this-folder)/Generated -clear-output-folder: true -sample-gen: - output-folder: $(this-folder)/../samples/Generated - clear-output-folder: true -skip-csproj: true -modelerfour: - flatten-payloads: false -use-model-reader-writer: true - -format-by-name-rules: - 'tenantId': 'uuid' - 'ETag': 'etag' - 'location': 'azure-location' - '*Uri': 'Uri' - '*Uris': 'Uri' - -acronym-mapping: - CPU: Cpu - CPUs: Cpus - Os: OS - Ip: IP - Ips: IPs|ips - ID: Id - IDs: Ids - VM: Vm - VMs: Vms - Vmos: VmOS - VMScaleSet: VmScaleSet - DNS: Dns - VPN: Vpn - NAT: Nat - WAN: Wan - Ipv4: IPv4|ipv4 - Ipv6: IPv6|ipv6 - Ipsec: IPsec|ipsec - SSO: Sso - URI: Uri - Etag: ETag|etag - SKU: Sku - -override-operation-name: - Bots_GetCheckNameAvailability: CheckBotServiceNameAvailability - Email_CreateSignInUrl: CreateEmailSignInUri - HostSettings_Get: GetBotServiceHostSettings - Channels_ListWithKeys: GetChannelWithKeys - QnAMakerEndpointKeys_Get: GetBotServiceQnAMakerEndpointKey - BotConnection_ListServiceProviders: GetBotConnectionServiceProviders - DirectLine_RegenerateKeys: GetBotChannelWithRegenerateKeys - -rename-mapping: - ConnectionSetting: BotConnectionSetting - AlexaChannelProperties.urlFragment: UriFragment - BotProperties.endpoint: -|uri - BotProperties.msaAppMSIResourceId: -|arm-id - BotProperties.disableLocalAuth: IsLocalAuthDisabled - BotProperties.storageResourceId: -|arm-id - PrivateLinkResource: BotServicePrivateLinkResourceData - Channel: BotChannelProperties - ChannelName: BotChannelName - ChannelSettings: BotChannelSettings - CheckNameAvailabilityRequestBody: BotServiceNameAvailabilityContent - CheckNameAvailabilityRequestBody.type: ResourceType|resource-type - CheckNameAvailabilityResponseBody: BotServiceNameAvailabilityResult - CheckNameAvailabilityResponseBody.valid: IsValid - ConnectionSettingParameter: BotConnectionSettingParameter - ConnectionSettingProperties: BotConnectionSettingProperties - CreateEmailSignInUrlResponse: BotCreateEmailSignInUriResult - CreateEmailSignInUrlResponse.id: -|arm-id - Site: BotChannelSite - HostSettingsResponse: BotServiceHostSettingsResult - Key: BotServiceKey - ListChannelWithKeysResponse: BotChannelGetWithKeysResult - MsaAppType: BotMsaAppType - MsTeamsChannelProperties.enableCalling: IsCallingEnabled - PublicNetworkAccess: BotServicePublicNetworkAccess - QnAMakerEndpointKeysRequestBody: GetBotServiceQnAMakerEndpointKeyContent - QnAMakerEndpointKeysResponse: GetBotServiceQnAMakerEndpointKeyResult - RegenerateKeysChannelName: RegenerateKeysBotChannelName - ServiceProvider: BotServiceProvider - ServiceProviderParameter: BotServiceProviderParameter - ServiceProviderProperties: BotServiceProviderProperties - SiteInfo: BotChannelRegenerateKeysContent - SkypeChannelProperties.enableMessaging: IsMessagingEnabled - SkypeChannelProperties.enableMediaCards: IsMediaCardsEnabled - SkypeChannelProperties.enableVideo: IsVideoEnabled - SkypeChannelProperties.enableCalling: IsCallingEnabled - SkypeChannelProperties.enableScreenSharing: IsScreenSharingEnabled - SkypeChannelProperties.enableGroups: IsGroupsEnabled - ServiceProviderParameterMetadataConstraints.required: IsRequired - DirectLineSpeechChannelProperties.cognitiveServiceResourceId: -|arm-id - TelephonyChannelResourceApiConfiguration.cognitiveServiceResourceId: -|arm-id - TelephonyPhoneNumbers.acsResourceId: -|arm-id - TelephonyPhoneNumbers.cognitiveServiceResourceId: -|arm-id - -directive: - - remove-operation: OperationResults_Get # remove this because this is a LRO related operations, we should not expose it. - - from: botservice.json - where: $.paths..parameters[?(@.name=='channelName')] - transform: > - $ = { - "$ref": "#/parameters/channelNameParameter" - }; - - from: botservice.json - where: $.definitions - transform: > - $.EmailChannelAuthMethod['type'] = 'integer'; - - from: botservice.json - where: $.parameters - transform: > - $.channelNameParameter['x-ms-enum']['modelAsString'] = true; - -``` diff --git a/sdk/botservice/Azure.ResourceManager.BotService/tsp-location.yaml b/sdk/botservice/Azure.ResourceManager.BotService/tsp-location.yaml new file mode 100644 index 000000000000..a6937a17c515 --- /dev/null +++ b/sdk/botservice/Azure.ResourceManager.BotService/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/botservice/BotService.Management +commit: 7be0444544b6bdd1aad8f9103f7620602aec7a1c +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/